Next: Functions with idiosyncratic bindings, Previous: Function Return Values, Up: sb-posix
Sb-posix provides various Lisp object types to stand in for C structures in the POSIX library. Lisp bindings to C functions that accept, manipulate, or return C structures accept, manipulate, or return instances of these Lisp types instead of instances of alien types.
The names of the Lisp types are chosen according to the general rules
described above. For example Lisp objects of type STAT stand
in for C structures of type struct stat.
Accessors are provided for each standard field in the structure. These
are named structure-name-field-name where the two
components are chosen according to the general name conversion rules,
with the exception that in cases where all fields in a given structure
have a common prefix, that prefix is omitted. For example,
stat.st_dev in C becomes STAT-DEV in Lisp.
Because sb-posix might not support all semi-standard or implementation-dependent members of all structure types on your system (patches welcome), here is an enumeration of all supported Lisp objects corresponding to supported POSIX structures, and the supported slots for those structures.
Class precedence list:
flock, standard-object, tSlots:
type— initarg::type; reader:sb-posix:flock-type; writer:(setf sb-posix:flock-type)Type of lock; F_RDLCK, F_WRLCK, F_UNLCK.
whence— initarg::whence; reader:sb-posix:flock-whence; writer:(setf sb-posix:flock-whence)Flag for starting offset.
start— initarg::start; reader:sb-posix:flock-start; writer:(setf sb-posix:flock-start)Relative offset in bytes.
len— initarg::len; reader:sb-posix:flock-len; writer:(setf sb-posix:flock-len)Size; if 0 then until
eof.pid— reader:sb-posix:flock-pidProcess
idof the process holding the lock; returned with F_GETLK.Class representing locks used in fcntl(2).
Class precedence list:
passwd, standard-object, tSlots:
name— initarg::name; reader:sb-posix:passwd-name; writer:(setf sb-posix:passwd-name)User's login name.
passwd— initarg::passwd; reader:sb-posix:passwd-passwd; writer:(setf sb-posix:passwd-passwd)The account's encrypted password.
uid— initarg::uid; reader:sb-posix:passwd-uid; writer:(setf sb-posix:passwd-uid)Numerical user
id.gid— initarg::gid; reader:sb-posix:passwd-gid; writer:(setf sb-posix:passwd-gid)Numerical group
id.gecos— initarg::gecos; reader:sb-posix:passwd-gecos; writer:(setf sb-posix:passwd-gecos)User's name or comment field.
dir— initarg::dir; reader:sb-posix:passwd-dir; writer:(setf sb-posix:passwd-dir)Initial working directory.
shell— initarg::shell; reader:sb-posix:passwd-shell; writer:(setf sb-posix:passwd-shell)Program to use as shell.
Instances of this class represent entries in the system's user database.
Class precedence list:
stat, standard-object, tSlots:
mode— initarg::mode; reader:sb-posix:stat-modeMode of file.
ino— initarg::ino; reader:sb-posix:stat-inoFile serial number.
dev— initarg::dev; reader:sb-posix:stat-devDevice
idof device containing file.nlink— initarg::nlink; reader:sb-posix:stat-nlinkNumber of hard links to the file.
uid— initarg::uid; reader:sb-posix:stat-uidUser
idof file.gid— initarg::gid; reader:sb-posix:stat-gidGroup
idof file.size— initarg::size; reader:sb-posix:stat-sizeFor regular files, the file size in bytes. For symbolic links, the length in bytes of the filename contained in the symbolic link.
atime— initarg::atime; reader:sb-posix:stat-atimeTime of last access.
mtime— initarg::mtime; reader:sb-posix:stat-mtimeTime of last data modification.
ctime— initarg::ctime; reader:sb-posix:stat-ctimeTime of last status change
Instances of this class represent Posix file metadata.
Class precedence list:
termios, standard-object, tSlots:
iflag— initarg::iflag; reader:sb-posix:termios-iflag; writer:(setf sb-posix:termios-iflag)Input modes.
oflag— initarg::oflag; reader:sb-posix:termios-oflag; writer:(setf sb-posix:termios-oflag)Output modes.
cflag— initarg::cflag; reader:sb-posix:termios-cflag; writer:(setf sb-posix:termios-cflag)Control modes.
lflag— initarg::lflag; reader:sb-posix:termios-lflag; writer:(setf sb-posix:termios-lflag)Local modes.
Instances of this class represent I/O characteristics of the terminal.
Class precedence list:
timeval, standard-object, tSlots:
sec— initarg::tv-sec; reader:sb-posix:timeval-sec; writer:(setf sb-posix:timeval-sec)Seconds.
usec— initarg::tv-usec; reader:sb-posix:timeval-usec; writer:(setf sb-posix:timeval-usec)Microseconds.
Instances of this class represent time values.