blob: 2eb061ac7f40d608df356f70fa1c271a94e2acc7 [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
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
30int waitpid(int pid,int *stat_loc,int options);
31#define getpgrp() getpgrp(0)
32pid_t setsid(void);
33
34/* TC */
35int tcgetattr(int fd,struct termios *t);
36int tcsetattr(int fd,int opt,const struct termios *t);
37int tcsetpgrp(int fd, pid_t pgrp);
38speed_t cfgetospeed(const struct termios *t);
39speed_t cfgetispeed(const struct termios *t);
40int cfsetospeed(struct termios *t,int speed);
41
42/* Sig*() */
43typedef sigset_t;
44#define SIG_BLOCK 00
45#define SIG_UNBLOCK 01
46#define SIG_SETMASK 02
47#define SA_RESTART 00
48struct sigaction {
49 void (*sa_handler)();
50 sigset_t sa_mask;
51 int sa_flags;
52};
53
54int sigemptyset(sigset_t *set);
55int sigaddset(sigset_t *set, int signum);
56int sigprocmask(int how, const sigset_t *set, sigset_t *oldset);
57int sigsuspend(const sigset_t *mask);
58int sigaction(int signum,const struct sigaction *act, struct sigaction *oldact);
59
60#endif /* HAVE_NEXT */
61
62#endif /* _NEXT_POSIX_H */