lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I just tagged a new release of Lua Unix, a bindings module to POSIX _and_
non-POSIX Unix APIs, providing a consistent and tested suite of interfaces
across Linux, Solaris, OS X, FreeBSD, NetBSD, OpenBSD, and AIX.

Notable recent additions include:

* AIX as a supported platform
* getifaddrs - Emulated on AIX and Solaris 10 using ioctl
* fork, execve, execl, execlp, and waitpid
* getenv, setenv, and mapped environ table using metamethods
* issetugid - New, safer Linux emulation using getauxval(AT_SECURE)
* sigtimedwait - Emulated on OS X and OpenBSD
* Debian package compliant with new Debian Lua packaging policy

Homepage: http://25thandclement.com/~william/projects/lunix.html
Documentation: http://25thandclement.com/~william/projects/lunix.pdf

About Lua Unix:

Lua Unix is a bindings library module to common Unix system APIs. The module
is regularly tested with Linux, OS X, FreeBSD, NetBSD, OpenBSD, Solaris, and
AIX. The best way to describe it is in contradistinction to luaposix, the
most popular bindings module for Unix APIs in Lua.

Thread-safety - Unlike luaposix, it strives to be as thread-safe as possible
on the host platform. Interfaces like strerror_r and O_CLOEXEC are used
throughout. The module even includes a novel solution for the inherently
non-thread-safe umask system call, where calling umask from one thread might
result in another thread creating a file with unsafe or unexpected
permissions. APIs which pose thread-safety issues and which could not be
made transparently safe are documented thoroughly in both the PDF and source
code.

Unix Extensions - Unlike luaposix, the library does not restrict itself to
POSIX, and emulates an interface when not available natively on a supported
platform. For example, the library provides arc4random (absent on Linux and
Solaris), clock_gettime (absent on OS X), a thread-safe timegm (absent on
Solaris and AIX), getifaddrs (absent on Solaris 10 and AIX), and
sigtimedwait (absent on OS X and OpenBSD).

Leak-safety - Unlike luaposix, the library prefers dealing with FILE handles
rather than raw integer descriptors to minimize the risk of descriptor
leaks. Raw descriptors are accepted as arguments but new file objects are
generally returned as FILE handles.