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 | |
Damien Miller | 99bca60 | 2000-07-11 12:02:36 +1000 | [diff] [blame] | 13 | #define NAME_MAX 255 |
| 14 | struct dirent { |
| 15 | off_t d_off; |
| 16 | unsigned long d_fileno; |
| 17 | unsigned short d_reclen; |
| 18 | unsigned short d_namlen; |
| 19 | char d_name[NAME_MAX + 1]; |
| 20 | }; |
| 21 | |
| 22 | struct utimbuf { |
| 23 | time_t actime; |
| 24 | time_t modtime; |
| 25 | }; |
| 26 | |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 27 | /* FILE */ |
| 28 | #define O_NONBLOCK 00004 /* non-blocking open */ |
| 29 | |
| 30 | /* WAITPID */ |
| 31 | #undef WIFEXITED |
| 32 | #undef WIFSTOPPED |
| 33 | #undef WIFSIGNALED |
| 34 | |
Damien Miller | 31abc9a | 2000-07-09 23:26:27 +1000 | [diff] [blame] | 35 | #define _W_INT(w) (*(int*)&(w)) /* convert union wait to int */ |
| 36 | #define WIFEXITED(w) (!((_W_INT(w)) & 0377)) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 37 | #define WIFSTOPPED(w) ((_W_INT(w)) & 0100) |
Damien Miller | 31abc9a | 2000-07-09 23:26:27 +1000 | [diff] [blame] | 38 | #define WIFSIGNALED(w) (!WIFEXITED(w) && !WIFSTOPPED(w)) |
| 39 | #define WEXITSTATUS(w) (int)(WIFEXITED(w) ? ((_W_INT(w) >> 8) & 0377) : -1) |
| 40 | #define WTERMSIG(w) (int)(WIFSIGNALED(w) ? (_W_INT(w) & 0177) : -1) |
| 41 | #define WCOREFLAG 0x80 |
| 42 | #define WCOREDUMP(w) ((_W_INT(w)) & WCOREFLAG) |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 43 | |
| 44 | int waitpid(int pid,int *stat_loc,int options); |
| 45 | #define getpgrp() getpgrp(0) |
| 46 | pid_t setsid(void); |
| 47 | |
| 48 | /* TC */ |
| 49 | int tcgetattr(int fd,struct termios *t); |
| 50 | int tcsetattr(int fd,int opt,const struct termios *t); |
| 51 | int tcsetpgrp(int fd, pid_t pgrp); |
| 52 | speed_t cfgetospeed(const struct termios *t); |
| 53 | speed_t cfgetispeed(const struct termios *t); |
| 54 | int cfsetospeed(struct termios *t,int speed); |
Damien Miller | 99bca60 | 2000-07-11 12:02:36 +1000 | [diff] [blame] | 55 | |
| 56 | |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 57 | #endif /* HAVE_NEXT */ |
Damien Miller | 0f91b4e | 2000-06-18 15:43:25 +1000 | [diff] [blame] | 58 | #endif /* _NEXT_POSIX_H */ |