metal-cos/sys/include/wait.h

25 lines
543 B
C
Raw Normal View History

2023-10-02 23:34:24 +00:00
#ifndef __SYS_WAIT_H__
#define __SYS_WAIT_H__
#include <sys/cdefs.h>
2023-10-02 23:53:08 +00:00
/* Extract the status code from the status */
2023-10-02 23:34:24 +00:00
#define WEXITSTATUS(_x) (_x & 0x000000ff)
2023-10-02 23:53:08 +00:00
#define _WSTATUS(_x) ((_x & 0x0000ff00) >> 8)
/* Exited gracefully */
#define WIFEXITED(_x) (_WSTATUS(_x) == 0)
/* Extract the pid from the status (Castor specific) */
2023-10-02 23:34:24 +00:00
#define WGETPID(_x) ((pid_t)(_x >> 16))
/* Flags to waitpid */
#define WAIT_ANY 0
#ifndef _KERNEL
pid_t wait(int *status);
pid_t waitpid(pid_t pid, int *status, int options);
#endif
#endif /* __SYS_WAIT_H__ */