Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 1 | /* |
| 2 | * Defines and prototypes specific to NeXT system |
| 3 | */ |
| 4 | |
| 5 | #ifndef _NEXT_POSIX_H |
| 6 | #define _NEXT_POSIX_H |
| 7 | |
| 8 | #ifdef HAVE_NEXT |
| 9 | |
| 10 | #include <libc.h> |
| 11 | #include <sys/dir.h> |
| 12 | |
| 13 | /* FILE */ |
| 14 | #define O_NONBLOCK 00004 /* non-blocking open */ |
| 15 | |
| 16 | /* WAITPID */ |
| 17 | #undef WIFEXITED |
| 18 | #undef WIFSTOPPED |
| 19 | #undef WIFSIGNALED |
| 20 | |
| 21 | #define _W_INT(w) (*(int*)&(w)) /* convert union wait to int */ |
| 22 | #define WIFEXITED(w) (!((_W_INT(w)) & 0377)) |
| 23 | #define WIFSTOPPED(w) ((_W_INT(w)) & 0100) |
| 24 | #define WIFSIGNALED(w) (!WIFEXITED(x) && !WIFSTOPPED(x)) |
| 25 | #define WEXITSTATUS(w) (int)(WIFEXITED(x) ? ((_W_INT(w) >> 8) & 0377) : -1) |
| 26 | #define WTERMSIG(w) (int)(WIFSIGNALED(x) ? (_W_INT(w) & 0177) : -1) |
| 27 | #define WCOREFLAG 0x80 |
| 28 | #define WCOREDUMP(w) ((_W_INT(w)) & WCOREFLAG) |
| 29 | |
| 30 | int waitpid(int pid,int *stat_loc,int options); |
| 31 | #define getpgrp() getpgrp(0) |
| 32 | pid_t setsid(void); |
| 33 | |
| 34 | /* TC */ |
| 35 | int tcgetattr(int fd,struct termios *t); |
| 36 | int tcsetattr(int fd,int opt,const struct termios *t); |
| 37 | int tcsetpgrp(int fd, pid_t pgrp); |
| 38 | speed_t cfgetospeed(const struct termios *t); |
| 39 | speed_t cfgetispeed(const struct termios *t); |
| 40 | int cfsetospeed(struct termios *t,int speed); |
| 41 | |
| 42 | /* Sig*() */ |
| 43 | typedef sigset_t; |
| 44 | #define SIG_BLOCK 00 |
| 45 | #define SIG_UNBLOCK 01 |
| 46 | #define SIG_SETMASK 02 |
| 47 | #define SA_RESTART 00 |
| 48 | struct sigaction { |
| 49 | void (*sa_handler)(); |
| 50 | sigset_t sa_mask; |
| 51 | int sa_flags; |
| 52 | }; |
| 53 | |
| 54 | int sigemptyset(sigset_t *set); |
| 55 | int sigaddset(sigset_t *set, int signum); |
| 56 | int sigprocmask(int how, const sigset_t *set, sigset_t *oldset); |
| 57 | int sigsuspend(const sigset_t *mask); |
| 58 | int sigaction(int signum,const struct sigaction *act, struct sigaction *oldact); |
| 59 | |
| 60 | #endif /* HAVE_NEXT */ |
| 61 | |
| 62 | #endif /* _NEXT_POSIX_H */ |