2ebffd9a71e650fe078e814ea117ea413173f553
2 * This file is part of DisOrder.
3 * Copyright (C) 2004, 2005 Richard Kettlewell
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
24 /* various error-handling wrappers. Not actually all system calls! */
30 #include <sys/socket.h>
40 int xfcntl(int, int, long);
41 void xlisten(int, int);
42 void xshutdown(int, int);
43 void xsetsockopt(int, int, int, const void *, socklen_t
);
44 int xsocket(int, int, int);
45 void xconnect(int, const struct sockaddr
*, socklen_t
);
46 void xsigprocmask(int how
, const sigset_t
*set
, sigset_t
*oldset
);
47 void xsigaction(int sig
, const struct sigaction
*sa
, struct sigaction
*oldsa
);
48 int xprintf(const char *, ...)
49 attribute((format (printf
, 1, 2)));
52 void xgettimeofday(struct timeval
*, struct timezone
*);
53 /* the above all call @fatal@ if the system call fails */
55 void nonblock(int fd
);
57 /* make @fd@ non-blocking/close-on-exec; call @fatal@ on error. */
59 int mustnotbeminus1(const char *what
, int value
);
60 /* If @value@ is -1, report an error including @what@. */
62 int xstrtol(long *n
, const char *s
, char **ep
, int base
);
63 int xstrtoll(long_long
*n
, const char *s
, char **ep
, int base
);
64 /* like strtol() but returns errno on error, 0 on success */
66 #endif /* SYSCALLS_H */
74 /* arch-tag:87545481469f8a85f73c5216c6788c0e */