Download Latest Version [ANN] luaposix v38 released source code.zip (297.4 kB)
Home / v38
Name Modified Size InfoDownloads / Week
Parent folder
[ANN] luaposix v38 released source code.tar.gz 2026-10-26 173.6 kB
[ANN] luaposix v38 released source code.zip 2026-10-26 297.4 kB
README.md 2026-10-26 5.5 kB
Totals: 3 Items   476.5 kB 0

Lua bindings for POSIX

I am happy to announce release 38 of luaposix.

luaposix's home page is at https://github.com/luaposix/luaposix/

Noteworthy changes in release 38 (2026-10-25) [stable]

New Features

  • New posix.time.tzset, to apply a change of the TZ environment variable, as in tzset(3).

  • The flags argument of posix.glob.glob is optional, and defaults to 0, as does the pattern to *.

  • posix.unistd.getopt returns the option character at fault, in place of the always nil argument, when it returns ? or : for an unrecognized option or a missing argument.

  • New posix.unistd.exece, to execute a program with a specified environment, as in execve(2).

  • Support for XSI extensions WIFCONTINUED and WCONTINUED in posix.sys.wait.

Bugs Fixed

  • Integer fields of tables passed to functions, such as tv_sec and tv_nsec of posix.time.nanosleep, truncate a float towards zero, as they always have in Lua 5.1, 5.2 and LuaJIT, rather than becoming 0 in Lua 5.3 and later.

  • The opterr argument of posix.unistd.getopt is documented as what it is, a flag that makes getopt print diagnostics to stderr, not the index of an option with an error, and its usage example runs.

  • The usage examples of posix.fcntl.fcntl, posix.fcntl.open and posix.sys.stat.chmod run: they named the wrong module for fcntl, F_GETFL, S_IRWXU and S_IRGRP, and called bit.bor without saying where it comes from.

  • The LDoc reference of posix.grp.getgrgid, posix.grp.getgrnam, posix.pwd.getpwnam and posix.pwd.getpwuid says that they return just nil, not an error message, when the group or user does not exist.

  • The msqid argument of posix.sys.msg.msgctl, the values to set with IPC_SET, is in the LDoc reference, where its documentation had been left out.

Incompatible Changes

  • luaposix is built from the build table of its rockspec, by the luarocks-build-luke LuaRocks build backend, which LuaRocks installs for the build, so there is no build-aux/luke build to run, and no build without LuaRocks. The rock does not build LDocs, which luke release builds and commits.

  • The undocumented posix.deprecated module is gone, along with the legacy APIs it added to the posix module in place of the submodule functions of the same names, which were kept for compatibility with luaposix 32 and earlier. Calling one of them from the posix module raises an error naming its replacement:

    Removed Use instead
    bind posix.sys.socket.bind
    clock_getres posix.time.clock_getres
    clock_gettime posix.time.clock_gettime
    connect posix.sys.socket.connect
    exec posix.unistd.exec
    execp posix.unistd.execp
    fadvise posix.fcntl.posix_fadvise
    fnmatch posix.fnmatch.fnmatch
    getgroup posix.grp.getgrgid or posix.grp.getgrnam
    getpasswd posix.pwd.getpwuid or posix.pwd.getpwnam
    getpid posix.unistd.getpid
    getrlimit posix.sys.resource.getrlimit
    gettimeofday posix.sys.time.gettimeofday
    gmtime posix.time.gmtime
    hostid posix.unistd.gethostid
    isgraph posix.ctype.isgraph
    isprint posix.ctype.isprint
    localtime posix.time.localtime
    mktime posix.time.mktime
    nanosleep posix.time.nanosleep
    openlog posix.syslog.openlog
    pathconf posix.unistd.pathconf
    setrlimit posix.sys.resource.setrlimit
    stat posix.sys.stat.lstat
    statvfs posix.sys.statvfs.statvfs
    strftime posix.time.strftime
    strptime posix.time.strptime
    sysconf posix.unistd.sysconf
    times posix.sys.times.times
    uname posix.sys.utsname.uname

    The replacements take and return the POSIX structures, rather than selecting fields by name; luaposix 37.0 is the last release with the old APIs.

Bugs Fixed

  • posix.unistd.getopt accepts any number of arguments. Previously, an argument list longer than about 20 entries could overflow the Lua stack and corrupt memory, and more than 252 failed outright.

  • Installing a release rockspec no longer rebuilds the LDocs that the release already includes, so an installed ldoc that fails, as luarocks.org's does with Lua 5.5, no longer breaks the install.

Install it with LuaRocks, using:

luarocks install luaposix 38
Source: README.md, updated 2026-10-26