From f3d5157564992f1ef9f390b3ce0c7d3706ba0f19 Mon Sep 17 00:00:00 2001
From: Laurent Bercot
alarm is a set of primitives to provide the same functionality as
-alarm(),
+alarm(),
but with sub-second precision.
Depending on the functionality the underlying system provides,
the precision can be 1 nanosecond (implementation via
-timer_settime(),
+timer_settime(),
1 microsecond (implementation via
-setitimer(),
+setitimer(),
or 1 second (fallback implementation with
-alarm()
+alarm()
when nothing better can be found).
alloc is the skalibs heap memory manager. It's actually a
wrapper for the
-malloc()
+malloc()
series of functions; it unifies a few system-dependent malloc
behaviours. It's also the API to implement and preload if for some
reason you need to plug in your own allocator: replacing alloc()
diff --git a/doc/libstddjb/allreadwrite.html b/doc/libstddjb/allreadwrite.html
index 0dd5ea0..2619153 100644
--- a/doc/libstddjb/allreadwrite.html
+++ b/doc/libstddjb/allreadwrite.html
@@ -46,9 +46,9 @@ use higher-level APIs such as buffer and
@@ -97,28 +97,28 @@ set errno to EWOULDBLOCK or EAGAIN.
djbtime is a set of functions to convert
tai_t and tain_t structures, and
-TAI time, from and to
+TAI time, from and to
other time formats and user-friendly representations.
typedef ssize_t iofunc_t (int fd, char *buf, size_t len)
This is the simplified type of IO functions such as
-read()
+read()
and
-write().
+write().
ssize_t fd_read (int fd, char *s, size_t len)
Safe wrapper around the
-read()
+read()
function.
ssize_t fd_write (int fd, char const *s, size_t len)
Safe wrapper around the
-write()
+write()
function.
ssize_t fd_recv (int fd, char *s, size_t len, unsigned int flags)
Safe wrapper around the
-recv()
+recv()
function.
ssize_t fd_send (int fd, char const *s, size_t len, unsigned int flags)
Safe wrapper around the
-send()
+send()
function.
int pipenb (int *p)
Like
-pipe(),
+pipe(),
but both ends of the created pipe are in non-blocking mode.
int pipecoe (int *p)
Like
-pipe(),
+pipe(),
but both ends of the created pipe are close-on-exec.
int pipenbcoe (int *p)
Like
-pipe(),
+pipe(),
but both ends of the created pipe are in non-blocking mode and close-on-exec.
void fd_close (int fd)
Closes fd.
This is a safe wrapper around
-close().
+close().
int fd_chmod (int fd, unsigned int mode)
Safe wrapper around
-fchmod().
+fchmod().
int fd_chown (int fd, uid_t uid, gid_t gid)
Safe wrapper around
-fchown().
+fchown().
This function requires root privileges.
int fd_sync (int fd)
Safe wrapper around
-fsync().
+fsync().
int fd_chdir (int fd)
Safe wrapper around
-fchdir().
+fchdir().
@@ -165,7 +165,7 @@ supported:
@@ -236,14 +236,14 @@ modifying errno.
int open2 (char const *file, unsigned int flags)
Safe wrapper around
-open()
+open()
when it takes 2 arguments.
int open3 (char const *file, unsigned int flags)
Safe wrapper around
-open()
+open()
when it takes 3 arguments.
pid_t child_spawn0 (char const *file, char const *const *argv, char const *const *envp)
pid_t waitpid_nointr (pid_t pid, int *wstat, int flags)
Safe wrapper around
-waitpid().
+waitpid().
diff --git a/doc/libstddjb/gccattributes.html b/doc/libstddjb/gccattributes.html index 194edc9..fa604be 100644 --- a/doc/libstddjb/gccattributes.html +++ b/doc/libstddjb/gccattributes.html @@ -22,7 +22,7 @@
skalibs/gccattributes.h is a set of wrappers around -gcc +gcc attributes (duh). It defines macros that are always valid, and that have no effect if the compiler is not gcc or the used version of gcc does not support the wanted attribute. diff --git a/doc/libstddjb/index.html b/doc/libstddjb/index.html index d7b6ad1..7851ba9 100644 --- a/doc/libstddjb/index.html +++ b/doc/libstddjb/index.html @@ -45,7 +45,7 @@ including them directly.
iopause is the skalibs API for event loop selection. It's a wrapper around the system's ppoll() or -poll() +poll() (if available) or -select() +select() (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: @@ -41,7 +41,7 @@ see below.
iopause is a derived work from Dan J. Bernstein's -iopause library, but the +iopause library, but the skalibs implementation is subtly different.
@@ -49,7 +49,7 @@ skalibs implementation is subtly different.An iopause_fd structure is similar to a -struct pollfd +struct pollfd structure, and must be filled the same way. Usually, the user declares an array of iopause_fd and fills it, one element per descriptor to select on. If x is an iopause_fd: @@ -183,13 +183,13 @@ instead if they configure skalibs with the --enable-iopause-select opti
-poll() +poll() has a more comfortable API than -select(), +select(), 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 +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/lolstdio.html b/doc/libstddjb/lolstdio.html index 2af1d72..57ce81d 100644 --- a/doc/libstddjb/lolstdio.html +++ b/doc/libstddjb/lolstdio.html @@ -29,7 +29,7 @@ and implemented in the libskarnet.a or libskarnet.so library.lolstdio is a set of convenience functions providing -printf-style +printf-style formatting but interacting with buffers or bufallocs instead of stdio FILEs.
@@ -52,7 +52,7 @@ writing than fixed-size buffers or FILEs are.The current lolstdio implementation relies on the libc's -vsnprintf +vsnprintf function.
@@ -60,31 +60,31 @@ function.
int vbprintf (buffer *b, char const *format, va_list args)
-Like vfprintf
+Like vfprintf
except that the result is written to the buffer b.
int bprintf (buffer *b, char const *format, ...)
-Like fprintf
+Like fprintf
except that the result is written to the buffer b.
int lolprintf (char const *format, ...)
-Like printf
+Like printf
except that the result is written to the buffer buffer_1.
int vbaprintf (bufalloc *ba, char const *format, va_list args)
-Like vfprintf
+Like vfprintf
except that the result is written to the bufalloc ba.
int baprintf (bufalloc *ba, char const *format, ...)
-Like fprintf
+Like fprintf
except that the result is written to the bufalloc ba.
Quite a lot of system calls are defined by -The +The Open Group Base Specifications as interruptible: when the process is in the middle of such a system call and receives a signal that it does not ignore, the system call immediately returns -1 EINTR (after the signal @@ -47,7 +47,7 @@ simply restarted, not interrupted. EINTR can only happen when a signal handler has been installed, and a signal is actually caught by the signal handler during an interruptible system call. And to avoid EINTR, users can use the SA_RESTART flag when installing the signal handler with -sigaction(). +sigaction().
@@ -57,8 +57,8 @@ when writing an asynchronous event loop.
An asynchronous event loop is organized around a -select() or -poll() +select() or +poll() system call that is the only blocking operation in the whole loop. That call takes a timeout as an argument. If a signal handler is installed with SA_RESTART and a signal arrives in the middle of the select/poll call - which happens often diff --git a/doc/libstddjb/selfpipe.html b/doc/libstddjb/selfpipe.html index 4edbaf9..966c34d 100644 --- a/doc/libstddjb/selfpipe.html +++ b/doc/libstddjb/selfpipe.html @@ -64,7 +64,7 @@ execution flow that there's a signal to take care of. And, of course, signal handlers don't mix with event loops, which is a classic source of headaches for programmers and led to the birth of abominations such as - + pselect. So much for the "everything is a file" concept that Unix was built on.
@@ -77,7 +77,7 @@ fd readable or something.And that's exactly what the -self-pipe trick, invented +self-pipe trick, invented by DJB, does.
@@ -226,7 +226,7 @@ with you, so this is not a concern. Protect yourself from malicious applications with clever use of uids.Yes, the Linux team loves to gratuitously add new system calls to do diff --git a/doc/libstddjb/tai.html b/doc/libstddjb/tai.html index efd4346..d3eaa1d 100644 --- a/doc/libstddjb/tai.html +++ b/doc/libstddjb/tai.html @@ -50,21 +50,21 @@ understand what is going on:
The meat and potatoes of all this is that programmers cannot simply rely on standard Unix APIs such as -gettimeofday() +gettimeofday() (which, by the way, is marked as obsolescent, but it's not going to disappear tomorrow) to measure time intervals or even to give precise absolute time, and in any case those APIs will become obsolete in 2038. @@ -74,7 +74,7 @@ any case those APIs will become obsolete in 2038.
tai implements - among other things - the -TAI64 and TAI64N +TAI64 and TAI64N formats, which are used in all of skalibs. This gives a programmer access to precise linear absolute time, which is suitable for both timestamping (wallclock usage) and time interval measurements @@ -84,7 +84,7 @@ represent dates exceeding the estimated lifespan of the universe).
tai has been inspired by Dan J. Bernstein's -libtai library, but does not +libtai library, but does not borrow any code from it.
@@ -96,10 +96,10 @@ precision. A tain_t structure holds an absolute date with a maximum of one-nanosecond precision, as permitted by the underlying system call. If flag-usert is clear, the system clock will be read via -gettimeofday() +gettimeofday() system call, which has a one-microsecond precision; if it is set, the system clock will be read via the -clock_gettime() +clock_gettime() system call, which has a one-nanosecond precision. In either case, a current tain_t will be unable to be more precise than the underlying implementation. @@ -180,7 +180,7 @@ start of a program.The following two operations can only succeed if your system provides the -clock_gettime() +clock_gettime() primitive with at least one of the CLOCK_MONOTONIC or CLOCK_BOOTTIME clocks. Otherwise, they will fail with errno set to ENOSYS.
@@ -333,7 +333,7 @@ depending on whether skalibs was compiled with the --enable-tai-clock configure option). This is useful to get valid TAI/TAI64N timestamps out of information exported by the system, for instance the time_t -returned by time(), +returned by time(), or in the st_atim, st_mtim or st_ctim fields of a struct stat. @@ -427,14 +427,14 @@ Those functions return nonzero iff *t1 is lesser than *t2. Marshals *t into the buffer s points to, which must be preallocated with at least TAI_PACK (8) characters. Afterwards, the buffer contains the -external TAI64 format +external TAI64 format representation of *t.
void tai_unpack (char const *s, tai_t *t)
Unmarshals the
-external TAI64 format
+external TAI64 format
label pointed to by s (at least TAI_PACK characters) and stores
the result into t.
void tain_pack (char *s, tain_t const *a)
void tain_unpack (char const *s, tain_t *a)