README
~~~~~~
libslack - A UNIX/C library of general utilities for programmers with Slack

    Slack(n.): The state in which you need nothing,
               because you already have it.
                     -- Dobbs, 1956

DESCRIPTION
~~~~~~~~~~~
Libslack is a library of general utilities designed to make UNIX/C programming
a bit easier on the eye. It is a seemingly random collection of modules and
functions that I find commonly useful.

It's a small library with lots of functionality, accurately documented and
thoroughly tested. Good library naming conventions are not rigorously observed
on the principle that common operations should always be easy to write and code
should always be easy to read.

Libslack contains the following modules:

    agent    - agent oriented programming
    coproc   - coprocess using pipes or pseudo terminals
    daemon   - becoming a daemon
    err      - message/error/debug/verbosity/alert messaging
    fio      - fifo and file control and some I/O
    getopt   - GNU getopt_long() for systems that don't have it
    hsort    - generic heap sort
    lim      - POSIX.1 limits convenience functions
    link     - abstract linked lists with optional growable free lists
    list     - list (growable pointer array) data type
    locker   - abstract locking and reader/writer lock implementation
    map      - map (hash table) data type
    mem      - memory helper functions, secure memory, memory pools
    msg      - message handling and syslog helper functions
    net      - network functions (clients/servers, expect/send, pack/unpack, mail)
    prog     - program framework and flexible command line option handling
    prop     - program properties files
    pseudo   - pseudo terminals
    sig      - ISO C compliant signal handling
    snprintf - safe sprintf for systems that don't have it
    str      - string data type (tr, regex, regsub, fmt, trim, lc, uc, ...)
    vsscanf  - sscanf() with va_list argument for systems that don't have it

INSTALL
~~~~~~~
This version is only known to work on the following systems:

    Linux 2.6 (i386, x86_64, debian-5.0.4, ubuntu-10.04, fedora-13)
    Solaris 10 10/09 (i386, amd64)
    OpenSolaris 2009/06 (i386, amd64)
    OpenBSD 4.7 (i386, amd64)
    FreeBSD 8.0 (i386, amd64)
    NetBSD 5.0.2 (i386, amd64)
    MacOSX 10.{4,5,6} (i386, x86_64, ppc)
    kFreeBSD 20090729 (i386)

For these systems, just run the "config" script in the source directory. It
will run the appropriate script in the "conf" directory for the current host.

Note: There isn't a real configure script so you will no doubt encounter
problems on other systems. An ISO C and POSIX/XPG4 environment will help
greatly. If your system doesn't have snprintf(3), GNU getopt_long(3),
vsscanf(3), strcasecmp(3), strncasecmp(3), strlcpy(3) or strlcat(3),
uncomment the relevant lines in the libslack/config.h file to include them
in libslack.

If your system doesn't have POSIX 1003.2 compliant regex functions, or they
are buggy, either: install the GNU implementation,
ftp://ftp.gnu.org/gnu/regex/regex-0.12.tar.gz [290K]
(doesn't support internationalisation);
or install Henry Spencer's implementation,
ftp://ftp.zoo.toronto.edu/pub/regex.shar [157K].

If you really, really, really don't want the regular expression functions,
uncomment HAVE_REGEX_H in libslack/config.h to enable the rest of the str
module to be compiled.

If you have a linux-2.2.x system, you must have LinuxThreads-0.8 or
LinuxThreads-0.9 and the latest corresponding version of glibc.
If you have a linux-2.4.x system, you must have at least glibc-2.2.1
and glibc-linuxthreads-2.2.1. They are available from
http://ftp.gnu.org/pub/gnu/glibc/. Older versions can be used but
they have some very nasty bugs.

First, uninstall any previous version:

    libslack-config --uninstall

or:

    cd /usr/local/src/libslack-0.5.2
    make uninstall

To build and test:

    tar xzf libslack-0.6.tar.gz
    cd libslack-0.6
    ./config          # iff linux, solaris, openbsd, freebsd, netbsd or macosx
    make              # must be gnu make
    make test

To install libslack and its manpages (into /usr/local by default):

    make install

To install into somewhere other than /usr/local:

    make PREFIX=/opt/libslack install

To uninstall:

    make uninstall

For more details:

    make help

There is one manpage for each module in libslack (as well as a symlink for
each function). The module manpages are agent(3), coproc(3), daemon(3),
err(3), fio(3), hsort(3), lim(3), link(3), list(3), locker(3), map(3),
mem(3), msg(3), net(3), prog(3), prop(3), pseudo(3), sig(3) and str(3). If
necessary, the manpages getopt(3), snprintf(3) and vsscanf(3) are created as
well.

BINARY PACKAGES
~~~~~~~~~~~~~~~
Some binary packages are available on libslack's website:

To install from the Fedora RPM binary package (into /usr by default):

    rpm -i libslack-0.6-1.x86_64.rpm # or
    rpm -i libslack-0.6-1.i686.rpm

To install from the OpenBSD binary package (into /usr/local by default):

	mv libslack-0.6-openbsd-amd64.tgz libslack-0.6.tgz # or
	mv libslack-0.6-openbsd-i386.tgz  libslack-0.6.tgz
    # then
    pkg_add libslack-0.6.tgz

To install from the FreeBSD binary package (into /usr/local by default):

    pkg_add libslack-0.6-freebsd-amd64.tbz # or
    pkg_add libslack-0.6-freebsd-i386.tbz

To install from the NetBSD binary package (into /usr/local by default):

    pkg_add libslack-0.6-netbsd-amd64.tgz # or
    pkg_add libslack-0.6-netbsd-i386.tgz

To install from the Mac OS X binary package (into /usr/local by default):

    cd /usr/local
    tar xzf /usr/local/src/libslack-0.6-macosx-universal.tar.gz # or
    tar xzf /usr/local/src/libslack-0.6-macosx-x86_64.tar.gz # or
    tar xzf /usr/local/src/libslack-0.6-macosx-i386.tar.gz # or
    tar xzf /usr/local/src/libslack-0.6-macosx-powerpc.tar.gz

To install from the Solaris10 binary package (into /usr/local by default):

    gunzip libslack-0.6-solaris-amd64.pkg.gz
    pkgadd -d libslack-0.6-solaris-amd64.pkg

or

    gunzip libslack-0.6-solaris-i386.pkg.gz
    pkgadd -d libslack-0.6-solaris-i386.pkg

REQUIREMENTS
~~~~~~~~~~~~
Requires GNU make to compile.
Requires perl to run the scripts in the conf directory.
Requires perl to install per-function manpage links.
Requires an ISO C compiler like gcc to compile the source.
Requires pod2man (comes with perl) to make the manpages.
Requires pod2html (comes with perl) to make the html manpages.
Requires POSIX 1003.2 compliant regex functions. See INSTALL.
Requires libpthread. See INSTALL.

PLATFORM NOTES
~~~~~~~~~~~~~~
These platform notes are quite old and probably mostly irrelevant.

Redhat9
~~~~~~~
Redhat 9 has some very disturbing bugs that affect libslack client
applications. If a program that links against libpthread calls fork(), and
the child process calls abort(), the parent process will also be killed. In
other words, Redhat9 behaves as though the two processes are merely two
threads in the same program. This was noticed when executing the tests for
the daemon and err modules. Calling the dump() function in a child process
killed the test program as well.

The other disturbing bug turned up in the tests for the net module. When
executing the net_expect() and net_send() functions, with the test program
being the server and a child process being the client, data written by the
server/parent process to the socket descriptor connected to the client/child
process never made it to the client. It appears as terminal output instead
and the client times out waiting for it. All other tests involving the
client/server functions worked as expected. It makes no sense.

I don't think that there is anything I can do to work around these bugs.
Please correct me if I am wrong.

Note: I have found one Redhat9 system where everything worked properly but
two others where they did not. You might get lucky.

Linux
~~~~~
Linux 2.2 always returns 0.0.0.0 on getsockopt(IP_MULTICAST_IF) so
net_multicast_get_interface() always returns 0 under Linux 2.2. Linux 2.4
does not have this bug.

Make sure you have a recent glibc (at least 2.1.3) and libpthread (at least
0.8) (See INSTALL).

Linux 2.2 and 2.4 have a bug-like feature in poll(2). It always times out
10ms later than specified. Libslack corrects for this as best as it can (if
> 10ms -= 10ms) but it's not good enough when you need timers with a
granularity of 10ms. In this case, you have to use
agent_create_with_select() instead of agent_create() under Linux because
select() doesn't have this bug. However, scalable I/O is impossible with
select(). So, if you need timers with a granularity of 10ms *and* scalable
I/O, you need an agent that uses select() in one thread for the timers and
separate agents that use poll() in other threads for the I/O.

Solaris
~~~~~~~
Solaris (at least 2.6 and 2.7) doesn't return the hardware address or index
of network interfaces from ioctl() with a SIOCGIFINDEX command argument.
Libslack fills in the index in net_interfaces().

UNIX domain datagram sockets aren't supported very nicely. An actual
filesystem entry is needed for the client and it must be unlinked after use.
It's also possible for a malicious local user to deny a client access to the
server. The solution is to always use UNIX domain stream sockets.

Solaris has an inadequate snprintf() function so libslack provides it's own
implementation. When configured for Solaris, this snprintf() function will
format exactly like the system's sprintf() function, even though it has
incorrect behaviour with respect to the ISO C standard. I thought this was
better than having thousands of module tests apparently "fail".

OpenBSD
~~~~~~~
Has the same UNIX domain datagram socket problem as Solaris.

FreeBSD
~~~~~~~
Has the same UNIX domain datagram socket problem as Solaris.
Can't lock fifos so fifo_open() can't guarantee a unique reader.

Mac OS X
~~~~~~~~
Probably has the same UNIX domain datagram problem as Solaris.

SWIG
~~~~
SWIG generates wrappers to make C/C++ libraries accessible to various other
languages. The supported languages include Guile, Java, Perl, PHP, Python,
Ruby, Tcl and more.

To generate the SWIG input file for libslack, install libslack and then
(from the libslack source directory):

    make slack.swig

Use this SWIG file to generate wrappers for the languages of your choice.

Note: The C code that SWIG generates (slack_wrap.c) will contain a line that
includes lib.h. This include *must* be moved to the top of the file. This is
necessary to set up the system headers properly. It will *not* compile
unless you do this.

And don't forget to use `libslack-config --cflags` when compiling it and
`libslack-config --libs` when linking it.

COPYING
~~~~~~~
libslack - A UNIX/C library of general utilities for programmers with Slack
Copyright (C) 1999-2010 raf <raf@raf.org>

    This library is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this library; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
    or visit http://www.gnu.org/copyleft/gpl.html

$OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp $
$OpenBSD: strlcat.c,v 1.5 2001/01/13 16:17:24 millert Exp $
Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
All rights reserved.

    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
    1. Redistributions of source code must retain the above copyright
       notice, this list of conditions and the following disclaimer.
    2. Redistributions in binary form must reproduce the above copyright
       notice, this list of conditions and the following disclaimer in the
       documentation and/or other materials provided with the distribution.
    3. The name of the author may not be used to endorse or promote products
       derived from this software without specific prior written permission.

    THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
    INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
    AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
    THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
    OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
    OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
    ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

MAILING LISTS
~~~~~~~~~~~~~
If you'd like to be kept up to date with libslack releases or have questions
or suggestions, you can join one or more of the following (extremely low
volume) mailing lists (@libslack.org).

    slack-announce (Announcements)
    slack-users    (User forum)
    slack-dev      (Development forum)

To subscribe to any of these mailing lists, send a mail message to
<listname>-request@libslack.org with "subscribe" as the message body.

E.g. 

    $ echo subscribe | mail slack-announce-request@libslack.org
    $ echo subscribe | mail slack-users-request@libslack.org
    $ echo subscribe | mail slack-dev-request@libslack.org

Or you can send a mail message to majordomo@libslack.org with subscribe
listname in the message body. This way, you can include multiple subscribe
commands to subscribe to multiple lists at the same time. 

E.g. 

    $ mail majordomo@libslack.org
    subscribe slack-announce
    subscribe slack-users
    subscribe slack-dev
    .

A digest version of each mailing list is also available. Subscribe to
digests as above but append -digest to the listname.

E.g. 

    $ echo subscribe | mail slack-announce-digest-request@libslack.org
    $ echo subscribe | mail slack-users-digest-request@libslack.org
    $ echo subscribe | mail slack-dev-digest-request@libslack.org

Or 

    $ mail majordomo@libslack.org
    subscribe slack-announce-digest
    subscribe slack-users-digest
    subscribe slack-dev-digest

Note that these are all extremely low volume mailing lists so there's not
much use for the digest lists.

REFERENCES
~~~~~~~~~~
Advanced Programming in the UNIX Environment
W. Richard Stevens
Addison-Wesley Professional Computing Series, 1992

UNIX Network Programming
W. Richard Stevens
Prentice Hall Software Series, 1990

UNIX System V Network Programming
Stephen A. Rago
Addison-Wesley Professional Computing Series, 1993

TCP/IP Illustrated Volume 1, The Protocols
W. Richard Stevens
Addison-Wesley Professional Computing Series, 1994

UNIX Network Programming Volume 1, Networking APIs: Sockets and XTI
W. Richard Stevens
Prentice Hall Software Series, 1998

The Practice of Programming
Brian W. Kernighan and Rob Pike,
Addison-Wesley Professional Computing Series, 1999

Multithreaded Programming with Pthreads
Bil Lewis and Daniel J. Berg
Sun Microsystem Press/Prentice Hall, 1998

Effective TCP/IP Programming
Jon C. Snader
Addison-Wesley, 2000

Design Patterns - Elements of Reusable Object-Oriented Software
Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides
Addison-Wesley Professional Computing Series, 1995

The Standard C Library
P. J. Plauger
Prentice Hall, 1992

The Discipline and Method Architecture for Reusable Libraries
Kiem-Phong Vo
Software - Practice & Experience, v.30, pp.107-128, 2000
http://www.research.att.com/sw/tools/sfio/dm-spe.ps

strlcpy and strlcat--Consistent, Safe, String Copy and Concatenation
Todd C. Miller and Theo De Raadt
Proceedings of the FREENIX Track: 1999 USENIX Annual Technical Conference
http://www.usenix.org/events/usenix99/millert.html

The Perl manpages
Larry Wall
http://www.perl.com/

Practical UNIX and Internet Security
Simson Garfinkel and Gene Spafford
O'Reilly, 1996

Interconnections - Bridges, Routers, Switches and Internetworking Protocols
Radia Perlman
Addison-Wesley Professional Computing Series, 2000

MT-Disciplined
raf
http://raf.org/papers/mt-disciplined.html, 2001

I/O Event Handling Under Linux
Richard Gooch
http://www.atnf.csiro.au/~rgooch/linux/docs/io-events.html, 1999

Scalable kernel performance for Internet servers under realistic loads
Gaurav Banga and Jeffrey C. Mogul
Proceeding of the Refereed Papers Track: 1998 USENIX Annual Technical Conference
http://www.usenix.org/publications/library/proceedings/usenix98/banga.html

TCP Buffering and Performance Over An ATM Network
Purdue Technical Report CSD-TR 94-026 (Revision)
Journal of Internetworking: Research and Experience, Vol. 6 (1), Pages 1-13
Douglas E. Comer and John C. Lin
ftp://gwen.cs.purdue.edu/pub/lin/TCP.atm.ps.Z, 1994

Experimental and Simulation Performance Results of TCP/IP over High-Speed ATM over ACTS
Charalambos, C.; Lazarou, G.; Frost, V.; Evans, J.; Jonkman, R.
Information and Telecommunication Technology Center,
Department of Electrical Engineering & Computer Science,
The University of Kansas
http://acts.lerc.nasa.gov/library/docs/gsn/charalambous.pdf

Revelation X: The "Bob" Apocryphon
Translated by The Subgenius Foundation,
Edited by Reverend Ivan Stang,
Simon & Schuster, 1994

HISTORY
~~~~~~~
0.1 (19991020)
    - Initial version

0.2 (19991223)
    - Decoupled core file prevention from daemon_init()
      into its own function, daemon_prevent_core()
    - Decoupled signal handling from daemon_init()
    - Cached daemon_started_by_init() and daemon_started_by_inetd() results
    - Added some modules to libprog: conf, list, hsort, map, prop
    - Added timestamps to msg_out_file()
    - Included source to GNU getopt_long_only() (if necessary)
    - Added hdr.h to allow non-ANSI compilers to parse libprog's headers
    - Moved libprog to a subdirectory using a "Whole Project" Makefile
    - Converted "Whole Project" Makefile into "Scalable" Makefiles
    - Added verbosity functions to libprog(prog)
    - Fixed bug when constructing data for GNU getopt_long_only()
    - Fixed bugs in the options table for libprog(prog)
    - Changed help message format: separated option chunks by a blank line
    - Fixed bug when obtaining names associated with syslog constants
    - Added pathetic conf/linux and conf/solaris scripts
    - Added manpages

0.3 (20000902)
    - Started using GNU getopt_long() instead of getopt_long_only()
    - Added -DSVR4 in conf/solaris (doh!)
    - Added conditional compilation of debug functions
    - Added assert macro that calls dump()
    - Fixed bug: SIG_IGN, SIG_DFL and nasty signals weren't treated specially
    - Made lists grow/shrink exponentially rather than linearly
    - Made maps grow as needed and use arbitrary hash functions and key types
    - Added multi-dimensional array allocator to the mem module
    - Added net module: clients/servers, expect/send, pack/unpack, mail
    - Added internal iterators and some more functions to list and map
    - Added examples sections to some libprog manpages
    - Added str module: decent strings + tr, regex, regsub, fmt, trim, lc, uc ...
    - Added vsscanf(3) implementation for systems that don't have it (e.g. solaris)
    - Renamed libprog to libslack (thanks, fred)
    - Added socks.h
    - Added daemon_revoke_privileges(), daemon_file_is_safe() to daemon module

0.4 (20010215)
    - Fixed memory usage bugs
    - Changed net server/client functions to use service name else port number
    - Fixed security bug: daemon_file_is_safe() wasn't following symlinks (doh!)
    - Renamed daemon_file_is_safe() to daemon_path_is_safe()
    - Added daemon_absolute_path() to daemon module
    - Added memory pool functions to mem module
    - Fixed bug: optional option arguments were handled in dodgy C
    - Made supplied snprintf() POSIX compliant (was using getpagesize())
    - Removed conf module (Added daemon_parse_config() to daemon module)
    - Removed net_chat(), rfc822_localtime(), rfc822_gmtime() (not useful enough)
    - Added secure memory/pool functions to mem module
    - Fixed Makefile bug: $(CCFLAGS) for daemon and libslack weren't separate
    - Added fgetline() to fifo module (reads a line with any line ending)
    - Added str_fgetline() to str module (like fgetline but handles any length)
    - Renamed fifo module to fio
    - Fixed Makefile bug: wasn't uninstalling everything properly
    - Changed net_send() to take a timeout argument like next_expect() does
    - Added strlcpy(), strlcat(), strcasecmp() and strncasecmp() to str module
    - Renamed conf/solaris to solaris-gcc and added solaris-cc for sun workshop
    - Added support for root and user pidfiles in separate directories
    - Added make rpm rpm-daemon rpm-slack (with Edward Avis ed at membled.com)
    - Added installation of manpages for each function (link to module manpage)
    - Added libslack(3) overview manpage
    - Added list_break(), map_break()
    - Renamed assert() to check() for obvious reasons
    - Renamed re funcs in str module: s/regex/regexpr/g
    - Added thread module and made everything MT-Safe or MT-Disciplined
    - Added relative index/range semantics to string functions
    - Added make deb deb-daemon deb-slack (debian binary packages)
    - Added make pkg pkg-daemon pkg-slack (solaris binary packages)
    - Added setsockopt(SO_REUSEADDR) for net servers
    - Changed net server/client API to allow optional setsockopt(RCVBUF/SNDBUF)
    - Added REFERENCES section to README file
    - Stopped net_expect/net_send from interfering with SIGALRM/alarm/setitimer
    - Added read_timeout(), write_timeout() and rw_timeout() to fio module
    - Changed net_read() and net_write() to take a timeout argument
    - Added '?' field size specifier to unpack() (for packet length fields)
    - Added libslack-config administration utility
    - Renamed sockaddr typedef to sockaddr_t
    - Changed net_client to take a timeout parameter
    - Fixed fd leak in error handling code in net server/client functions
    - Fixed bug: str_regsub() didn't handle empty string matches at all
    - Changed str_regexpr_split() to take cflags and eflags arguments
    - Changed all *_destroy macros to functions that take address of pointer
    - Changed mem_resize macro so client must explicitly provide address of mem
    - Changed all *_destroy_t typedefs to *_release_t
    - Added make [un]install-{daemon|slack}-html (not part of make [un]install)
    - Temporarily removed snprintf module (not MT-Safe, not essential)
    - Merged lognames module into msg module
    - Merged opt module into prog module
    - Renamed _* functions in err module to *f (not ANSI compliant)
    - Removed MANIFEST

0.5 (20011109)
    - Fixed Makefile bug: decoupled libslack optlevel from module test optlevel
    - Fixed API bug: str_length_unlocked() was static
    - Fixed API bug: prop_locker() prototype wasn't in prop.h
    - Added prop_clear() to prop module
    - Added octal/hex and error handling to command line integer option handling
    - Fixed bug: check() just called dump() without testing the condition first
    - Added variants of six standard C string functions with more useful APIs
    - Added thread module tests (and locker timing tests)
    - Changed locker function return values (now same as pthread return values)
    - Improved speed of lockers (now overhead = 1 test + 1 deref + 1 offset)
    - Changed item/length/size, bin/hex/oct functions to return -1 on error
    - Changed error returns to consistently set errno (str, list, map)
    - Added set_errnull() to err module
    - Added relative index/range semantics to list functions (same as with str)
    - Changed fifo_open() to take writefd return arg to prevent fd leaks
    - Simplified mem_resize() assuming ISO C compliant realloc()
    - Added internal ISO C compliant realloc() for systems that don't have it
    - Fixed bug: optval/optlen for getsockopt(SO_ERROR) not initialised
    - Fixed inode leak: fifo_open() didn't unlink fifo created on error
    - Removed thread_init(), thread_setcancel() and barriers from thread module
    - Renamed thread module to locker (decoupled thread safety)
    - Stopped daemon_revoke_privileges() from clearing supplementary group list
    - Added support for "debug sections" to debug messaging
    - Added daemon_become_user() to daemon module
    - Added "_unlocked" versions of functions in str, list and map modules
    - Renamed "_locked" functions to "_with_locker" to avoid confusion
    - Fixed bug: removed highly dubious synchronisation from internal iterators
    - Added read locked iterators
    - Added alert functions to prog, err and msg modules
    - Systematically corrected function prototype typos in manpages
    - Added net_options() to net module (sets multiple socket options)
    - Added soundex() to str module
    - Removed caching and mutex locks in daemon_started_by_init/inetd()
    - Added ignoring SIGHUP before losing session leadership in daemon_init()
    - Improved IPv6 support in net module (i.e. can now bind to IPv6 wildcard)
    - Added support for UNIX domain sockets to net module
    - Increased socket listen queue length from 5 to 1024
    - Fixed bug: net service port selection only used numeric port arg
    - Added handling of name lookup returning multiple addresses for net clients
    - Added default host to net client functions (i.e. null host == loopback)
    - Changed net_create_server() and net_create_client() to take sockopt list
    - Added support for net clients binding to a specific local port
    - Added net_gethostbyname() and net_getservbyname() to net module
    - Made net server and client functions threadsafe
    - Added socket option notes to net module manpage (from W. Richard Stevens)
    - Added protocol design notes to net module manpage (from Radia Perlman)
    - Added sendfd() and recvfd() to net module (send/recv open file descriptor)
    - Replaced ioctl() with fcntl() in nonblock functions
    - Added support for net client/server service argument being numeric
    - Added link module (singly/doubly linked lists and "growable" freelists)
    - Added agent module (poll/select plus hierarchical timing wheel scheduler)
    - Added net_interfaces() to net module (retrieve list of network interfaces)
    - Added support for IPv4 and IPv6 multicasting to net module
    - Added Reliability over UDP functions to net module (net_rudp_transact())
    - Added Type of Service (TOS) functions to net module
    - Changed net_pack/net_unpack functions to take a timeout arg
    - Added nap() function to fio module (subsecond sleep)
    - Added threadsafe snprintf() function for systems that don't have it
    - Added asprintf() to str module for systems that don't have it
    - Added config.h to simplify compile commands (prelude to autoconf)
    - Removed thread_attr_{init,set}() (not useful enough or portable enough)
    - Ported to OpenBSD 2.9
    - Added pseudo module (pseudo terminals by Tatu Ylonen from openssh)
    - Added coproc module (coprocesses with or without a pseudo terminal)
    - Changed syslog functions to take a priority parameter
    - Added make obsd obsd-daemon obsd-slack (openbsd binary packages)
    - Added libslack-config --uninstall
    - Proofread all of the doco (just once)
    - Added setting appropriate TOS values in mail()
    - Fixed validation of relative index/range values in str/list modules
    - Added relative index semantics to list_item()
    - Added read locked versions of map_apply() and list_apply()
    - Added make and dist-html-slack (manpages as html.tar.gz)

0.5.1 (20020916)
    - Added HEADER FILES section to libslack(3) manpage
    - Added #include <slack/std.h> to example sections of module manpages
    - Added conf/freebsd (mmoraes at teleias.com)
    - Added tools/prefix utility (add prefix to all libslack identifiers)
    - Added manpage for tools/analyse-debug-locker utility
    - Separated stdout and stderr in coproc_open() and coproc_close()
    - Changed coproc open functions to take action() and data arguments
    - Exposed daemon_pidfile()
    - Added daemon_is_running()
    - Added daemon_stop()
    - Renamed sighandler_t to signal_handler_t (glibc clash - gdr at gno.org)
    - Ported to Solaris 8
    - Split Solaris configuration scripts into conf/solaris[68]-[g]cc
    - Added support for installing gzipped manpages
    - Stopped generating debian package (until it's a shared library)
    - Added make fbsd fbsd-daemon fbsd-slack (freebsd binary packages)
    - Added support for absolute path in daemon_pidfile()
    - Added daemon_getpid()
    - Added libslack-config --upgrade option
    - Added lame ./config script that just calls existing lame conf/* scripts

0.5.2 (20040102)
    - Fixed API bug: <slack/lib.h> didn't include <slack/coproc.h>
    - Fixed bug: -lm wasn't in `libslack-config --libs` on Solaris
    - Changed daemon_path_is_safe() to give an explanation when unsafe
    - Fixed bug: reset agent state to IDLE when interrupted (bte at kamash.com)
    - Trim unquoted leading spaces from property values (with bte at kamash.com)
    - Also trim only unquoted trailing spaces from property names
    - Added tools/migrate-properties utility (preserves old propfile behaviour)
    - Fixed bug: ownership partially lost in map_resize (with bte at kamash.com)
    - Fixed bug: mem_resize was broken since libslack-0.4 (bte at kamash.com)
    - Fixed DOC bug: stated the importance of including <slack/lib.h> first
    - Added sections to libslack(3) features list (coproc+pty, low level api)
    - Fixed bug: if select() failed (unlikely), coproc wasn't closed properly
    - Fixed bug: when tty_raw() failed (unlikely), it returned the wrong value
    - Added many examples to the manpages (there are now 91 runnable examples)
    - Added tools/check-examples to verify that all examples work
    - Fixed bug: str_fgetline() returned empty string rather than null on eof
    - Fixed bug: cstrstr() didn't always work due to a typo 
    - Added sections to libslack(3) features list (documentation, testing)
    - Added intel solaris8 binary package
    - Ported to Mac OS X (Darwin) 10.3.2
    - Added make osx osx-daemon osx-slack (macosx binary packages)
    - Dropped support for K&R clients (suggested by skaller at ozemail.com.au)
    - Added hsort_closure(3) (suggested by skaller at maxtal.com.au)
    - Added make slack.swig (generate a SWIG input file for libslack)

0.6 (20100612)
    - Stopped accidentally installing config.h (spotted by rrt at sc3d.org)
    - Fixed bug: need double-fork on Linux (spotted by Joey Hess joeyh at debian.org)
    - Fixed bug checking argument validity in agent_recv()
    - Updated makefiles to work with recent versions of GNU make
    - Changed opt module to be ISO C compliant (backwards-incompatible!)
    - Updated to avoid new warnings in recent versions of gcc
    - Fixed pidfile race condition (with Hilko Bengen bengen at hilluzination.de)
    - 64-bit-related fixes for pack() and snprintf()
    - Updated to use va_copy() with vsnprintf() in str module
    - Made daemon_is_running() work when readonly (spotted by Thomas Koch thomas at koch.ro)
    - Ported to GNU/kFreeBSD (with Cyril Brulebois cyril.brulebois at enst-bretagne.fr)
    - Ported to NetBSD
    - Added make nbsd nbsd-daemon nbsd-slack (netbsd binary packages)
    - Ported to Solaris10 and OpenSolaris
    - Tested on ubuntu-10.04, debian-5.0.4, fedora-13 (x86_64, i386)
    - Tested on solaris-10-200910, opensolaris-200906 (amd64, i386)
    - Tested on openbsd-4.7, freebsd-8.0, netbsd-5.0.2 (amd64, i386)
    - Tested on macosx-10.{4,5,6} (x86_64, i386, ppc)
    - Tested on kfreebsd-20090729 (i386)
    - Updated make rpm sol obsd fbsd osx to continue working

TODO
~~~~
    - Decouple memory type and allocation strategy from List/Map/String code
    - Use autoconf and libtool

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
URL: http://libslack.org/
Date: 20100612
Author: raf <raf at raf.org>
