From e92e5cbc9c42a7f926eb4b25fdf6e52ec9d2fa4c 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 9ad14de..3f580e9 100644
--- a/doc/libstddjb/allreadwrite.html
+++ b/doc/libstddjb/allreadwrite.html
@@ -46,17 +46,17 @@ use higher-level APIs such as buffer and
These functions handle arrays of bytes (strings). They are similar to their
counterparts from the standard
- string.h
+ string.h
header, but they return indices instead of pointers.
cspawn is a unifier API to spawn child processes with
-posix_spawn()
+posix_spawn()
as a backend if supported by the system, falling back on
-fork() +
-execve()
+fork() +
+execve()
otherwise.
typedef ssize_t io_func (int fd, char *buf, size_t len)
This is the simplified type of IO functions such as
-read()
+read()
and
-write().
+write().
typedef ssize_t iov_func (int fd, struct iovec const *v, unsigned int vlen)
This is the simplified type of IO functions such as
-readv()
+readv()
and
-writev(),
+writev(),
where the content to perform IO on is specified as a
scatter/gather array of vlen
elements instead of a single string.
@@ -122,42 +122,42 @@ elements instead of a single string.
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_readv (int fd, struct iovec const *v, unsigned int vlen)
Safe wrapper around the
-readv()
+readv()
function.
ssize_t fd_writev (int fd, struct iovec const *v, unsigned int vlen)
Safe wrapper around the
-writev()
+writev()
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().
@@ -196,7 +196,7 @@ Returns 1 if it succeeds and 0 if it fails. Shuts down socket fd, for reading if w is zero, and for writing otherwise. Does not return an error code; does not modify errno. This is just a call to -shutdown() +shutdown() with errno saved, used essentially to isolate application code from sys/socket.h which is a portability nightmare.
@@ -227,14 +227,14 @@ Returns -1 (and sets errno) if an error occurs.
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, unsigned int mode)
Safe wrapper around
-open()
+open()
when it takes 3 arguments.
pid_t waitpid_nointr (pid_t pid, int *wstat, int flags)
Safe wrapper around
-waitpid().
+waitpid().
diff --git a/doc/libstddjb/env.html b/doc/libstddjb/env.html index aff9257..9fe2885 100644 --- a/doc/libstddjb/env.html +++ b/doc/libstddjb/env.html @@ -55,7 +55,7 @@ environment variables, or to remove them from the environment.
char const *env_get (char const *s)
Deprecated alias of
-getenv().
+getenv().
diff --git a/doc/libstddjb/index.html b/doc/libstddjb/index.html index 2e25056..b67620d 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() nor 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: @@ -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,9 +183,9 @@ 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. diff --git a/doc/libstddjb/lolstdio.html b/doc/libstddjb/lolstdio.html index 57ce81d..6a4bd8c 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 54c0f36..ebed941 100644 --- a/doc/libstddjb/selfpipe.html +++ b/doc/libstddjb/selfpipe.html @@ -219,12 +219,12 @@ be trapped anymore.
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. @@ -96,10 +96,10 @@ precision. A tain 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 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. diff --git a/doc/libunixonacid/unix-transactional.html b/doc/libunixonacid/unix-transactional.html index bab45a0..9a36173 100644 --- a/doc/libunixonacid/unix-transactional.html +++ b/doc/libunixonacid/unix-transactional.html @@ -62,21 +62,21 @@ the original working directory using fd_chdir.
int open2_at (int fd, char const *file, int flags)
Safe wrapper around
-openat()
+openat()
when it takes 2 arguments.
int open3_at (int fd, char const *file, int flags)
Safe wrapper around
-openat()
+openat()
when it takes 3 arguments.
int access_at (int fd, char const *file, int amode, unsigned int flag)
Calls
-faccessat()
+faccessat()
with flags set either to zero, or AT_EACCESS, if flag is nonzero.
This function ensures a fall back on platforms without *at system calls.