chiark / gitweb /
Portability fixes.
[userv.git] / INSTALL
1 INSTALLATION INSTRUCTIONS:
2
3    $ ./configure
4    $ make
5    # make install
6
7 This will not install the documentation, which is shipped as
8 pre-prepared HTML and PostScript as well as debiandoc-sgml source.
9 Put that (spec.html/ and spec.ps) where you will.
10
11 SYSTEM REQUIREMENTS:
12
13 Programs:
14
15 * md5sum (Colin Plumb's or the GNU version)
16 * GNU m4
17 * GNU make
18 * GNU flex
19 * GCC is preferred but other compilers ought to work (though
20   no portability testing has yet been done).  ANSI C only.
21   ints must be at least 32 bits.
22 * A sensible /bin/cat which notices write errors (ie not
23   SunOS4, BSD 4.3, or many others.)
24
25 C Library:
26
27 * [v]snprintf - a real version, not just [v]sprintf with a wrapper
28   that throws the argument away.
29 * strsignal;
30 * fnmatch;
31 * BSD syslog(3);
32 * strtoul;
33 * memcpy, memset, memcpy;
34 * realloc(0,size) must work and be equivalent to malloc(size).
35 * free(0) must work and do nothing
36 * <stdarg.h> (not varargs) and v[sf][n]printf.
37
38 System interfaces:
39
40 * setreuid(2), getreuid(2), getgroups(2), initgroups(3), with
41   the ability for root to (a) swap euid and ruid and
42   (b) give away all privilege by calling setreuid(ruid,ruid)
43   twice.
44 * wait3 and waitpid, <wait.h> with WNOHANG, WIFSIGNALED,
45   WIFEXITEED, WTERMSIG, WEXITSTATUS and WCOREDUMP.
46 * gid_t, uid_t, pid_t.
47 * Unix-domain (AF_UNIX) stream sockets, for use with:
48   * BSD sockets - socket(), bind(), listen(), accept(), connect();
49   * socketpair(2);
50 * lstat(2) (though stat(2) will be safe on systems without symlinks,
51   if you say -Dlstat=stat).
52 * Pipes:
53   * creating using pipe(2) and mkfifo(2);
54   * proper interaction between open(O_RDWR), open(O_RDONLY),
55     open(O_WRONLY), close(), dup2, EPIPE, SIGPIPE, &c.
56     (ie, opening pipes with O_RDWR never blocks; EPIPE happens
57     if you write with no readers; EOF happens if you read with
58     no buffered data and writers)
59 * POSIX signal handling - sigaction(2), sigprocmask(2), sigsuspend(2);
60
61 To format the documentation:
62
63 * debiandoc-sgml, and hence sp (aka nsgmls) and sgmlspm.
64 * For PostScript output, Lout and possibly psutils.
65
66 For debugging version (./configure --enable-debug):
67
68 * initgroups(3) must use setgroups(2) and dynamic
69   linking must allow overriding setgroups(2) for initgroups(3);
70
71 REENTRANCY IN THE LIBC:
72
73 We assume, both in the client and server, that it is safe to use one
74 stdio stream in a signal handler which interrupts use of a _different_
75 stdio stream in another.  We make sure using setvbuf that we have
76 pre-allocated buffers so that stdio doesn't need to use malloc() when
77 we actually read or write.  stdio had better not do anything else
78 weird.
79
80 Furthermore, we assume that it is safe to use syslog in a signal
81 handler which has interrupted a stdio operation (but we don't require
82 that it be safe to invoke when the signal has interrupted a call to
83 malloc, unless stdio makes gratuitous mallocs).  openlog will already
84 have been called (but syslog will not necessarily have been called).
85
86 We assume that strerror is completely reentrant.
87
88 PROBLEMS
89
90 * `function declaration isn't a prototype'
91
92   One some systems (at least some versions of NetBSD, for example),
93   the SIG_IGN and SIG_DFL macros contain function declarations (as part
94   of a typecast, presumably) which are not prototypes.  The warning
95   options that are used by default if the configure script detects that
96   you're using a good GCC then cause the compilation to fail.  You must
97   use
98     make CFLAGS=-O2
99   instead of just `make', thus suppressing warnings.
100
101   The bug is actually in your system header files, for not specifying
102   the number and types of arguments to signal handler functions when
103   they cast in the SIG_IGN and SIG_DFL macros.