From 04905aaeffba2bc77866a4056dc3f2020a86bb26 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Wed, 8 Mar 2017 09:39:11 +0000 Subject: Update documentation for the types change, with some extra fixes Also remove --enable-replace-libc from configure --- doc/flags.html | 21 ---------- doc/libbiguint/index.html | 64 ++++++++++++++-------------- doc/librandom/index.html | 4 +- doc/libstdcrypto/index.html | 17 +++++--- doc/libstddjb/alloc.html | 6 +-- doc/libstddjb/allreadwrite.html | 24 +++++------ doc/libstddjb/bitarray.html | 32 +++++++------- doc/libstddjb/djbtime.html | 20 ++++----- doc/libstddjb/djbunix.html | 90 +++++++++++++++++----------------------- doc/libstddjb/gccattributes.html | 2 +- doc/libstddjb/index.html | 13 +++--- doc/libstddjb/iopause.html | 31 +++++++------- doc/libstddjb/ip46.html | 26 ++++++------ doc/libstddjb/lolstdio.html | 4 +- doc/libstddjb/siovec.html | 28 +++++++++++++ doc/libstddjb/stralloc.html | 2 +- 16 files changed, 188 insertions(+), 196 deletions(-) create mode 100644 doc/libstddjb/siovec.html (limited to 'doc') diff --git a/doc/flags.html b/doc/flags.html index ad39b4b..b054cb8 100644 --- a/doc/flags.html +++ b/doc/flags.html @@ -58,27 +58,6 @@ to the installed skalibs shared libraries. If this option is not given, no slashpackage support will be provided.

-

--enable-libc-replacements

- -

- If this option is given, then the low-level components -of libstddjb, such as byte_copy(), -will be built using independent, failsafe implementations; skalibs will -avoid relying on the libc when possible. -

- -

- If this option is not given, then native libc primitives such as -memmove() -will be used for the low-levels components of libstddjb. This is the default. -

- -

- This flag should be set if your libc has known bugs or you are uncertain -of it for some reason. Standard libcs on modern systems have been thoroughly -tested, so it's usually safe, and faster, to stick to the default. -

-

--enable-tai-clock

diff --git a/doc/libbiguint/index.html b/doc/libbiguint/index.html index bce94ca..bbe724e 100644 --- a/doc/libbiguint/index.html +++ b/doc/libbiguint/index.html @@ -46,7 +46,7 @@ Definitions

+

+ Please bear in mind that rc4 and md5 are broken, and that sha1 is about to be. +Do not use them in security-critical applications. +

+

Compiling

- unsigned int fd_catn (int from, int to, unsigned int n)
+ size_t fd_catn (int from, int to, size_t n)
Synchronously copies at most n bytes from fd from to fd to. Returns the total number of transmitted bytes; sets errno if this number is lesser than n. EOF is reported as EPIPE. See above for zero-copy @@ -319,16 +319,6 @@ group database. This is a privileged operation. Returns -1 and sets errno if it fails; returns 0 if it succeeds.

-

- int prot_gid (int gid)
-Alias to setgid. -

- -

- int prot_uid (int uid)
-Alias to setuid. -

-

Executable search and execution, and environment

@@ -382,7 +372,7 @@ simply exiting 0.

- void pathexec_r_name (char const *file, char const *const *argv, char const *const *envp, unsigned int envlen, char const *modifs, unsigned int modiflen)
+ void pathexec_r_name (char const *file, char const *const *argv, char const *const *envp, size_t envlen, char const *modifs, size_t modiflen)
Alters envp (which does not have to be NULL-terminated, but the number envlen of elements must be provided) with the modifier string modifs of length modiflen, then performs @@ -390,7 +380,7 @@ string modifs of length modiflen, then performs

- void pathexec_r (char const *const *argv, char const *const *envp, unsigned int envlen, char const *modifs, unsigned int modiflen)
+ void pathexec_r (char const *const *argv, char const *const *envp, size_t envlen, char const *modifs, size_t modiflen)
Same as pathexec_r_name, except that the file argument is read from argv[0].

@@ -404,7 +394,7 @@ Returns 1 if it succeeds and 0 (and sets errno) if it fails.

- void pathexec_fromenv (char const *const *argv, char const *const *envp, unsigned int envlen)
+ void pathexec_fromenv (char const *const *argv, char const *const *envp, size_t envlen)
Performs pathexec_r() with the given arguments and the hidden modifier string.

@@ -430,7 +420,7 @@ to manipulate modifier strings and environments.

Forking children

- int doublefork ()
+ pid_t doublefork ()
Performs a double fork. Returns -1 if it fails (and sets errno, EINTR meaning that the intermediate process was killed by a signal), 0 if the current process is the grandchild, @@ -512,7 +502,7 @@ be unchanged.

- int wait_nohang (int *wstat)
+ pid_t wait_nohang (int *wstat)
Instantly reaps one zombie, and stores the status information into *wstat. Returns the PID of the reaped zombie if it succeeds, 0 if there was @@ -522,13 +512,13 @@ or -1 (and sets errno) if it fails.

- int waitpid_nointr (pid_t pid, int *wstat, int flags)
+ pid_t waitpid_nointr (pid_t pid, int *wstat, int flags)
Safe wrapper around waitpid().

- int wait_pid_nohang (pid_t pid, int *wstat)
+ pid_t wait_pid_nohang (pid_t pid, int *wstat)
Instantly reaps an undetermined number of zombies until it finds pid. Stores the status information for dead pid into *wstat. Returns pid if it succeeds, 0 if there was @@ -587,33 +577,27 @@ Returns 1 if it succeeds, and 0 (and sets errno) if it fails.

- int openreadclose (char const *file, stralloc *sa, unsigned int dummy)
-Legacy interface for openslurpclose(sa, file). The dummy -argument is unused. Returns 0 if it succeeds, and -1 (and sets errno) if it fails. -

- -

- int openreadnclose (char const *file, char *s, unsigned int n)
+ ssize_t openreadnclose (char const *file, char *s, size_t n)
Reads at most n bytes from file file into preallocated buffer s. Returns -1 (and sets errno) if it fails; else returns the number of read bytes. If that number is not n, errno is set to EPIPE.

- int openreadnclose_nb (char const *file, char *s, unsigned int n)
+ ssize_t openreadnclose_nb (char const *file, char *s, size_t n)
Like openreadnclose, but can fail with EAGAIN if the file cannot be immediately read (for instance if it's a named pipe or other special file).

- int openreadfileclose (char const *file, stralloc *sa, unsigned int n)
+ int openreadfileclose (char const *file, stralloc *sa, size_t n)
Reads at most n bytes from file file into the *sa stralloc, which is grown (if needed) to just accommodate the file size. Returns 1 if it succeeds and 0 (and sets errno) if it fails.

- int openwritenclose_unsafe_internal (char const *file, char const *s, unsigned int len, uint64 *dev, uint64 *ino, unsigned char dosync)
+ int openwritenclose_unsafe_internal (char const *file, char const *s, size_t len, dev_t *dev, ino_t *ino, int dosync)
Writes the n bytes stored at s into file file. The previous contents of file are destroyed even if the function fails. If dosync is nonzero, the new contents of file @@ -623,16 +607,16 @@ The function returns 1 if it succeeds, or 0 (and sets errno) if it fails.

- int openwritenclose_unsafe (char const *file, char const *s, unsigned int len)
-int openwritenclose_unsafe_sync (char const *file, char const *s, unsigned int len)
-int openwritenclose_unsafe_devino (char const *file, char const *s, unsigned int len, uint64 *dev, uint64 *ino)
-int openwritenclose_unsafe_devino_sync (char const *file, char const *s, unsigned int len, uint64 *dev, uint64 *ino)

+ int openwritenclose_unsafe (char const *file, char const *s, size_t len)
+int openwritenclose_unsafe_sync (char const *file, char const *s, size_t len)
+int openwritenclose_unsafe_devino (char const *file, char const *s, size_t len, dev_t *dev, ino_t *ino)
+int openwritenclose_unsafe_devino_sync (char const *file, char const *s, size_t len, dev_t *dev, ino_t *ino)

Trivial shortcuts around openwritenclose_unsafe_internal(). The reader can easily figure out what they do.

- int openwritenclose_suffix_internal (char const *file, char const *s, unsigned int len, uint64 *dev, uint64 *ino, unsigned char dosync, char const *suffix)
+ int openwritenclose_suffix_internal (char const *file, char const *s, size_t len, dev_t *dev, ino_t *ino, int dosync, char const *suffix)
Writes the n bytes stored at s into file file, by first writing into filesuffix and atomically renaming filesuffix to file. IOW, the old contents of file @@ -645,43 +629,43 @@ The function returns 1 if it succeeds, or 0 (and sets errno) if it fails.

- int openwritenclose_suffix (char const *file, char const *s, unsigned int len, char const *suffix)
-int openwritenclose_suffix_sync (char const *file, char const *s, unsigned int len, char const *suffix)
-int openwritenclose_suffix_devino (char const *file, char const *s, unsigned int len, uint64 *dev, uint64 *ino, char const *suffix)
-int openwritenclose_suffix_devino_sync (char const *file, char const *s, unsigned int len, uint64 *dev, uint64 *ino, char const *suffix)

+ int openwritenclose_suffix (char const *file, char const *s, size_t len, char const *suffix)
+int openwritenclose_suffix_sync (char const *file, char const *s, size_t len, char const *suffix)
+int openwritenclose_suffix_devino (char const *file, char const *s, size_t len, dev_t *dev, ino_t *ino, char const *suffix)
+int openwritenclose_suffix_devino_sync (char const *file, char const *s, size_t len, dev_t *dev, ino_t *ino, char const *suffix)

Trivial shortcuts around openwritenclose_suffix_internal(). The reader can easily figure out what they do.

- int openwritevnclose_unsafe_internal (char const *file, siovec_t const *v, unsigned int vlen, uint64 *dev, uint64 *ino, unsigned char dosync)
+ int openwritevnclose_unsafe_internal (char const *file, struct iovec const *v, unsigned int vlen, dev_t *dev, ino_t *ino, int dosync)
Like openwritenclose_unsafe_internal, but the content to write is taken from a -siovec_t scatter/gather array of vlen +scatter/gather array of vlen elements instead of a single string.

- int openwritevnclose_unsafe (char const *file, siovec_t const *v, unsigned int vlen)
-int openwritevnclose_unsafe_sync (char const *file, siovec_t const *v, unsigned int vlen)
-int openwritevnclose_unsafe_devino (char const *file, siovec_t const *v, unsigned int vlen, uint64 *dev, uint64 *ino)
-int openwritevnclose_unsafe_devino_sync (char const *file, siovec_t const *v, unsigned int vlen, uint64 *dev, uint64 *ino)

+ int openwritevnclose_unsafe (char const *file, struct iovec const *v, unsigned int vlen)
+int openwritevnclose_unsafe_sync (char const *file, struct iovec const *v, unsigned int vlen)
+int openwritevnclose_unsafe_devino (char const *file, struct iovec const *v, unsigned int vlen, dev_t *dev, ino_t *ino)
+int openwritevnclose_unsafe_devino_sync (char const *file, struct iovec const *v, unsigned int vlen, dev_t *dev, ino_t *ino)

Trivial wrappers around openwritevnclose_unsafe_internal().

- int openwritevnclose_suffix_internal (char const *file, siovec_t const *v, unsigned int vlen, uint64 *dev, uint64 *ino, unsigned char dosync, char const *suffix)
+ int openwritevnclose_suffix_internal (char const *file, struct iovec const *v, unsigned int vlen, dev_t *dev, ino_t *ino, int dosync, char const *suffix)
Like openwritenclose_suffix_internal, but the content to write is taken from a -siovec_t scatter/gather array of vlen +scatter/gather array of vlen elements instead of a single string.

- int openwritenclose_suffix (char const *file, char const *s, unsigned int len, char const *suffix)
-int openwritenclose_suffix_sync (char const *file, char const *s, unsigned int len, char const *suffix)
-int openwritenclose_suffix_devino (char const *file, char const *s, unsigned int len, uint64 *dev, uint64 *ino, char const *suffix)
-int openwritenclose_suffix_devino_sync (char const *file, char const *s, unsigned int len, uint64 *dev, uint64 *ino, char const *suffix)

+ int openwritenclose_suffix (char const *file, char const *s, size_t len, char const *suffix)
+int openwritenclose_suffix_sync (char const *file, char const *s, size_t len, char const *suffix)
+int openwritenclose_suffix_devino (char const *file, char const *s, size_t len, dev_t *dev, ino_t *ino, char const *suffix)
+int openwritenclose_suffix_devino_sync (char const *file, char const *s, size_t len, dev_t *dev, ino_t *ino, char const *suffix)

Trivial wrappers around openwritevnclose_suffix_internal().

@@ -706,7 +690,7 @@ Returns 0 if it succeeds or -1 (and sets errno) if it fails.

- int rm_rf_in_tmp (stralloc *tmp, unsigned int n)
+ int rm_rf_in_tmp (stralloc *tmp, size_t n)
Deletes a filesystem subtree, using *tmp as heap-allocated temporary space. Returns 0 if it succeeds or -1 (and sets errno) if it fails. @@ -763,14 +747,14 @@ Returns 0 if it succeeds and -1 (and sets errno) if it fails.

- int sabasename (stralloc *sa, char const *s, unsigned int len)
+ int sabasename (stralloc *sa, char const *s, size_t len)
Appends the basename of filename s (of length len) to *sa. Returns 1 if it succeeds and 0 (and sets errno) if it fails.

- int sadirname (stralloc *sa, char const *s, unsigned int len)
+ int sadirname (stralloc *sa, char const *s, size_t len)
Appends the dirname of filename s (of length len) to *sa. Returns 1 if it succeeds and 0 (and sets errno) if it fails. diff --git a/doc/libstddjb/gccattributes.html b/doc/libstddjb/gccattributes.html index 1e66aee..71a5e97 100644 --- a/doc/libstddjb/gccattributes.html +++ b/doc/libstddjb/gccattributes.html @@ -33,7 +33,7 @@ of gcc does not support the wanted attribute.

- extern unsigned int str_len (char const *) gccattr_pure ;
+ extern size_t str_len (char const *) gccattr_pure ;
 

diff --git a/doc/libstddjb/index.html b/doc/libstddjb/index.html index 6ecfeb2..63a786b 100644 --- a/doc/libstddjb/index.html +++ b/doc/libstddjb/index.html @@ -78,6 +78,9 @@ functions writing into buffers or skalibs/sgetopt.h: getopt()-style command-line options management

  • skalibs/sig.h: safe signal management
  • +
  • skalibs/siovec.h: scatter/gather IO primitives working with an +iovec +structure
  • skalibs/skamisc.h: general string quoting and parsing; miscellaneous, unclassifiable functions
  • skalibs/socket.h: INET domain sockets
  • skalibs/stralloc.h: advanced management of dynamically allocated strings
  • @@ -97,11 +100,9 @@ includes them.
  • skalibs/uint16.h: operations with 16-bit unsigned integers
  • skalibs/uint32.h: operations with 32-bit unsigned integers
  • skalibs/uint64.h: operations with 64-bit unsigned integers
  • -
  • skalibs/ushort.h: portable helpers for the "unsigned short" basic type
  • -
  • skalibs/uint.h: portable helpers for the "unsigned int" basic type
  • -
  • skalibs/ulong.h: portable helpers for the "unsigned long" basic type
  • +
  • skalibs/types.h: portable helpers for common Unix types: size_t, +uid_t, gid_t, pid_t, time_t, dev_t and ino_t.
  • skalibs/error.h: portable macros for errno management
  • -
  • skalibs/gidstuff.h: helpers for the "gid_t" type
  • skalibs/setgroups.h: stub for the setgroups() function, for systems that do not define it
  • skalibs/ip46.h: IPv4/IPv6 abstraction layer
  • @@ -115,12 +116,10 @@ are not associated with any code and are mostly self-explanatory:
  • skalibs/gccattributes.h: wrappers around a few GCC-specific optimizations
  • skalibs/diuint.h: for associative arrays of unsigned integers
  • skalibs/diuint32.h: for associative arrays of 32-bit unsigned integers
  • +
  • skalibs/disize.h: for associative arrays of size_t
  • skalibs/environ.h: declaration of the environ variable
  • skalibs/nsig.h: the number of system signals, for systems that do not define it
  • skalibs/nonposix.h: feature test macros for non-POSIX-compliant systems
  • -
  • skalibs/siovec.h: -iovec-like -structure for scatter/gather IO operations
  • diff --git a/doc/libstddjb/iopause.html b/doc/libstddjb/iopause.html index ff8727c..bcefb91 100644 --- a/doc/libstddjb/iopause.html +++ b/doc/libstddjb/iopause.html @@ -29,12 +29,12 @@ and implemented in the libskarnet.a or libskarnet.so library.

    iopause is the skalibs API for event loop selection. It's a -wrapper around the system's +wrapper around the system's ppoll() or poll() (if available) or select() -(if poll() is unavailable) function. It -works around some system-dependent quirks; also it works with +(if neither ppoll() n or poll() is available) function. + It works around some system-dependent quirks; also it works with absolute dates instead of timeouts. This is a good thing: see below.

    @@ -175,22 +175,23 @@ it is recommended to use this function instead of the lower-level

    Underlying implementations

    - iopause is an alias to either iopause_poll or -or iopause_select. By default, it is aliased to iopause_poll; to -alias it to iopause_select instead, configure skalibs with the ---enable-iopause-select option. + iopause is an alias to one of iopause_ppoll, iopause_poll or +iopause_select. It is always aliased to iopause_ppoll if +the ppoll() function is available on the system; else, it's aliased to +iopause_poll by default, and users can alias it to iopause_select +instead if they configure skalibs with the --enable-iopause-select option.

    -Both iopause_poll and iopause_select are implemented on top of the -ppoll() system call -if it is available; but if it is not, then iopause_poll defaults to -poll(), -which has a more comfortable API than +poll() +has a more comfortable API than select(), -but a maximum precision of 1 millisecond which might not be enough for some applications; whereas -iopause_select defaults to select(), which incurs some CPU overhead for the -API conversion, but has a 1 microsecond precision. +but its maximum precision is 1 millisecond, which might not be enough for some applications; +using select() instead incurs some CPU overhead for the API conversion, but has a +1 microsecond precision. +ppoll() gets the best of +both worlds with the same interface model as poll() and a 1 nanosecond precision, +which is why skalibs always uses it when available.

    diff --git a/doc/libstddjb/ip46.html b/doc/libstddjb/ip46.html index 8d13640..e0e95b3 100644 --- a/doc/libstddjb/ip46.html +++ b/doc/libstddjb/ip46.html @@ -74,21 +74,21 @@ except if IPv6 is unavailable, in which case it returns 0 ENOSYS.

    - unsigned int ip46_fmt (char *s, ip46_t const *a)
    + size_t ip46_fmt (char *s, ip46_t const *a)
    Formats the address in *a into the string s, which must be preallocated. Returns the number of bytes written. The address will be accordingly formatted as IPv4 or IPv6.

    - unsigned int ip46_scan (char const *s, ip46_t *a)
    + size_t ip46_scan (char const *s, ip46_t *a)
    Scans the string s for an IPv4 or IPv6 address. If it finds one, writes it into *a and returns the number of bytes read. If it cannot, returns 0.

    - unsigned int ip46_scanlist (ip46_t *list, unsigned int max, char const *s, unsigned int *n)
    + size_t ip46_scanlist (ip46_t *list, size_t max, char const *s, size_t *n)
    Scans the string s for a list of comma-, semicolon-, space-, tab- or newline-separated IPv4 or IPv6 addresses, up to a maximum of max. It stores them into the (preallocated) ip46_t array pointed to by list. @@ -97,24 +97,24 @@ IP list at all), and stores the number of found and scanned addresses into *

    - int socket_connect46 (int fd, ip46_t *a, uint16 port)
    + int socket_connect46 (int fd, ip46_t *a, uint16_t port)
    Connects the socket fd to address *a and port port. Returns 0 in case of success, and -1 (and sets errno) in case of failure.

    - int socket_bind46 (int fd, ip46_t *a, uint16 port)
    + int socket_bind46 (int fd, ip46_t *a, uint16_t port)
    Binds the socket fd to address *a and port port. Returns 0 in case of success, and -1 (and sets errno) in case of failure.

    - int socket_bind46_reuse (int fd, ip46_t *a, uint16 port)
    + int socket_bind46_reuse (int fd, ip46_t *a, uint16_t port)
    Same as the previous function, with the SO_REUSEADDR option.

    - int socket_deadlineconnstamp46 (int fd, ip46_t const *a, uint16 port, tain_t const *deadline, tain_t *stamp)
    + int socket_deadlineconnstamp46 (int fd, ip46_t const *a, uint16_t port, tain_t const *deadline, tain_t *stamp)
    Attempts to synchronously connect the socket fd to address aa and port port. Returns 1 if it succeeds and 0 (and sets errno) if it fails. stamp must contain an accurate enough @@ -124,35 +124,35 @@ returns 0 ETIMEDOUT.

    - int socket_recv46 (int fd, char *s, unsigned int len, ip46_t *a, uint16 *port)
    + ssize_t socket_recv46 (int fd, char *s, size_t len, ip46_t *a, uint16_t *port)
    Reads a datagram from socket fd. The message is stored into buffer s of max length len, and stores the sender information into address *a and port *port. Returns the length of the read datagram, or -1 if it fails.

    - int socket_send46 (int fd, char const *s, unsigned int len, ip46_t const *a, uint16 port)
    + ssize_t socket_send46 (int fd, char const *s, size_t len, ip46_t const *a, uint16_t port)
    Writes a datagram to socket fd. The message is read from buffer s of length len, and the recipient information is address *a and port port. Returns the number of written bytes, or -1 if it fails.

    - int socket_local46 (int fd, ip46_t *a, uint16 *port)
    + int socket_local46 (int fd, ip46_t *a, uint16_t *port)
    Gets the local information about bound socket fd: the local IP address is stored into *a and the local port into *port. Returns 0 in case of success, and -1 (and sets errno) in case of failure.

    - int socket_remote46 (int fd, ip46_t *a, uint16 *port)
    + int socket_remote46 (int fd, ip46_t *a, uint16_t *port)
    Gets the peer information about connected socket fd: the remote IP address is stored into *a and the remote port into *port. Returns 0 in case of success, and -1 (and sets errno) in case of failure.

    - int socket_recvnb46 (int fd, char *s, unsigned int len, ip46_t *a, uint16 *port, + ssize_t socket_recvnb46 (int fd, char *s, size_t len, ip46_t *a, uint16_t *port, tain_t const *deadline, tain_t *stamp)
    Like socket_recv46, except that the function blocks until a datagram is received. *stamp must be an accurate enough approximation of the @@ -161,7 +161,7 @@ arrived by absolute date *deadline, the function returns -1 ETIMEOUT.

    - int socket_sendnb46 (int fd, char const *s, unsigned int len, ip46_t const *a, uint16 port, + ssize_t socket_sendnb46 (int fd, char const *s, size_t len, ip46_t const *a, uint16_t port, tain_t const *deadline, tain_t *stamp)
    Like socket_send46, except that the function blocks until a datagram has been effectively sent. *stamp must be an accurate enough approximation of the diff --git a/doc/libstddjb/lolstdio.html b/doc/libstddjb/lolstdio.html index 2ec923b..8971137 100644 --- a/doc/libstddjb/lolstdio.html +++ b/doc/libstddjb/lolstdio.html @@ -38,8 +38,8 @@ formatting but interacting with buffers or Like any printf-style functions, the lolstdio functions are rather complex and inefficient, and not recommended for general use; they are provided as a quick and dirty way to debug or test things. Programmers -are advised to use the type-specific formatting -functions instead in production-quality code. +are advised to use type-specific formatting functions instead in +production-quality code.

    diff --git a/doc/libstddjb/siovec.html b/doc/libstddjb/siovec.html new file mode 100644 index 0000000..c308d9a --- /dev/null +++ b/doc/libstddjb/siovec.html @@ -0,0 +1,28 @@ + + + + + + skalibs: the siovec header + + + + + + +

    +libstddjb
    +libskarnet
    +skalibs
    +Software
    +skarnet.org +

    + +

    The skalibs/siovec.h header

    + +

    + TODO: write this documentation page. (Sorry!) +

    + + + diff --git a/doc/libstddjb/stralloc.html b/doc/libstddjb/stralloc.html index 75e3d45..0147466 100644 --- a/doc/libstddjb/stralloc.html +++ b/doc/libstddjb/stralloc.html @@ -93,7 +93,7 @@ A stralloc should be initialized to STRALLOC_ZERO before its first use.

    Functions

    - int stralloc_catb (stralloc *sa, char const *s, unsigned int len)
    + int stralloc_catb (stralloc *sa, char const *s, size_t len)
    Appends the len bytes pointed to by s to the end of the memory zone handled by *sa, automatically allocating more memory if needed. Returns 1 if it succeeds, and 0 if it fails. -- cgit v1.2.3