23
23
* Contact the authors at <mandos@recompile.se>.
26
#define _GNU_SOURCE /* TEMP_FAILURE_RETRY() */
27
#include <sys/types.h> /* uid_t, gid_t, ssize_t */
28
#include <sys/stat.h> /* mkfifo(), S_IRUSR, S_IWUSR */
29
#include <iso646.h> /* and */
30
#include <errno.h> /* errno, EACCES, ENOTDIR, ELOOP,
26
#define _GNU_SOURCE /* vasprintf(),
27
program_invocation_short_name */
28
#include <sys/types.h> /* uid_t, gid_t, getuid(), getgid(),
30
#include <unistd.h> /* uid_t, gid_t, ssize_t, getuid(),
31
getgid(), setgid(), setuid(),
32
read(), close(), write(),
34
#include <stdarg.h> /* va_list, va_start(), vfprintf() */
35
#include <stdio.h> /* vasprintf(), fprintf(), stderr,
37
#include <errno.h> /* program_invocation_short_name,
38
errno, EACCES, ENOTDIR, ELOOP,
31
39
ENAMETOOLONG, ENOSPC, EROFS,
32
40
ENOENT, EEXIST, EFAULT, EMFILE,
33
41
ENFILE, ENOMEM, EBADF, EINVAL, EIO,
43
#include <string.h> /* strerror() */
35
44
#include <error.h> /* error() */
36
#include <stdio.h> /* fprintf(), vfprintf(),
38
#include <stdlib.h> /* EXIT_FAILURE, NULL, size_t, free(),
39
realloc(), EXIT_SUCCESS */
45
#include <stdlib.h> /* free(), realloc(), EXIT_SUCCESS */
46
#include <sys/stat.h> /* mkfifo(), S_IRUSR, S_IWUSR */
47
#include <sysexits.h> /* EX_OSFILE, EX_OSERR,
48
EX_UNAVAILABLE, EX_IOERR */
40
49
#include <fcntl.h> /* open(), O_RDONLY */
41
#include <unistd.h> /* read(), close(), write(),
43
#include <sysexits.h> /* EX_OSERR, EX_OSFILE,
44
EX_UNAVAILABLE, EX_IOERR */
45
#include <string.h> /* strerror() */
46
#include <stdarg.h> /* va_list, va_start(), ... */
50
#include <stddef.h> /* NULL, size_t */