summaryrefslogtreecommitdiff
path: root/next-posix.h
diff options
context:
space:
mode:
Diffstat (limited to 'next-posix.h')
-rw-r--r--next-posix.h45
1 files changed, 26 insertions, 19 deletions
diff --git a/next-posix.h b/next-posix.h
index fc06e41bc..3ac4739d0 100644
--- a/next-posix.h
+++ b/next-posix.h
@@ -1,5 +1,24 @@
1/* 1/*
2 * Defines and prototypes specific to NeXT system 2 * Redistribution and use in source and binary forms, with or without
3 * modification, are permitted provided that the following conditions
4 * are met:
5 * 1. Redistributions of source code must retain the above copyright
6 * notice, this list of conditions and the following disclaimer.
7 * 2. Redistributions in binary form must reproduce the above copyright
8 * notice, this list of conditions and the following disclaimer in the
9 * documentation and/or other materials provided with the distribution.
10 *
11 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
12 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
13 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
14 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
15 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
16 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
17 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
18 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
20 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 *
3 */ 22 */
4 23
5#ifndef _NEXT_POSIX_H 24#ifndef _NEXT_POSIX_H
@@ -9,15 +28,9 @@
9 28
10#include <sys/dir.h> 29#include <sys/dir.h>
11 30
12/* readdir() returns struct direct (BSD) not struct dirent (POSIX) */ 31/* NeXT's Readdir() is BSD (struct direct) not POSIX (struct dirent) */
13#define dirent direct 32#define dirent direct
14 33
15/* POSIX utime() struct */
16struct utimbuf {
17 time_t actime;
18 time_t modtime;
19};
20
21/* FILE */ 34/* FILE */
22#define O_NONBLOCK 00004 /* non-blocking open */ 35#define O_NONBLOCK 00004 /* non-blocking open */
23 36
@@ -31,19 +44,14 @@ struct utimbuf {
31#define WIFSIGNALED(w) (!WIFEXITED(w) && !WIFSTOPPED(w)) 44#define WIFSIGNALED(w) (!WIFEXITED(w) && !WIFSTOPPED(w))
32#define WEXITSTATUS(w) (int)(WIFEXITED(w) ? (((w) >> 8) & 0377) : -1) 45#define WEXITSTATUS(w) (int)(WIFEXITED(w) ? (((w) >> 8) & 0377) : -1)
33#define WTERMSIG(w) (int)(WIFSIGNALED(w) ? ((w) & 0177) : -1) 46#define WTERMSIG(w) (int)(WIFSIGNALED(w) ? ((w) & 0177) : -1)
34#define WCOREFLAG 0x80
35#define WCOREDUMP(w) ((w) & WCOREFLAG)
36
37/* POSIX "wrapper" functions to replace to BSD functions */
38int posix_utime(char *filename, struct utimbuf *buf); /* new utime() */
39#define utime posix_utime
40 47
41pid_t posix_wait(int *status); /* new wait() */ 48/* Swap out the next 'BSDish' wait() for a more POSIX complient one */
42#define wait posix_wait 49pid_t posix_wait(int *status);
50#define wait(a) posix_wait(a)
43 51
44/* MISC functions */ 52/* MISC functions */
45int waitpid(int pid, int *stat_loc, int options); 53#define setsid() setpgrp(0, getpid())
46pid_t setsid(void); 54pid_t waitpid(int pid, int *stat_loc, int options);
47 55
48/* TERMCAP */ 56/* TERMCAP */
49int tcgetattr(int fd, struct termios *t); 57int tcgetattr(int fd, struct termios *t);
@@ -54,5 +62,4 @@ speed_t cfgetispeed(const struct termios *t);
54int cfsetospeed(struct termios *t, int speed); 62int cfsetospeed(struct termios *t, int speed);
55 63
56#endif /* HAVE_NEXT */ 64#endif /* HAVE_NEXT */
57
58#endif /* _NEXT_POSIX_H */ 65#endif /* _NEXT_POSIX_H */