Skip to content

Releases: luaposix/luaposix

[ANN] luaposix 36.2.1 released

17 Jun 04:13
Compare
Choose a tag to compare

A library binding various POSIX APIs. POSIX is the IEEE Portable Operating System Interface standard. luaposix is based on lposix.

I am happy to announce release 36.2.1 of luaposix.

If you have moved to the documented APIs, and don't rely on the Lua backwards compatibility layer or convenience functions, you can safely omit Lua module dependencies and use the C layer only.

luaposix's home page is at https://github.com/luaposix/luaposix/, with documentation at https://luaposix.github.io/luaposix.

Noteworthy changes in release 36.2.1 (2023-06-16) [stable]

Incompatible Changes

  • Using latest typecheck and specl rocks requires that our argument errors list all typenames in full ("integer" not "int") and unions in order ("nil or string" not "string or nil".

    All luaposix APIs now report argument type errors accordingly.

Bugs Fixed

  • posix.unistd.read and posix.sys.socket.recv no longer hide the underlying real error by casting a ssize_t result into an unsigned site_t local.

  • Fix a typo in the lflag argument name in the termios table LDocs.

  • posix.sys.* submodules are correctly preloaded into the module table returned by require 'posix' so that this undocumented, deprecated and slow way to access the functions therein continues to work for now:

    local posix = require 'posix'
    local stat  = posix.sys.stat.stat
    

    For new code, consider this fast and documented alternative, that does not load every available luaposix API from disk (especially if your project does not use APIs from every luaposix module):

    local stat  = require 'posix.sys.stat'.stat
    
  • Removed IUTF8 from the documented list of supported iflag values in posix.termios because it was previously unimplemented. Implemented non-portable support as an XSI extension, as it isn't a part of the POSIX standard.

Install it with LuaRocks, using:

luarocks install luaposix 36.2.1

[ANN] luaposix 36.1 released

31 Jan 23:08
Compare
Choose a tag to compare

A library binding various POSIX APIs. POSIX is the IEEE Portable Operating System Interface standard. luaposix is based on lposix.

I am happy to announce release 36.1 of luaposix.

If you have moved to the documented APIs, and don't rely on the Lua backwards compatibility layer or convenience functions, you can safely omit Lua module dependencies and use the C layer only.

luaposix's home page is at https://github.com/luaposix/luaposix/, with documentation at https://luaposix.github.io/luaposix.

Noteworthy changes in release 36.1 (2023-01-31) [stable]

Bugs Fixed

  • luke now uses the same cpp defines for conftests as will be used for module compilation, otherwise we are potentially testing and compiling with different sets of features.

  • tm.tm_gmtoff and tm.tm_zone are populated on Linux distros that require compiling with -D_BSD_SOURCE.

Install it with LuaRocks, using:

luarocks install luaposix 36.1

[ANN] luaposix 36.0 released

30 Jan 03:34
Compare
Choose a tag to compare

A library binding various POSIX APIs. POSIX is the IEEE Portable Operating System Interface standard. luaposix is based on lposix.

I am happy to announce release 36.0 of luaposix.

This is a pretty big release, and fixes all but a very few known bugs, the largest of which is that numbers requiring more than 32 bits are no longer downcast to C ints across binding boundaries, which makes most bindings work as expected for all but the largest arguments and return values. Of course the magnitude is still limited to the size of lua_Integer in the host Lua!

If you have moved to the new low-level APIs, and don't rely on the Lua backwards compatibility layer and convenience functions, you can safely omit those dependencies and use the C layer only.

luaposix's home page is at https://github.com/luaposix/luaposix/, with documentation at https://luaposix.github.io/luaposix.

Noteworthy changes in release 36.0 (2023-01-29) [stable]

Incompatible Changes

  • posix.spawn always returns integer, string whether fork fails immediately, or whatever waiting for the spawned process reports. When the second result value is "exited", the first is the exit status; for "killed" or "stopped" second value, the first is the signal number that caused it; otherwise first the errno error number, followed by the associated error string.

    The documentation for posix.spawn has always been wrong up until now, but this small change to simplify the returned results will require checking whether the second result value is "exited", "killed", "stopped" or any other string before interpreting the first result... which was also necessary in prior versions too, but now the interpretion of non-zero status by clients is less messy and somewhat compatible with the happy path of using previous releases.

  • Argument type errors for posix.sys.msg.msgctl, posix.sys.resource.setrlimit, posix.sys.socket.bind, posix.sys.socket.connect, posix.sys.socket.getaddrinfo, posix.sys.socket.sendto and posix.time.nanosleep all use "integer" in full rather than "int".

Bugs Fixed

  • luke no longer crashes in std.normalize require loops occasionally in Lua 5.4.

  • Don't leak err into global scope from compat.open

  • Correct LDoc comments for sys.resource.setrlimit.

  • Where an integer argument is expected, for consistency with Lua 5.2 and older, always allow 0.0 to be accepted as if 0 had been passed. For example: pwd.getpwuid(0.0).

  • require 'posix'.glob '.*' continues to invoke the backwards compatibility glob function, but that no longer prevents access to the preloaded require 'posix'.glob.glob binding.

  • The fcntl binding is still available from the top-level posix module as require 'posix'.fcntl, but that no longer prevents access to the preloaded require 'posix'.fcntl.fcntl binding.

  • poll.poll and poll.rpoll LDocs correctly describe the returned integer as being 0 for timeout or the number of ready file descriptors.

  • stdio.fdopen returned streams can be closed from Lua 5.1 without a NULL pointer dereference crash.

  • Both sys.resource.getrlimit and sys.resource.setrlimit properly roundtrip rlim_t values.

  • sys.socket.getpeername and sys.socket.getsockname now return a correctly filled sockaddr table. In case of an AF_UNIX socket, the returned path is now cropped to the correct length.

  • time constants are nil valued, even on hosts which fail to define them when _POSIX_TIMERS is set as if they should be.

  • time.gmtime and time.localtime no longer wrap around with arguments of 2^31 and larger.

  • time.gmtime and time.localtime propagate any tm_gmoffset and tm_zone fields supported by the host's struct tm.

  • time.strftime reliably fills %z and %Z specifiers. Note that if your host POSIX library provides a strftime that assumes the local timezone, %z will always print the local UTC offset, regardless of the tm_gmoffset field value passed in.

    Consider (subject to host strftime implementation!):

    local t = require 'posix.time'
    local now = t.time()
    local zulu_t = t.strftime("%c UTC+0000", t.gmtime(now)))
    local localt = t.strftime("%c %Z UTC%z", t.localtime(now)))
    
  • unistd.getcwd no longer leaks memory if __GNU__ was defined at compile time.

  • unistd.readlink works reliably inside a /proc filesystem.

  • unistd.write takes an optional third argument nbytes to conform better to the SUSv3 specification. For backwards compatibility, the entirety of buf is written when a third argument is not passed (or is nil).

  • Many bindings use now a lua_Integer (with at least 53 bits for magnitude, depending on the host Lua version) instead of a C int type to pass numeric arguments, so much larger values can be successfully passed to and from the following bindings: fcntl.open, posix.fcntl.posix_fadvise, fnmatch.fnmatch, posix.grp.getgrgid, pwd.getpwuid, sched.sched_getscheduler, sched.sched_setscheduler, signal.kill, signal.killpg, signal.raise, sys.msg.msgget, sys.msg.msgrcv, sys.socket.recv, sys.socket.recvfrom, sys.socket.setsockopt, sys.stat.S_ISBLK, sys.stat.S_ISCHR, sys.stat.S_ISDIR, sys.stat.S_ISFIFO, sys.stat.S_ISLNK, sys.stat.S_ISREG, sys.stat.S_ISSOCK, sys.stat.chmod, sys.stat.mkdir, sys.stat.mkfifo, sys.stat.umask, sys.wait.wait, syslog.LOG_MASK, time.mktime, unistd._exit, unistd.alarm, unistd.ftruncate, unistd.getegid, unistd.geteguid, unistd.getgid, unistd.getopt, unistd.getpgrp, unistd.getpid, unistd.getppid, unistd.getuid, unistd.gethostid, unistd.lseek, unistd.pathconf, unistd.read, unistd.setpid, unistd.sleep, unistd.sysconf,
    unistd.truncate, utime.utime.

  • Most of the spec examples run correctly on FreeBSD now!

New Features

  • unistd.write takes an optional fourth argument offset to allow efficent writing of a substring of buf. For backwards compatibility, the entirety of buf is written when the third and fourth arguments are not passed (or are nil).

  • When running in luajit, use luajit's internal bit functions instead of depending on the bit32 module being available.

Install it with LuaRocks, using:

luarocks install luaposix 36.0

[ANN] luaposix 35.1 released

10 Sep 01:04
Compare
Choose a tag to compare

A library binding various POSIX APIs. POSIX is the IEEE Portable Operating System Interface standard. luaposix is based on lposix.

I am happy to announce release 35.1 of luaposix.

If you have moved to the new low-level APIs, and don't rely on the Lua backwards compatibility layer and convenience functions, you can safely omit those dependencies and use the C layer only.

luaposix's home page is at https://github.com/luaposix/luaposix/, with documentation at https://luaposix.github.io/luaposix.

Noteworthy changes in release 35.1 (2021-09-09) [stable]

Bugs Fixed

  • Documentation cleanups: full and correct return docs including an
    errnum where necessary; make sure we have a link to SUSv3 wherever
    available; add an ', if successful' suffix to a normap return
    result followed by error return results; fixed several typos.

  • Update fork2.lua example to match current APIs

New Features

  • Support AF_PACKET socket family, where available.

  • Support SIGINFO, SIGWINCH and SA_RESTART, where available.

Install it with LuaRocks, using:

luarocks install luaposix 35.1

[ANN] luaposix 35.0 released

06 Jul 21:18
Compare
Choose a tag to compare

A library binding various POSIX APIs. POSIX is the IEEE Portable Operating System Interface standard. luaposix is based on lposix.

I am happy to announce release 35.0 of luaposix.

If you have moved to the new low-level APIs, and don't rely on the Lua backwards compatibility layer and convenience functions, you can safely omit those dependencies and use the C layer only.

luaposix's home page is at https://github.com/luaposix/luaposix/, with documentation at https://luaposix.github.io/luaposix.

Noteworthy changes in release 35.0 (2020-07-06) [stable]

Incompatible Changes

  • Internally, we use our own bitwise operation wrapper functions
    rather than bit32 where possible. This means bitwise operations
    when running under Lua 5.3+ work on 64bit integers.

Bugs Fixed

  • posix.deprecated.getrlimit and posix.deprecated.setrlimit pass
    tests again.

New Features

  • Initial support for Lua 5.4.

Install it with LuaRocks, using:

luarocks install luaposix 35.0

[ANN] luaposix 34.1.1 released

29 Jul 02:07
Compare
Choose a tag to compare

A library binding various POSIX APIs. POSIX is the IEEE Portable Operating System Interface standard. luaposix is based on lposix.

I am happy to announce release 34.1.1 of luaposix.

If you have moved to the new low-level APIs, and don't rely on the Lua backwards compatibility layer and convenience functions, you can safely omit those dependencies and use the C layer only.

luaposix's home page is at https://github.com/luaposix/luaposix/, with documentation at https://luaposix.github.io/luaposix.

Noteworthy changes in release 34.1.1 (2019-07-27) [stable]

Bugs Fixed

  • posix.compat really does work without std.normalize in the package.path now.

Install it with LuaRocks, using:

luarocks install luaposix 34.1.1

[ANN] luaposix 34.1 released

21 Jul 01:27
Compare
Choose a tag to compare

A library binding various POSIX APIs. POSIX is the IEEE Portable Operating System Interface standard. luaposix is based on lposix.

I am happy to announce release 34.1 of luaposix.

If you have moved to the new low-level APIs, and don't rely on the Lua backwards compatibility layer and convenience functions, you can safely omit those dependencies and use the C layer only.

luaposix's home page is at https://github.com/luaposix/luaposix/, with documentation at https://luaposix.github.io/luaposix.

Noteworthy changes in release 34.1 (2019-07-20) [stable]

Bugs Fixed

  • luke works with upgraded bootstrap luarocks version of require.

  • posix.glob.glob does not return a random errno on failure now, but
    new module constants GLOB_ABORTED, GLOB_NOMATCH or GLOB_NOSPACE.

  • posix.deprecated.clock_getres and posix.deprecated.clock_gettime work again.

New Features

  • posix.glob.glob supports now module constants as a second argument:
    GLOB_NOCHECK and GLOB_ERR.

  • posix.sys.socket now supports IPV6 link-local addresses.

  • use std.strict, std._debug and typecheck modules when available,
    otherwise behave normally without those additional runtime checks.

Install it with LuaRocks, using:

luarocks install luaposix 34.1

[ANN] luaposix 34.0.4 released

21 Feb 02:50
Compare
Choose a tag to compare

A library binding various POSIX APIs. POSIX is the IEEE Portable Operating System Interface standard. luaposix is based on lposix.

I am happy to announce release 34.0.4 of luaposix. This release fixes compatibility with macOS _POSIX_TIMERS macro, and some specl incompatibility for non-Linux hosts. If 34.0.2 and 34.0.3 do not fail immediately for you with require, then you don't need this fix and can skip this release.

If you have moved to the new low-level APIs, and don't rely on the Lua backwards compatibility layer and convenience functions, you can safely omit those dependencies and use the C layer only.

luaposix's home page is at https://github.com/luaposix/luaposix/, with documentation at https://luaposix.github.io/luaposix.

Noteworthy changes in release 34.0.4 (2018-02-20) [stable]

Bugs Fixed

  • posix.time.clock_getres, posix.time.clock_gettime posix.time.CLOCK_MONOTONIC, posix.time.CLOCK_REALTIME, posix.time.CLOCK_PROCESS_CPUTIME_ID and posix.time.CLOCK_THREAD_CPUTIME_ID are all properly elided on macOS again.

  • spec/spec_helper.lua now looks in the correct objdir for object modules built by luke, instead of hard-coding
    ./linux/?.so, so specl examples work on macOS and others again.

Install it with LuaRocks, using:

luarocks install luaposix 34.0.4

[ANN] luaposix 34.0.3 released

19 Feb 20:03
Compare
Choose a tag to compare

A library binding various POSIX APIs. POSIX is the IEEE Portable Operating System Interface standard. luaposix is based on lposix.

I am happy to announce release 34.0.3 of luaposix. This release fixes compatibility with macOS and other hosts with no implementation of posix_fadvise again. If 34.0.2 does not fail immediately when required for you, then you don't need this fix and can skip this release.

If you have moved to the new low-level APIs, and don't rely on the Lua backwards compatibility layer and convenience functions, you can safely omit those dependencies and use the C layer only.

luaposix's home page is at https://github.com/luaposix/luaposix/, with documentation at https://luaposix.github.io/luaposix.

Noteworthy changes in release 34.0.3 (2018-02-19) [stable]

Bugs Fixed

  • posix.deprecated.fadvise is properly elided on macOS and other hosts that have no posix.fcntl.posix_fadvise implementation.

Install it with LuaRocks, using:

luarocks install luaposix 34.0.3

[ANN] luaposix 34.0.2 released

18 Feb 06:58
Compare
Choose a tag to compare

A library binding various POSIX APIs. POSIX is the IEEE Portable Operating System Interface standard. luaposix is based on lposix.

I am happy to announce release 34.0.2 of luaposix. In addition to the some small bug fixes, this release is somewhat smaller now that it optionally uses https://github.com/gvvaughan/typecheck for consistent argument type errors in Lua functions instead of its own version of the same, and relies on https://github.com/lua-stdlib/normalize for easier portability of Lua code.

If you have moved to the new low-level APIs, and don't rely on the Lua backwards compatibility layer and convenience functions, you can safely omit those dependencies and use the C layer only.

luaposix's home page is at https://github.com/luaposix/luaposix/, with documentation at https://luaposix.github.io/luaposix.

Noteworthy changes in release 34.0.2 (2018-02-17) [stable]

Incompatible Changes

  • require 'posix' (or any of its submodules) always returns a populated module table, but no longer sets _G.posix or any other global symbol on Lua 5.1 (including LuaJIT). If you were relying on this behaviour, please change your require statements to an assignment:
local posix = require 'posix'                                    

Bugs Fixed

  • posix.sys.wait.wait returns <childpid>, "running" when the child has not exited yet, and wait was called with WNOHANG set.

  • specs don't fail on valid -1 return values from posix.sysconf.

  • loading posix (or any of its submodules) no longer leaks symbols into the global namespace on Lua 5.1 (including LuaJIT).

Install it with LuaRocks, using:

luarocks install luaposix 34.0.2