Skip to content

Releases: luaposix/luaposix

[ANN] luaposix 34.0.1 released

10 Jul 00:47
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.1 of luaposix. In addition to the usual bug fixes, this release uses the latest development version of luke, which fixes all of the known problems that caused luaposix-34.0 to be pulled down from luarocks.org.

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.1 (2017-07-09) [stable]

Bugs Fixed

  • posix.sys.socket works correctly on macOS again.

  • posix.sys.socket abstract namespaces work correctly on Linux.

  • posix.syslog.openlog keeps a copy of its ident parameter string in the Lua registry to ensure we don't hang on to a dangling pointer.

  • latest build-aux/luke and upgraded lukefile work correctly on macOS now.

Install it with LuaRocks, using:

luarocks install luaposix 34.0.1

[ANN] luaposix 34.0 released

07 May 01: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 of luaposix. The biggest change in this release is that luaposix no longer carries the weight of slingshot and Autotools, and consequently builds an order of magnitude faster.

There are some backwards incompatible changes in this release that you should pay careful attention to before you upgrade.

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 (2017-05-06) [stable]

Incompatible Changes

  • posix.syslog constants LOG_AUTHPRIV, LOG_FTP and LOG_SYSLOG are no longer documented, and only defined when supported by the host C library. They are not part of the POSIX API, and prevented compilation of luaposix on AIX and Solaris.

  • getopt.getopt was a binding to the GNU getopt_long extension, which is not a POSIX API, and prevents luaposix from compiling on hosts that do not provide the extended API. Instead we now correctly bind POSIX getopt(3) in posix.unistd.

    If you still have code that uses the old non-POSIX binding, then LuaRocks has the Lua only alt-getopt module which is very similar, and works even when the host C library has no getopt_long API; alternatively, you should consider migrating to the far more powerful Lua-only optparse library, also available from LuaRocks.

New Features

  • Replaced all Autotools and supporting Slingshot code with new Lua-based build-aux/luke and lukefile describing how to compile and install everything. Building with LuaRocks now leverages this too.

  • New posix.sys.socket.getsockopt and posix.sys.socket.getpeername bindings.

  • New posix.sys.msg.msgctl binding, and posix.sys.msg.IPC_RMID, posix.sys.msg.IPC_SET and posix.sys.msg.IPC_STAT constants to use with it.

  • New posix.unistd.ftruncate and posix.unistd.truncate bindings.

  • posix.fcntl.fcntl now accepts undocumented posix.fcntl.O_TMPFILE value where supported by the host C library.

Bugs Fixed

  • posix.unistd.ttyname now returns an error message in addition to nil when it fails.

Install it with LuaRocks, using:

luarocks install luaposix 34.0

[ANN] luaposix 33.4.0 released

27 Feb 14:46
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 33.4.0 of luaposix. The biggest change in this release is that luaposix no longer contains the curses bindings, which have moved back into lcurses, so that each can maintain their own release cycle. There are also fixes to most know bugs.

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

Noteworthy changes in release 33.4.0 (2016-02-27) [stable]

Incompatible Changes

  • posix.curses has been split back out into its own separate project again. If you want to upgrade your posix.curses using
    project, something like the following minimal change will wor equivalently (assuming you have the new lcurses on your package path):

    local posix = require 'posix'
    posix.curses = posix.curses or require 'lcurses'

New Features

  • New posix.stdio.rename binding.

  • New posix.fcntl.FD_CLOEXEC flag for posix.fcntl.fcntl.

  • New posix.fcntl.O_CLOEXEC flag for posix.fcntl.open, where supported by the underlying system. Falling back to FD_CLOEXEC is an exercise to the caller, so that non-atomicity is surfaced:

    -- without error checking, for clarity
    fd = fcntl.open ("/foo/bar", fcntl.O_CLOEXEC, stat.S_IRWXU)
    if fcntl.O_CLOEXEC == 0 then
     local flags = fcntl.fcntl (fd, fcntl.F_GETFD)
     fcntl.fcntl (fd, fcntl.F_SETFD, bit.bor (flags, fcntl.FD_CLOEXEC)
    end
  • New posix.unistd.tcgetpgrp and posix.unistd.tcsetpgrp bindings where supported by host C library.

  • posix.sys.socket AF_UNIX path handling improvements enable use of Linux only abstract namespace sockets.

  • Documentation links now point at the newer OpenGroup issue 7 specs.

Bugs Fixed

  • Workaround for https://sourceware.org/bugzilla/show_bug.cgi?id=15088. Predicate use of POSIX sched.h APIs on presence of sched.h, since glibc defines _POSIX_PRIORITY_SCHEDULING erroneously, and musl libc provides the sched.h APIs but doesn't define _POSIX_PRIORITY_SCHEDULING.
  • posix.sys.socket AF_UNIX APIs pass path arguments by length instead of terminating at the first \0 byte.
  • posix.unistd.readlink no longer fails when reading a link to an unsized buffer or character special device node.
  • execx is no longer leaked into the global namespace after loading the posix module.
  • examples/fork2.lua works correctly again.
  • posix.timeradd, posix.timercmp and posix.timersub correctly handle tables from the modern thin wrapper API (posix.sys.time), while retaining compatibility with the legacy compatibility wrappers (posix.gettimeofday).

Install it with LuaRocks, using:

luarocks install luaposix 33.4.0

[ANN] luaposix 33.3.1 released

01 Mar 18:33
Compare
Choose a tag to compare

A library binding various POSIX APIs, including curses. POSIX is the IEEE Portable Operating System Interface standard. luaposix is based on lposix and lcurses.

I am happy to announce release 33.3.1 of luaposix.

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

Noteworthy changes in release 33.3.1 (2015-03-01) [stable]

Incompatible Changes

  • The briefly lived posix.system API has been removed. It was renamed to posix.spawn shortly after introduction, and can still be accessed by the new symbol name.

Bugs Fixed

  • local posix = require "posix" works again, fixing the regression introduced in the last release. The automated Travis checks have been improved to catch this sort of bug in future.

Install it with LuaRocks, using:

luarocks install luaposix 33.3.1

[ANN] luaposix 33.3.0 released

28 Feb 10:47
Compare
Choose a tag to compare

A library binding various POSIX APIs, including curses. POSIX is the IEEE Portable Operating System Interface standard. luaposix is based on lposix and lcurses.

I am happy to announce release 33.3.0 of luaposix.

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

Noteworthy changes in release 33.3.0 (2015-02-28) [stable]

New Features

  • Improved documentation of sockaddr tables for posix.sys.socket calls.
  • New posix.sys.socket.getsockname binding.
  • Remove the posix.bit32 library, and use Lua’s built-in bit32 library.
  • Can now be linked against NetBSD curses, albeit with several functions not implemented by that library returning a "not implemented" error as a consequence.
  • New functions popen, popen_pipeline and pclose mimic the POSIX functions of the same name while allowing tasks to be Lua functions.
  • fdopen has been re-added, working on all supported Lua versions.
  • execx allows a Lua function or command to be exec’d; spawn is now implemented in terms of it.

Incompatible Changes

  • The ncurses-only KEY_MOUSE definition has been removed from
    posix.curses.

Bugs Fixed

  • posix.sys.resource only provides RLIM_SAVED_CUR and RLIM_SAVED_MAX if they are defined by the C library (which FreeBSD 10 does not).
  • posix.dirent.dir and posix.dirent.files now raise a Lua error() when unable to open the path argument, for orthogonality with io.lines.
  • Workaround for manifest key clash between posix.so and posix.lua in LuaRocks.

Install it with LuaRocks, using:

luarocks install luaposix 33.3.0

[ANN] luaposix 33.2.1 released

04 Jan 12:13
Compare
Choose a tag to compare

A library binding various POSIX APIs, including curses. POSIX is the IEEE Portable Operating System Interface standard. luaposix is based on lposix and lcurses.

I am happy to announce release 33.2.1 of luaposix.

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

Noteworthy changes in release 33.2.1 (2015-01-04) [stable]

Bugs Fixed

  • Install posix.curses.html documentation file correctly.

Install it with LuaRocks, using:

   luarocks install luaposix 33.2.1

[ANN] luaposix 33.2.0 released

04 Jan 12:05
Compare
Choose a tag to compare

A library binding various POSIX APIs, including curses. POSIX is the IEEE Portable Operating System Interface standard. luaposix is based on lposix and lcurses.

I am happy to announce release 33.2.0 of luaposix.

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

This release is focussed on improving portability; it supports Lua 5.3, eliminates the dependency on bit32 for LuaJIT and Lua 5.1, and builds out of the box on QNX. Along the way, many small incompatibilities and bugs have been fixed.

If you build from source rather than using LuaRocks, you will need the very latest releases of Specl and it's dependencies: everything is also available from my moonscript manifest here:

http://rocks.moonscript.org/modules/gvvaughan

Noteworthy changes in release 33.2.0 (2015-01-03) [stable]

New Features

  • QNX support.
  • Lua 5.3.0 support.

Bugs Fixed

  • posix.time.gmtime and posix.time.localtime specifications now work correctly in January too!

Noteworthy changes in release 33.1.0 (2014-12-19) [beta]

This was an unannouced beta release to help bootstrap my development stack with Lua 5.3.

New features:

  • New posix.bit32 module with band, bnot and bor functions that can be used from any supported Lua release, without worrying about loading an external bit operations library.
  • Preliminary Lua 5.3.0 compatibility.

Bug fixes:

  • No more 'Bad Hints' errors from posix.sys.socket.getaddrinfo on many hosts.
  • stdlib.setenv accepts a 3rd argument again.

Install it with LuaRocks, using:

   luarocks install luaposix 33.2.0

luaposix v33.0.0 released

04 Nov 16:43
Compare
Choose a tag to compare

Lua bindings for POSIX (including curses)

I am happy to announce release 33.0.0 of luaposix.

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

This release is large enough to qualify as a rewrite to all intents and purposes - curses is properly integrated; the posix API implementations have been minimised and reorganised into submodules according to the POSIX header file that declares them; the Spec coverage is an order of magnitude better; the LDocs have been redone, and on and on.

With this fresh start I'm adopting semantic versioning from here on out, with a plan to stick with 33 major for the forseeable future. I won't move to major 34 unless I break backwards compatibility, or undertake another rewrite... backwards compatible future releases will bump the second number, and fixes will bump the final number only.

Maintaining backwards compatibility with v32 was an important goal for this release, even though many of the uglier and inconsistent APIs have been deprecated and are no longer documented. If you have code that used to work with the last release, but not this one, please report it at http://github.com/luaposix/luaposix/issues.

Except: If you use luaposix by copying the posix.c source file into your own project, it's a feature that you now have to concatenate the source files you plan to use into your own custom posix.c (the distributed posix.c simply #include's every submodule), and then open each of the submodule libraries separately - I'll be happy to apply a patch that automates the process and/or generates a catch all luaopen_posix_c function that opens included submodules automatically.

Noteworthy changes in release 33.0.0 (2014-11-04) [stable]

New features:

  • The curses library is fully integrated into luaposix, including reasonably comprehensive LDoc documentation (certainly much better than the single wooly web-page in previous releases). For backwards compatibility, all APIs are re-exported from the curses module.

  • Most constants available through luaposix are now listed in the LDocs of the submodule that defines them.

  • For backwards compatibility, everything is still lumped together in the posix.??? namespace, but, now raw APIs have been reorganised according to the POSIX header files they belong to:

    local posix = require "posix"
    local fcntl = require "posix.fcntl"
    local unistd = require "posix.unistd"

    local fd = fcntl.open ("x",
    bit32.bor (posix.O_WRONLY, posix.O_CREAT), "u=rw")
    unistd.write (fd, "Hello, World!\n")
    unistd.close (fd)

    This makes the documentation easier to navigate, and for a better mapping between luaposix APIs and the C functions they wrap, so translating from C is now easier than ever.

  • Each of the newly separated submodules is self-contained, and can be copied to another project for compiling and/or loading in a custom Lua runtime. If you want to make use of this, in addition to the source for the modules you copy, you'll also need at least the files ext/posix/_helpers.c and ext/include/lua52compat.c, and also ext/include/strlcat.c for one or two of them.

  • Where submodule calls return a table representation of a similar C struct from a POSIX API, the Lua return tables have an appropriate _type field metatable entry compatible with lua-stdlib std.object.type.

  • posix.signal.signal now accepts the constants posix.signal.SIG_DFL or posix.signal.SIG_IGN in place of the strings "SIG_DFL" and "SIG_IGN".

  • The submodule bindings posix.time.gmtime, posix.time.localtime, posix.time.mktime, posix.time.strftime and posix.time.strptime now accept or create PosixTm tables with 1-to-1 field name mappings with the POSIX struct tm. The old APIs with custom field names is still available as posix.gmtime, posix.localtime, posix.mktime, posix.strftime and posix.strptime.

  • Similarly, posix.time.nanosleep now takes and returns a PosixTimespec table. The old API is still available as posix.nanosleep.

  • Where supported by the underlying system, posix.time.clock_getres and posix.time.clock_gettime now require a constant inte argument (newly defined in the posix.time submodule), and returns a PosixTimespec table. The old APIs are still available as posix.clock_getres and posix.clock_gettime.

  • Add posix.unistd.gethostid. The old posix.hostid API is still available as an alias.

  • Add group APIs from grp.h: posix.grp.endgrent, posix.grp.getgrent, posix.grp.getgrgid, posix.grp.getgrnam and posix.grp.setgrent. Consequently, posix.getgroup is now reimplemented in Lua over the POSIX APIs.

  • posix.getgroup defaults to current effective group when called with no arguments, for consistency with posix.getpasswd API.

  • Add pwd APIs from pwd.h: posix.pwd.endpwent, posix.grp.getpwent, posix.pwd.getpwnam, posix.pwd.getpwuid and posix.pwd.setpwent. Consequently, posix.getpasswd is now reimplemented in Lua over the POSIX APIs.

  • Add missing constants from sys/resource.h: posix.sys.resource.RLIM_INFINITY, posix.sys.resource.RLIM_SAVED_CUR, posix.sys.resource.RLIM_SAVED_MAX, posix.sys.resource.RLIMIT_CORE, posix.sys.resource.RLIMIT_CPU, posix.sys.resource.RLIMIT_DATA, posix.sys.resource.RLIMIT_FSIZE, posix.sys.resource.RLIMIT_NOFILE, posix.sys.resource.RLIMIT_STACK, posix.sys.resource.RLIMIT_AS.

  • Add missing APIs from unistd.h: posix.unistd.getegid, posix.unistd.geteuid, posix.unistd.getgid, posix.unistd.getuid, posix.unistd.getpgrp, posix.unistd.getpid, posix.unistd.getppid. Consequently, posix.getpid is now reimplemented in Lua over the POSIX APIs.

  • Add missing constants from signal.h; posix.signal.SIG_DFL and `posix.signal.SIG_IGN'.

  • Add missing APIs from sys/stat.h: posix.sys.stat.S_ISBLK, posix.sys.stat.S_ISCHR, posix.sys.stat.S_ISDIR, posix.sys.stat.S_ISFIFO, posix.sys.stat.S_ISLNK, posix.sys.stat.S_ISREG, posix.sys.stat.S_ISSOCK.

  • Add missing constants from sys/stat.h: posix.sys.stat.S_IFMT, posix.sys.stat.S_IFBLK, posix.sys.stat.S_IFCHR, posix.sys.stat.S_IFDIR, posix.sys.stat.S_IFIFO, posix.sys.stat.S_IFLNK, posix.sys.stat.S_IFREG, posix.sys.stat.S_IRWXU, posix.sys.stat.S_IRUSR, posix.sys.stat.S_IWUSR, posix.sys.stat.S_IXUSR, posix.sys.stat.S_IRWXG, posix.sys.stat.S_IRGRP, posix.sys.stat.S_IWGRP, posix.sys.stat.S_IXGRP, posix.sys.stat.S_IRWXO, posix.sys.stat.S_IROTH, posix.sys.stat.S_IWOTH, posix.sys.stat.S_IXOTH, posix.sys.stat.S_ISGID, posix.sys.stat.S_ISUID.

  • Add missing constants from syslog.h: posix.syslog.LOG_CONS, posix.syslog.LOG_NDELAY and posix.syslog.LOG_PID.

  • Add missing API from syslog.h: posix.syslog.LOG_MASK. Use this to convert syslog priority constants into mask bits suitable for bitwise ORing as the argument to posix.syslog.setlogmask.

  • Add missing constants from time.h: posix.time.CLOCK_MONOTONIC, posix.time.CLOCK_PROCESS_CPUTIME_ID, posix.time.CLOCK_REALTIME and posix.time.CLOCK_THREAD_CPUTIME_ID.

  • New posix.unistd.exec and posix.unistd.execp require a table of arguments, with [0] defaulting to the command name. The old string tuple passing API is still available as posix.exec and posix.execp.

  • posix.util.openpty has moved to posix.openpty. The old API is still available as an alias.

  • All posix APIs now fully and correctly diagnose extraneous and wrong type arguments with an error.

  • Add posix.IPC_NOWAIT, posix.MSG_EXCEPT and posix.MSG_NOERROR constants for message queues.

  • Add posix.IPPROTO_UDP for socket programming.

  • Add posix.AI_NUMERICSERV for posix.getaddrinfo hints flags.

  • Add posix.WUNTRACED for posix.wait flags.

  • Add curses.A_COLOR (where supported by the underlying curses library) for extracting color pair assignments from the results of curses.window.winch.

  • Add missing curses.KEY_F31 constant.

Bug fixes:

  • posix.fadvise is now spelled posix.fcntl.posix_fadvise and takes a file descriptor first argument rather than a Lua file handle. The old misspelled bad argument type version is undocumented but still works.
  • posix.getpasswd, posix.getpid, posix.pathconf, posix.stat, posix.statvfs, posix.sysconf and posix.times process a single table argument with a list of types correctly.
  • posix.syslog.openlog now takes the bitwise OR of those constants. The old string option specified API is still available as posix.openlog.
  • posix.syslog.setlogmask now takes the bitwise OR of bits returned by passing priority constants to posix.syslog.LOG_MASK. The old API will continue to be available as posix.setlogmask.
  • posix.readlink is much more robust, and reports errors accurately.
  • configured installation installs posix.so into the lua cpath directory correctly.
  • fixed a long-standing bug where the stdio buffers were not restored after some posix.fcntl() examples, resulting in the make check output being truncated -- often before terminal colors were returned to normal.

Install it with LuaRocks, using:

luarocks install luaposix 33.0.0

If the latest rocks are not yet available from the official repository,
you can install directly from the luaposix release branch, with:

$ luarocks install \
https://raw.githubusercontent.com/luaposix/luaposix/release-v33.0.0/luaposix-33.0.0-1.rockspec

luaposix 32 released

30 May 05:52
Compare
Choose a tag to compare

Lua bindings for POSIX (including curses)

I am happy to announce release 32 of luaposix.

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

Noteworthy changes in release 32 (2014-05-30) [stable]

New features:

  • Support for posix.socketpair call and posix.AF_UNIX constant.
  • Previously undocumented spawn, pipeline, pipeline_iterator, pipeline_slurp,
    euidaccess, timeradd, timercmp and timersub have been moved from the posix
    table, which is reserved for strictly POSIX APIs to the posix.sys subtable.
    The sys submodule automatically loads on first reference, so no need to
    require it manually if you already have the main posix module loaded.
  • posix api documentation is separated into groups for better discovery.

Bug fixes:

  • Builds correctly on hosts with no IPV6 capability.
  • Small improvements in organisation of generated html docs.
  • posix.openpty doesn't crash.
  • configure now detects Lua correctly with busybox grep.
  • Many fine portability fixes from latest gnulib.
  • Missing docs for accept, bind, connect, getaddrinfo, listen, recv,
    recvfrom, send, sendto, setsockopt, shutdown, socket and socketpair apis
    is now provided.
  • Missng docs for tcdrain, tcflow, tcflush, tcgetattr, tcsendbreak and
    tcsetattr terminal apis are now provided.
  • Docs for apis implemented in Lua are now shown correctly.

Install it with LuaRocks, using:

luarocks install luaposix 32

Until the rocks are available from the official repository in a few days,
you can install directly from the luaposix release branch, with:

$ luarocks install \
https://raw.githubusercontent.com/luaposix/luaposix/release-v32/luaposix-32-1.rockspec