blob: 86683db59b2f83bb8b07a0c37d5dcb612a45b04d [file] [log] [blame]
Damien Miller0f91b4e2000-06-18 15:43:25 +10001/*
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 Miller99bca602000-07-11 12:02:36 +100013#define NAME_MAX 255
14struct 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
22struct utimbuf {
23 time_t actime;
24 time_t modtime;
25};
26
Damien Miller0f91b4e2000-06-18 15:43:25 +100027/* FILE */
28#define O_NONBLOCK 00004 /* non-blocking open */
29
30/* WAITPID */
31#undef WIFEXITED
32#undef WIFSTOPPED
33#undef WIFSIGNALED
34
Damien Miller31abc9a2000-07-09 23:26:27 +100035#define _W_INT(w) (*(int*)&(w)) /* convert union wait to int */
36#define WIFEXITED(w) (!((_W_INT(w)) & 0377))
Damien Miller0f91b4e2000-06-18 15:43:25 +100037#define WIFSTOPPED(w) ((_W_INT(w)) & 0100)
Damien Miller31abc9a2000-07-09 23:26:27 +100038#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 Miller0f91b4e2000-06-18 15:43:25 +100043
44int waitpid(int pid,int *stat_loc,int options);
45#define getpgrp() getpgrp(0)
46pid_t setsid(void);
47
48/* TC */
49int tcgetattr(int fd,struct termios *t);
50int tcsetattr(int fd,int opt,const struct termios *t);
51int tcsetpgrp(int fd, pid_t pgrp);
52speed_t cfgetospeed(const struct termios *t);
53speed_t cfgetispeed(const struct termios *t);
54int cfsetospeed(struct termios *t,int speed);
Damien Miller99bca602000-07-11 12:02:36 +100055
56
Damien Miller0f91b4e2000-06-18 15:43:25 +100057#endif /* HAVE_NEXT */
Damien Miller0f91b4e2000-06-18 15:43:25 +100058#endif /* _NEXT_POSIX_H */