1 #ifndef _G_unistd_h
2 #define _G_unistd_h 1
3 
4 #include <_G_config.h>
5 
6 extern "C" {
7 
8 #if _G_HAVE_UNISTD
9 #ifndef _G_USE_PROTOS
10 #define chmod __hide_chmod
11 #define chown __hide_chown
12 #define execl __hide_execl
13 #define execlp __hide_execlp
14 #define execle __hide_execle
15 #define fchown __hide_fchown
16 #define ioctl __hide_ioctl
17 #define setgid __hide_setgid
18 #define setuid __hide_setuid
19 #endif
20 #ifdef _AIX
21 // AIX's unistd.h defines int rename (const char *old, const char *new).
22 // This is not legal ANSI.  It causes a C++ syntax error (because of 'new').
23 #define new __new
24 #endif
25 #include_next <unistd.h>
26 #ifdef _AIX
27 #undef new
28 #endif
29 #ifndef _G_USE_PROTOS
30 #undef chmod
31 #undef chown
32 #undef execl
33 #undef execle
34 #undef execlp
35 #undef fchown
36 #undef ioctl
37 #undef setgid
38 #undef setuid
39 #endif
40 #else
41 #ifndef SEEK_SET
42 #define SEEK_SET        0
43 #define SEEK_CUR        1
44 #define SEEK_END        2
45 #endif
46 
47 #ifndef F_OK
48 #define F_OK            0
49 #endif
50 #ifndef X_OK
51 #define X_OK            1
52 #endif
53 #ifndef W_OK
54 #define W_OK            2
55 #endif
56 #ifndef R_K
57 #define R_OK            4
58 #endif
59 #endif
60 
61 #ifdef __GNUG__
62 extern void volatile _exit(int);
63 #else
64 void _exit(int);
65 #endif
66 
67 extern unsigned alarm _G_ARGS((unsigned));
68 extern int      brk _G_ARGS((void*));
69 extern int      chdir _G_ARGS((const char*));
70 extern int      chmod  _G_ARGS((const char*, _G_mode_t));
71 extern int      chown (const char*, _G_uid_t, _G_gid_t);
72 extern int      close _G_ARGS((int));
73 extern char*    crypt _G_ARGS((const char*, const char*));
74 extern int      dup _G_ARGS((int));
75 extern int      dup2 _G_ARGS((int, int));
76 extern void	encrypt _G_ARGS((char*, int));
77 extern int      execl (const char*, const char *, ...);
78 extern int      execle (const char*, const char *, ...);
79 extern int      execlp (const char*, const char*, ...);
80 extern int      exect _G_ARGS((const char*,  const char**,  char**));
81 extern int      execv _G_ARGS((const char*,  const char * const *));
82 extern int      execve _G_ARGS((const char*, const char * const *, const char * const *));
83 extern int      execvp _G_ARGS((const char*,  const char * const *));
84 extern int      fchown (int, _G_uid_t, _G_gid_t);
85 extern _G_pid_t fork _G_ARGS((void));
86 extern int      fsync _G_ARGS((int));
87 extern int      ftruncate _G_ARGS((int, _G_off_t));
88 extern char*    getcwd _G_ARGS((char*, _G_size_t));
89 extern int      getdomainname _G_ARGS((char*, int));
90 extern int      getdtablesize _G_ARGS((void));
91 extern int      getgroups _G_ARGS((int, _G_gid_t*));
92 extern _G_uid_t geteuid _G_ARGS((void));
93 extern _G_gid_t getegid _G_ARGS((void));
94 extern _G_gid_t getgid _G_ARGS((void));
95 extern long     gethostid _G_ARGS((void));
96 extern int      gethostname _G_ARGS((char*, int));
97 extern _G_pid_t getpgrp _G_ARGS((...));
98 extern _G_pid_t getpid _G_ARGS((void));
99 extern _G_pid_t getppid _G_ARGS((void));
100 extern char*    getlogin _G_ARGS((void));
101 extern char*    getpass _G_ARGS((const char*));
102 extern _G_uid_t getuid _G_ARGS((void));
103 extern int      ioctl (int, int, ... );
104 extern int      isatty _G_ARGS((int));
105 extern int      link _G_ARGS((const char*, const char*));
106 extern int      mkstemp _G_ARGS((char*));
107 extern char*    mktemp _G_ARGS((char*));
108 extern int      nice _G_ARGS((int));
109 extern int      pause _G_ARGS((void));
110 extern int      pipe _G_ARGS((int*));
111 extern int      readlink _G_ARGS((const char*, char*, int));
112 extern int      rename _G_ARGS((const char*, const char*));
113 extern int      rmdir _G_ARGS((const char*));
114 #ifdef __OSF1__
115 extern char*	sbrk _G_ARGS((int));
116 #else
117 extern void*    sbrk _G_ARGS((int));
118 #endif
119 extern int      syscall _G_ARGS((int, ...));
120 extern int      setgid (_G_gid_t);
121 extern int      sethostname _G_ARGS((const char*, int));
122 #ifdef _G_SYSV
123 extern _G_pid_t setpgrp _G_ARGS((void));
124 extern _G_pid_t setsid _G_ARGS((void));
125 #else
126 extern _G_pid_t setpgrp _G_ARGS((_G_pid_t, _G_pid_t));
127 #endif
128 extern int      setregid _G_ARGS((int, int));
129 extern int      setreuid _G_ARGS((int, int));
130 extern int      setuid (_G_uid_t);
131 extern unsigned sleep _G_ARGS((unsigned));
132 extern void     swab _G_ARGS((void*, void*, int));
133 extern int      symlink _G_ARGS((const char*, const char*));
134 extern long     sysconf _G_ARGS((int));
135 extern int      truncate _G_ARGS((const char*, _G_off_t));
136 extern char*    ttyname _G_ARGS((int));
137 extern int      ttyslot _G_ARGS((void));
138 //extern int   umask _G_ARGS((int)); /* commented out for now; wrong for SunOs4.1 */
139 extern int      unlink _G_ARGS((const char*));
140 extern _G_pid_t vfork _G_ARGS((void));
141 extern int      vadvise _G_ARGS((int));
142 extern int      vhangup _G_ARGS((void));
143 extern _G_off_t lseek _G_ARGS((int, long, int));
144 extern _G_ssize_t read _G_ARGS((int, void*, _G_size_t));
145 extern _G_ssize_t write _G_ARGS((int, const void*, _G_size_t));
146 extern int      access _G_ARGS((const char*, int));
147 #ifndef hpux
148 extern int      flock _G_ARGS((int, int));
149 #endif
150 
151 }
152 
153 #endif
154