use the -newos toolchain even if -elf is present.
[newos.git] / include / unistd.h
blobcedcba40665046a30621bd99eae9982ed500215c
1 /*
2 ** Copyright 2001-2004 Travis Geiselbrecht. All rights reserved.
3 ** Copyright 2002, Manuel J. Petit. All rights reserved.
4 ** Distributed under the terms of the NewOS License.
5 */
7 #ifndef __newos__libc_unistd__hh__
8 #define __newos__libc_unistd__hh__
10 #include <sys/types.h>
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
16 /* whence values for lseek() */
17 #define SEEK_SET 0
18 #define SEEK_CUR 1
19 #define SEEK_END 2
21 void _exit(int);
23 int open(char const *, int, ...);
24 int close(int);
25 int dup(int);
26 int dup2(int, int);
27 int unlink(const char *);
28 int fsync(int);
29 void sync(void);
31 off_t lseek(int, off_t, int);
32 ssize_t read(int, void *, size_t);
33 ssize_t pread(int, void *, size_t, off_t);
34 ssize_t write(int, void const*, size_t);
35 ssize_t pwrite(int, void const*, size_t, off_t);
37 unsigned sleep(unsigned);
38 int usleep(unsigned);
40 int chdir(char *);
41 char *getcwd(char *, size_t);
42 char *getwd(char *);
44 int pipe(int fds[2]);
46 /* not strictly supposed to be here, and doesn't quite match unix ioctl() */
47 int ioctl(int, int, void *, size_t);
49 /* process groups */
50 int setpgid(pid_t pid, pid_t pgid);
51 pid_t getpgid(pid_t pid);
52 int setpgrp(void);
53 pid_t getpgrp(void);
55 /* sessions */
56 pid_t getsid(pid_t pid);
57 pid_t setsid(void);
59 #ifdef __cplusplus
60 } /* extern "C" */
61 #endif
64 #endif