minix/include/sys/wait.h
Tomas Hruby 0b8e20c89e Changes to the include files in order to make cross-compilation possible.
- The primary reason is that mkfs and installboot need to run natively during
  the cross compilation (host and target versions are compiled). There is a
  collision of include files though. E.g. a.out.h is very minix-specific.
  Therefore some files we moved and replaced by stubs that include the original
  file if compiling on or for Minix :
  
  include/a.out.h -> include/minix/a.out.h
  include/sys/dir.h -> include/minix/dir.h
  include/dirent.h -> include/minix/dirent.h
  include/sys/types.h -> include/minix/types.h

- This does not break any native compilation on Minix. Other headers that were
  including the original files are changed according to include directly the
  new, minix specific location not to pick up the host system includes while
  cross-compiling.

- role of this patch is to make rebasing of the build branch simpler until the
  new build system is merged
2009-11-06 08:46:22 +00:00

40 lines
1.3 KiB
C
Executable file

/* The <sys/wait.h> header contains macros related to wait(). The value
* returned by wait() and waitpid() depends on whether the process
* terminated by an exit() call, was killed by a signal, or was stopped
* due to job control, as follows:
*
* High byte Low byte
* +---------------------+
* exit(status) | status | 0 |
* +---------------------+
* killed by signal | 0 | signal |
* +---------------------+
* stopped (job control) | signal | 0177 |
* +---------------------+
*/
#ifndef _WAIT_H
#define _WAIT_H
#ifndef _TYPES_H
#include <minix/types.h>
#endif
#define _LOW(v) ( (v) & 0377)
#define _HIGH(v) ( ((v) >> 8) & 0377)
#define WNOHANG 1 /* do not wait for child to exit */
#define WUNTRACED 2 /* for job control; not implemented */
#define WIFEXITED(s) (_LOW(s) == 0) /* normal exit */
#define WEXITSTATUS(s) (_HIGH(s)) /* exit status */
#define WTERMSIG(s) (_LOW(s) & 0177) /* sig value */
#define WIFSIGNALED(s) (((unsigned int)(s)-1 & 0xFFFF) < 0xFF) /* signaled */
#define WIFSTOPPED(s) (_LOW(s) == 0177) /* stopped */
#define WSTOPSIG(s) (_HIGH(s) & 0377) /* stop signal */
/* Function Prototypes. */
_PROTOTYPE( pid_t wait, (int *_stat_loc) );
_PROTOTYPE( pid_t waitpid, (pid_t _pid, int *_stat_loc, int _options) );
#endif /* _WAIT_H */