2000-06-18 13:43:25 +08:00
|
|
|
/*
|
|
|
|
* Defines and prototypes specific to NeXT system
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _NEXT_POSIX_H
|
|
|
|
#define _NEXT_POSIX_H
|
|
|
|
|
|
|
|
#ifdef HAVE_NEXT
|
|
|
|
|
|
|
|
#include <libc.h>
|
|
|
|
#include <sys/dir.h>
|
|
|
|
|
2000-08-30 07:11:30 +08:00
|
|
|
/* readdir() returns struct direct (BSD) not struct dirent (POSIX) */
|
|
|
|
#define dirent direct
|
2000-07-11 10:02:36 +08:00
|
|
|
|
2000-08-30 07:11:30 +08:00
|
|
|
/* POSIX utime() struct */
|
2000-07-11 10:02:36 +08:00
|
|
|
struct utimbuf {
|
|
|
|
time_t actime;
|
|
|
|
time_t modtime;
|
|
|
|
};
|
|
|
|
|
2000-06-18 13:43:25 +08:00
|
|
|
/* FILE */
|
|
|
|
#define O_NONBLOCK 00004 /* non-blocking open */
|
|
|
|
|
|
|
|
/* WAITPID */
|
|
|
|
#undef WIFEXITED
|
|
|
|
#undef WIFSTOPPED
|
|
|
|
#undef WIFSIGNALED
|
|
|
|
|
2000-08-30 07:11:30 +08:00
|
|
|
#define WIFEXITED(w) (!((w) & 0377))
|
|
|
|
#define WIFSTOPPED(w) ((w) & 0100)
|
2000-07-09 21:26:27 +08:00
|
|
|
#define WIFSIGNALED(w) (!WIFEXITED(w) && !WIFSTOPPED(w))
|
2000-08-30 07:11:30 +08:00
|
|
|
#define WEXITSTATUS(w) (int)(WIFEXITED(w) ? ((w >> 8) & 0377) : -1)
|
|
|
|
#define WTERMSIG(w) (int)(WIFSIGNALED(w) ? (w & 0177) : -1)
|
2000-07-09 21:26:27 +08:00
|
|
|
#define WCOREFLAG 0x80
|
2000-08-30 07:11:30 +08:00
|
|
|
#define WCOREDUMP(w) ((w) & WCOREFLAG)
|
|
|
|
|
|
|
|
/* POSIX "wrapper" functions to replace to BSD functions */
|
|
|
|
int posix_utime(char *filename, struct utimbuf *buf); /* new utime() */
|
|
|
|
#define utime posix_utime
|
|
|
|
|
|
|
|
pid_t posix_wait(int *status); /* new wait() */
|
|
|
|
#define wait posix_wait
|
2000-06-18 13:43:25 +08:00
|
|
|
|
2000-08-30 07:11:30 +08:00
|
|
|
/* MISC functions */
|
2000-06-18 13:43:25 +08:00
|
|
|
int waitpid(int pid,int *stat_loc,int options);
|
|
|
|
pid_t setsid(void);
|
|
|
|
|
|
|
|
/* TC */
|
|
|
|
int tcgetattr(int fd,struct termios *t);
|
|
|
|
int tcsetattr(int fd,int opt,const struct termios *t);
|
|
|
|
int tcsetpgrp(int fd, pid_t pgrp);
|
|
|
|
speed_t cfgetospeed(const struct termios *t);
|
|
|
|
speed_t cfgetispeed(const struct termios *t);
|
|
|
|
int cfsetospeed(struct termios *t,int speed);
|
2000-07-11 10:02:36 +08:00
|
|
|
|
|
|
|
|
2000-06-18 13:43:25 +08:00
|
|
|
#endif /* HAVE_NEXT */
|
|
|
|
#endif /* _NEXT_POSIX_H */
|