2 /* Copyright Gerhard Rieger */
3 /* Published under the GNU General Public License V.2, see file COPYING */
5 #ifndef __sycls_h_included
6 #define __sycls_h_included 1
9 struct termios
; /* prevent gcc from spitting silly warning */
14 mode_t
Umask(mode_t mask
);
15 int Open(const char *pathname
, int flags
, mode_t mode
);
16 int Creat(const char *pathname
, mode_t mode
);
17 off_t
Lseek(int fildes
, off_t offset
, int whence
);
19 off64_t
Lseek64(int fildes
, off64_t offset
, int whence
);
24 int Getpgid(pid_t pid
);
25 int Setpgid(pid_t pid
, pid_t pgid
);
27 pid_t
Tcgetpgrp(int fd
);
28 int Tcsetpgrp(int fd
, pid_t pgrpid
);
29 pid_t
Getsid(pid_t pid
);
33 int Setuid(uid_t uid
);
36 int Setgid(gid_t gid
);
37 int Initgroups(const char *user
, gid_t group
);
38 int Getgroups(int size
, gid_t list
[]);
39 int Setgroups(size_t size
, const gid_t
*list
);
40 int Getgrouplist(const char *user
, gid_t group
, gid_t
*groups
, int *ngroups
);
41 int Chdir(const char *path
);
42 int Chroot(const char *path
);
43 int Gettimeofday(struct timeval
*tv
, struct timezone
*tz
);
44 int Mknod(const char *pathname
, mode_t mode
, dev_t dev
);
45 int Mkfifo(const char *pathname
, mode_t mode
);
46 int Stat(const char *file_name
, struct stat
*buf
);
47 int Fstat(int filedes
, struct stat
*buf
);
48 int Lstat(const char *file_name
, struct stat
*buf
);
50 int Stat64(const char *file_name
, struct stat64
*buf
);
51 int Fstat64(int filedes
, struct stat64
*buf
);
52 int Lstat64(const char *file_name
, struct stat64
*buf
);
53 #endif /* HAVE_STAT64 */
55 int Dup2(int oldfd
, int newfd
);
56 int Pipe(int filedes
[2]);
57 ssize_t
Read(int fd
, void *buf
, size_t count
);
58 ssize_t
Write(int fd
, const void *buf
, size_t count
);
59 int Fcntl(int fd
, int cmd
);
60 int Fcntl_l(int fd
, int cmd
, long arg
);
61 int Fcntl_lock(int fd
, int cmd
, struct flock
*l
);
62 int Ftruncate(int fd
, off_t length
);
64 int Ftruncate64(int fd
, off64_t length
);
65 #endif /* HAVE_FTRUNCATE64 */
66 int Flock(int fd
, int operation
);
67 int Ioctl(int d
, int request
, void *argp
);
68 int Ioctl_int(int d
, int request
, int arg
);
70 int Fchown(int fd
, uid_t owner
, gid_t group
);
71 int Fchmod(int fd
, mode_t mode
);
72 int Unlink(const char *pathname
);
73 int Symlink(const char *oldpath
, const char *newpath
);
74 int Readlink(const char *path
, char *buf
, size_t bufsiz
);
75 int Chown(const char *path
, uid_t owner
, gid_t group
);
76 int Chmod(const char *path
, mode_t mode
);
77 int Poll(struct pollfd
*ufds
, unsigned int nfds
, int timeout
);
78 int Select(int n
, fd_set
*readfds
, fd_set
*writefds
, fd_set
*exceptfds
,
79 struct timeval
*timeout
);
81 pid_t
Waitpid(pid_t pid
, int *status
, int options
);
82 #ifndef HAVE_TYPE_SIGHANDLER
83 typedef RETSIGTYPE (*sighandler_t
)(int);
85 sighandler_t
Signal(int signum
, sighandler_t handler
);
86 int Sigaction(int signum
, const struct sigaction
*act
,
87 struct sigaction
*oldact
);
88 int Sigprocmask(int how
, const sigset_t
*set
, sigset_t
*oset
);
89 unsigned int Alarm(unsigned int seconds
);
90 int Kill(pid_t pid
, int sig
);
91 int Link(const char *oldpath
, const char *newpath
);
92 int Execvp(const char *file
, char *const argv
[]);
93 int System(const char *string
);
94 int Socketpair(int d
, int type
, int protocol
, int sv
[2]);
96 int Socket(int domain
, int type
, int protocol
);
97 int Bind(int sockfd
, struct sockaddr
*my_addr
, socklen_t addrlen
);
98 int Connect(int sockfd
, const struct sockaddr
*serv_addr
, socklen_t addrlen
);
99 int Listen(int s
, int backlog
);
100 int Accept(int s
, struct sockaddr
*addr
, socklen_t
*addrlen
);
101 int Getsockname(int s
, struct sockaddr
*name
, socklen_t
*namelen
);
102 int Getpeername(int s
, struct sockaddr
*name
, socklen_t
*namelen
);
103 int Getsockopt(int s
, int level
, int optname
, void *optval
, socklen_t
*optlen
);
104 int Setsockopt(int s
, int level
, int optname
, const void *optval
, int optlen
);
105 int Recv(int s
, void *buf
, size_t len
, int flags
);
106 int Recvfrom(int s
, void *buf
, size_t len
, int flags
, struct sockaddr
*from
,
108 int Recvmsg(int s
, struct msghdr
*msg
, int flags
);
109 int Send(int s
, const void *mesg
, size_t len
, int flags
);
110 int Sendto(int s
, const void *msg
, size_t len
, int flags
,
111 const struct sockaddr
*to
, socklen_t tolen
);
112 int Shutdown(int fd
, int how
);
113 #endif /* _WITH_SOCKET */
114 unsigned int Sleep(unsigned int seconds
);
115 void Usleep(unsigned long usec
);
116 unsigned int Nanosleep(const struct timespec
*req
, struct timespec
*rem
);
118 struct hostent
*Gethostbyname(const char *name
);
119 int Getaddrinfo(const char *node
, const char *service
,
120 const struct addrinfo
*hints
, struct addrinfo
**res
);
121 struct hostent
*Getipnodebyname(const char *name
, int af
, int flags
,
123 void *Malloc(size_t size
);
124 void *Calloc(size_t nmemb
, size_t size
);
125 void *Realloc(void *ptr
, size_t size
);
126 int Tcgetattr(int fd
, struct termios
*termios_p
);
127 int Tcsetattr(int fd
, int optional_actions
, struct termios
*termios_p
);
128 char *Ttyname(int fd
);
130 struct winsize
; /* avoid warnings */
131 int Openpty(int *ptyfd
, int *ttyfd
, char *ptyname
, struct termios
*termp
,
132 struct winsize
*winp
);
133 char *Ptsname(int fd
);
135 int Unlockpt(int fd
);
136 int Gethostname(char *name
, size_t len
);
137 int Uname(struct utsname
*buf
);
138 int Atexit(void (*func
)(void));
139 void Exit(int status
);
141 int Mkstemp(char *template);
142 int Setenv(const char *name
, const char *value
, int overwrite
);
143 void Unsetenv(const char *name
);
145 char *Readline(const char *prompt
);
146 void Using_history(void);
147 int Read_history(const char *filename
);
148 int Write_history(const char *filename
);
149 int Append_history(int nelements
, const char *filename
);
150 int Read_history(const char *filename
);
151 void Add_history(const char *string
);
153 #else /* !WITH_SYCLS */
155 #define Umask(m) umask(m)
156 #define Open(p,f,m) open(p,f,m)
157 #define Creat(p,m) creat(p,m)
158 #define Lseek(f,o,w) lseek(f,o,w)
159 #define Lseek64(f,o,w) lseek64(f,o,w)
160 #define Getpid() getpid()
161 #define Getppid() getppid()
162 #define Getpgrp() getpgrp()
163 #define Getpgid(p) getpgid(p)
164 #define Setpgid(p,g) setpgid(p,g)
165 #define Setpgrp() setpgrp()
166 #define Tcgetpgrp(f) tcgetpgrp(f)
167 #define Tcsetpgrp(f,p) tcsetpgrp(f,p)
168 #define Getsid(p) getsid(p)
169 #define Setsid() setsid()
170 #define Getuid() getuid()
171 #define Geteuid() geteuid()
172 #define Setuid(u) setuid(u)
173 #define Getgid() getgid()
174 #define Getegid() getegid()
175 #define Setgid(g) setgid(g)
176 #define Initgroups(u,g) initgroups(u,g)
177 #define Getgroups(s,l) getgroups(s,l)
178 #define Setgroups(s,l) setgroups(s,l)
179 #define Getgrouplist(u,g,gs,n) getgrouplist(u,g,gs,n)
180 #define Chdir(p) chdir(p)
181 #define Chroot(p) chroot(p)
182 #define Gettimeofday(tv,tz) gettimeofday(tv,tz)
183 #define Mknod(p,m,d) mknod(p,m,d)
184 #define Mkfifo(p,m) mkfifo(p,m)
185 #define Stat(f,b) stat(f,b)
186 #define Stat64(f,b) stat64(f,b)
187 #define Fstat(f,b) fstat(f,b)
188 #define Fstat64(f,b) fstat64(f,b)
189 #define Lstat(f,b) lstat(f,b)
190 #define Lstat64(f,b) lstat64(f,b)
191 #define Dup(o) dup(o)
192 #define Dup2(o,n) dup2(o,n)
193 #define Pipe(f) pipe(f)
194 #define Read(f,b,c) read(f,b,c)
195 #define Write(f,b,c) write(f,b,c)
196 #define Fcntl(f,c) fcntl(f,c)
197 #define Fcntl_l(f,c,a) fcntl(f,c,a)
198 #define Fcntl_lock(f,c,l) fcntl(f,c,l)
199 #define Ftruncate(f,l) ftruncate(f,l)
200 #define Ftruncate64(f,l) ftruncate64(f,l)
201 #define Flock(f,o) flock(f,o)
202 #define Ioctl(d,r,a) ioctl(d,r,a)
203 #define Ioctl_int(d,r,a) ioctl(d,r,a)
204 #define Close(f) close(f)
205 #define Fchown(f,o,g) fchown(f,o,g)
206 #define Fchmod(f,m) fchmod(f,m)
207 #define Unlink(p) unlink(p)
208 #define Symlink(op,np) symlink(op,np)
209 #define Readlink(p,b,s) readlink(p,b,s)
210 #define Chown(p,o,g) chown(p,o,g)
211 #define Chmod(p,m) chmod(p,m)
212 #define Poll(u, n, t) poll(u, n, t)
213 #define Select(n,r,w,e,t) select(n,r,w,e,t)
214 #define Fork() fork()
215 #define Waitpid(p,s,o) waitpid(p,s,o)
216 #define Signal(s,h) signal(s,h)
217 #define Sigaction(s,a,o) sigaction(s,a,o)
218 #define Sigprocmask(h,s,o) sigprocmask(h,s,o)
219 #define Alarm(s) alarm(s)
220 #define Kill(p,s) kill(p,s)
221 #define Link(o,n) link(o,n)
222 #define Execvp(f,a) execvp(f,a)
223 #define System(s) system(s)
224 #define Socketpair(d,t,p,s) socketpair(d,t,p,s)
225 #define Socket(d,t,p) socket(d,t,p)
226 #define Bind(s,m,a) bind(s,m,a)
227 #define Connect(s,a,l) connect(s,a,l)
228 #define Listen(s,b) listen(s,b)
229 #define Accept(s,a,l) accept(s,a,l)
230 #define Getsockname(s,n,l) getsockname(s,n,l)
231 #define Getpeername(s,n,l) getpeername(s,n,l)
232 #define Getsockopt(s,d,n,v,l) getsockopt(s,d,n,v,l)
233 #define Setsockopt(s,d,n,v,l) setsockopt(s,d,n,v,l)
234 #define Recv(s,b,l,f) recv(s,b,l,f)
235 #define Recvfrom(s,b,bl,f,fr,fl) recvfrom(s,b,bl,f,fr,fl)
236 #define Recvmsg(s,m,f) recvmsg(s,m,f)
237 #define Send(s,m,l,f) send(s,m,l,f)
238 #define Sendto(s,b,bl,f,t,tl) sendto(s,b,bl,f,t,tl)
239 #define Shutdown(f,h) shutdown(f,h)
240 #define Sleep(s) sleep(s)
241 #define Usleep(u) usleep(u)
242 #define Nanosleep(req,rem) nanosleep(req,rem)
243 #define Pause() pause()
244 #define Gethostbyname(n) gethostbyname(n)
245 #define Getaddrinfo(n,s,h,r) getaddrinfo(n,s,h,r)
246 #define Getipnodebyname(n,a,f,e) getipnodebyname(n,a,f,e)
247 #define Malloc(s) malloc(s)
248 #define Calloc(n,s) calloc(n,s)
249 #define Realloc(p,s) realloc(p,s)
250 #define Tcgetattr(f,t) tcgetattr(f,t)
251 #define Tcsetattr(f,o,t) tcsetattr(f,o,t)
252 #define Ttyname(f) ttyname(f)
253 #define Isatty(f) isatty(f)
254 #define Openpty(p,t,n,i,f) openpty(p,t,n,i,f)
255 #define Ptsname(f) ptsname(f)
256 #define Grantpt(f) grantpt(f)
257 #define Unlockpt(f) unlockpt(f)
258 #define Getpgid(p) getpgid(p)
259 #define Gethostname(n,l) gethostname(n,l)
260 #define Uname(b) uname(b)
261 #define Atexit(f) atexit(f)
262 #define Exit(s) exit(s)
263 #define Abort() abort()
264 #define Mkstemp(t) mkstemp(t)
265 #define Setenv(n,v,o) setenv(n,v,o)
266 #define Unsetenv(n) unsetenv(n)
268 #define Readline(p) readline(p)
269 #define Using_history() using_history()
270 #define Read_history(f) read_history(f)
271 #define Write_history(f) write_history(f)
272 #define Append_history(n,f) append_history(n,f)
273 #define Read_history(f) read_history(f)
274 #define Add_history(s) add_history(s)
276 #endif /* !WITH_SYCLS */
278 #endif /* !defined(__sycls_h_included) */