66 lines
1.6 KiB
C
66 lines
1.6 KiB
C
/* wait.h - wait facility library header */
|
|
|
|
/*
|
|
* Copyright (c) 2003-2005 Wind River Systems, Inc.
|
|
*
|
|
* The right to copy, distribute or otherwise make use of this software
|
|
* may be licensed only pursuant to the terms of an applicable Wind River
|
|
* license agreement.
|
|
*/
|
|
|
|
/*
|
|
modification history
|
|
--------------------
|
|
01d,24aug05,kk updated wait() and waitpid() API
|
|
01c,27aug04,md fixed WIFSIGNALED() macro
|
|
01b,26nov03,nrj added function prototype
|
|
01a,28oct03,nrj written from posix spec
|
|
*/
|
|
|
|
#ifndef __INCwaith
|
|
#define __INCwaith
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define WNOHANG 0x01 /* do not hang if no status is */
|
|
/* available; return immediately */
|
|
|
|
/* not supported, for compatibility */
|
|
|
|
#define WUNTRACED 0x02 /* report status of stopped childs */
|
|
|
|
/* macros for analyzing process status */
|
|
|
|
#define WIFEXITED(status) ((int)((status) & 0xFF00) == 0)
|
|
#define WIFSIGNALED(status) ((int)((status) & 0xFF00) != 0)
|
|
#define WIFSTOPPED(status) ((int)((status) & 0xFF0000) != 0)
|
|
#define WEXITSTATUS(status) ((int)((status) & 0xFF))
|
|
#define WTERMSIG(status) ((int)(((status) >> 8) & 0xFF))
|
|
#define WSTOPSIG(status) ((int)(((status) >> 16) & 0xFF))
|
|
|
|
/* Only include while building kernel */
|
|
|
|
#ifdef _WRS_KERNEL
|
|
|
|
#define SET_EXITSTATUS(status) ((int)((status)&0xFF))
|
|
#define SET_TERMSIG(sig) ((int)(((sig)<<8)&0xFF00))
|
|
#define SET_STOPSIG(sig) ((int)(((sig)<<16)&0xFF0000))
|
|
|
|
extern RTP_ID wait(int *);
|
|
extern RTP_ID waitpid(RTP_ID, int *, int);
|
|
|
|
#else
|
|
|
|
extern pid_t wait(int *);
|
|
extern pid_t waitpid(pid_t, int *, int);
|
|
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* __INCwaith */
|