daemonizing. This is more portable and avoids zombie "rpc.statd"
processes after an NFS client running e.g. Mac OS X shuts down.
Reviewed by christos@.
space, or the database will be corrupted (noticed when the database is
updated in reset_host()). Change change_host() to copy hostname and HostInfo
to local storage before calling db->put().
Change notify_one() to use change_host() instead of calling db->put()
directly.
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames
Stopgap fix for PR 4225 by Matthias Scheler (rpc.statd doesn't run on m68k).
XXX This should be done in a different way. XXX
Matthias proposes to use a PMAP capable of mapping more than 256 MB
per user process (You can do this by changing your vm_param constants
even now).
However, statd could use saner data structure to save on address space
easily. E.g., most host names will be much smaller than the allocated
1024(+1 for trailing zero) bytes. Using variable length names would
allow, depending on environment, a factor of 30 more hosts per address
space.
Btw, if anybody really needs more than 16k hosts handled by statd, the
data structure is unsuable anyway; currently, the array of entries is
linearly searched. Something like a DB_BTREE should be used.