2015-03-01 Gary V. Vaughan Release version 33.3.1 * NEWS.md: Record release date. configury: bump release version to 33.3.1. * configure.ac (AC_INIT): Bump release version to 33.3.1. * .travis.yml: Regenerate. posix: fix a stupid cherry pick edit typo. * lib/posix.lua.in (popen_pipeline): Add comma after close. 2015-03-01 Reuben Thomas posix: add missing locals before pclose and popen_pipeline. * lib/posix.lua.in (pclose, popen_pipeline): Make sure to import API module table entries into locals for easier refactoring if these functions are moved in a future revision. posix: remove ability to pass a simple string to execx. * specs/posix_spec.yaml (execx, spawn, popen): Adjust to exercise new behaviours with no special support for string arguments. * lib/posix.lua.in (execx, spawn, popen): Remove special support for string arguments. posix: remove obsolete `posix.system` alias. * lib/posix.lua.in (system): Remove. * NEWS.md (Incompatible Changes): Update. 2015-03-01 Gary V. Vaughan specs: installcheck setup. To prevent a repeat of the unloadable 33.3.0 release, set up specs so that latest slingshot will rerun the specs against both configure and luarocks installed luaposix. * specs/posix_spec.yaml (posix.version): Move from here... * specs/posix_version_spec.yaml (version): ...to here. * specs/specs.mk (specl_SPECS): Add specs/posix_version_spec.yaml. * specs/spec_helper.lua: Check for installcheck in the environment before tweaking Lua paths to point at build tree. slingshot: sync with upstream, for installcheck support. * slingshot: Sync with upstream. * .travis.yml: Regenerate. 2015-02-28 Reuben Thomas local.mk: install posix/init.lua under posix 2015-02-28 Gary V. Vaughan maint: post-release administrivia. * NEWS: Add header line for next release. * .prev-version: Record previous version. * ./local.mk (old_NEWS_hash): Auto-update. Release version 33.3.0 * NEWS.md: Record release date. configury: bump release version to 33.3.0. * configure.ac (AC_INIT): Bump release version to 33.3.0. * .travis.yml: Regenerate. * NEWS.md: Fix a small typo. maint: update .gitignore. * .gitignore: add lib/posix/init.lua. maint: workaround LuaRocks install manifest key clash. LuaRocks install manifest cannot store two files with the same key. * configure.ac (AC_CONFIG_FILES): Expand lib/posix.lua.in to lib/posix/init.lua for installation. * build-aux/config.ld.in (file): Adjust accordingly. * local.mk (dist_lua_DATA): Likewise. * NEWS.md (Bugs Fixed): Update. Workaround suggested by quae@daurnimator.com configury: don't forget to distribute compat-5.2.{c,h}. * local.mk (EXTRA_DIST): Add ext/include/compat-5.2.c and ext/include/compat-5.2.h. 2015-02-28 Reuben Thomas rockspec.conf: remove bogus constraint on bit32 version 2015-02-28 Gary V. Vaughan slingshot: sync with upstream for distcheck fixes. * slingshot: Sync with upstream again. 2015-02-27 Gary V. Vaughan slingshot: Sync with upstream for Travis Lua 5.3 build fixes. * slingshot: Sync with upstream. * .travis.yml: Regenerate. maint: exclude compat-5.2 sources from assorted syntax checks. * build-aux/sanity-cfg.mk (exclude_file_name_regexp--sc_require_config_h) (exclude_file_name_regexp--sc_require_config_h_first) (exclude_file_name_regexp--sc_useless_cpp_parens): Add ext/include/compat-5.2.c. (exclude_file_name_regexp--sc_useless_cpp_parens): Add ext/include/compat-5.2.h. * ext/include/compat-5.2.c, ext/include/compat-5.2.h: Remove trailing empty lines. maint: don't trigger error-message-uppercase in stdlib.c. * build-aux/sanity-cfg.mk (exclude_file_name_regexp--sc_error_message_uppercase): Add ext/posix/stdlib.c. specs: expect portable wc command output format. BSD and Mac OS X `wc` indent the output from `wc`. * specs/posix_spec.yaml (popen_pipeline): Allow leading whitespace in wc output. slingshot: sync with upstream, for --libdir fix. Close #210 * slingshot: Sync with upstream. 2015-02-27 Reuben Thomas Merge pull request #213 from luaposix/remove-pipeline Remove pipeline NEWS.md: add recent changes posix: remove pipline, pipeline_iterator and pipeline_slurp These functions were experimental and only briefly documented. They are replaced by the popen family. NEWS.md: fix some formatting 2015-02-26 Reuben Thomas posix: add popen, popen_pipeline, and execx. * specs/posix_spec.yaml (popen, popen_pipeline): Specify correct behaviours for these new functions. * lib/posix.lua.in (popen, popen_pipeline, execx): New functions. 2015-02-26 Gary V. Vaughan Merge pull request #211 from luaposix/fdopen Fdopen 2015-02-25 Reuben Thomas Merge pull request #206 from luaposix/remove-builtin-bit32 build: remove posix.bit32 2015-02-21 Reuben Thomas Add fdopen Uses luaL_Stream; we rely on compat-lua-5.2 to make this work on Lua 5.1 and LuaJIT. 2015-02-19 Reuben Thomas Build Lua 5.3 with 5.2 compatibility Needs -DLUA_COMPAT_5_2, just as 5.2 needs -DLUA_COMPAT_ALL Build Lua 5.3 with 5.2 compatibility Needs -DLUA_COMPAT_5_2, just as 5.2 needs -DLUA_COMPAT_ALL build: remove posix.bit32 Close #204 again, removing posix.bit32 in favour of a rockspec dependency, which will use the built-in library in Lua >= 5.2, or the backported rock in Lua 5.1 2015-02-17 Gary V. Vaughan Merge branch 'sparked435-master' curses: support linking against NetBSD curses. * ext/include/_helpers.c (LPOSIX_CURSES_COMPLIANT): Leave this unset on NetBSD, unless linked against ncurses. (binding_notimplemented): New function for returning a `nil`, "not implemented" error pair from an unbound function... * ext/posix/stdlib.c (mkdtemp): ...factored out of here. Adjust accordingly. * ext/posix/curses.c (Presizeterm): Use it here too. (Pripoffline, Pslk_init, Pslk_refresh, Pslk_noutrefresh) (Pslk_label, pslk_clear, Pslk_restore, Pslk_touch) (Pslk_attron, Pslk_attroff, Pslk_attrset): Use it here When LPOSIX_CURSES_COMPLIANT is not set. * ext/posix/curses/window.c (Wsyncok, Wimmedok): Likewise. * NEWS.md (New Features): Update. 2015-02-17 aaron Workarounds for missing NetBSD curses functions. 2015-02-16 Gary V. Vaughan curses: remove unusable KEY_MOUSE constant. * ext/posix/curses.c (register_curses_constants): Comment out KEY_MOUSE, along with a comment to remind us not to reintroduce it again later! * NEWS.md (Incompatible Changes): Update. dirent: throw a Lua error when called with non-existent path. Close #207. * specs/posix_dirent_spec.yaml: New file. Specify correct behaviours, paying special attention to throwing an error when called with a non-existent path. * specs/specs.mk (specl_SPECS): Add specs/posix_dirent_spec.yaml. * ext/posix/dirent.c (Pdir): Check for errors when opening path argument, and throw an error if necessary. (pfiles): Likewise. * examples/dir.lua: Adjust accordingly. * NEWS.md (Bugs Fixed): Update. Reported by Ingo Struck 2015-02-11 Gary V. Vaughan doc: rationale for posix.bit32 inclusion. Close #204 * ext/posix/bit32.c: Add LDocs to explain why we have yet another bit twiddling functions module here in luaposix. Merge branch 'zevv-getsockname' 2015-02-11 Gary V. Vaughan Merge branch 'getsockname' of https://github.com/zevv/luaposix into zevv-getsockname * specs/posix_sys_socket_spec.yaml (getsockname): Specify bad argument behaviours minimally. * ext/posix/sys/socket.c (getsockname): Port forward to latest helpers and conventions. Fix LDocs. * examples/socket.lua: Port forward additional getsockname call. * NEWS.md (New features): Update. Conflicts: examples/socket.lua ext/posix/posix.c 2015-02-11 Ico Doornekamp Added getsockname() to examples/socket.lua Added getsockname 2015-01-31 Gary V. Vaughan signal: workaround a printf long vs int type coercion issue. * ext/posix/signal.c (sig_handle): Some architectures use a long for sig_atomic_t, so we need a %ld specifier to display it without a warning. In case sig_atomic_t is narrower than a long, cast it up before passing to fprintf. sys.socket: move sys/types.h include earlier. * ext/posix/sys/socket.c: netinet/udp.h complains about lack of u_short definition on FreeBSD 10, so move sys/types.h before it in the hope of fixing that. Reported by jeangit@github. sys.resource: add ifdef guards to RLIM_SAVED_CUR and RLIM_SAVED_MAX. * ext/posix/sys/resource.c (luaopen_posix_sys_resource): Add ifdef guards around RLIM_SAVED_CUR and RLIM_SAVED_MAX declarations, because FreeBSD 10 does not provide them. Reported by jeangit@github. 2015-01-20 Reuben Thomas posix.lua: use error, not die; fixes #201 2015-01-19 Gary V. Vaughan doc: improve LDocs for sys.socket sockaddr tables. Closes #200 * ext/posix/sys/socket.c (sockaddr): Document all optional fields. * NEWS.md: Update. Reported by Bernd Eggink slingshot: sync with upstream for lua 5.3.0 final support. * slingshot: Sync with upstream. * .travis.yml: Regenerate. 2015-01-18 Reuben Thomas Make posix.pipeline_slurp more efficient Use standard table.concat method instead of repeated string concatenation. 2015-01-04 Gary V. Vaughan maint: post-release administrivia. * NEWS: Add header line for next release. * .prev-version: Record previous version. * ./local.mk (old_NEWS_hash): Auto-update. Release version 33.2.1 * NEWS.md: Record release date. configury: distribute posix.curses.html correctly. * local.mk (dist_modules_DATA): Add posix.curses.html. * configure.ac (AC_INIT): Bump release version to 33.2.1. * .travis.yml: Regenerate. * NEWS.md: Update. Reported by Ulrich Schmidt 2015-01-03 Gary V. Vaughan maint: post-release administrivia. * NEWS: Add header line for next release. * .prev-version: Record previous version. * ./local.mk (old_NEWS_hash): Auto-update. Release version 33.2.0 * NEWS.md: Record release date. specs: accept '?' as function name in Lua bad argument errors. LuaJIT in particular often fails to find the name of a function, so we must accept '?' when checking error message contents. * specs/spec_helper.lua (typeerrors): Call badargs.format twice, and return a table of results. (init): Use typerrors wrapper. * specs/posix_compat_spec.yaml, specs/posix_deprecated_spec.yaml, specs/posix_spec.yaml, specs/posix_sys_resource_spec.yaml, specs/posix_sys_socket_spec.yaml, specs/posix_time_spec.yaml: Use spec_helper.lua:init, or manually create a list of error messages including returned function name, or "?" when that could not be found, e.g. by LuaJIT. 2015-01-02 Gary V. Vaughan configury: bump release version to 33.2.0. * configure.ac (AC_INIT): Bump release version to 33.2.0. * .travis.yml: Regenerate. maint: adjust indentation for github markdown multi-para bullets. * NEWS.md: Adjust indentation so that multi-paragram bullet points are correctly rendered by github markdown. specs: fix off by one error in localtime and gmtime examples. * specs/posix_time_spec.yaml (gmtime, localtime): Fix expectation range to fit (correct) description. * NEWS.md: Update. gnulib: sync with upstream. maint: commit git rockspec to master branch. * .gitignore: Allow git rockspecs. * luaposix-git-1.rockspec: New file. configury: add ansicolors to travis_extra_rocks. * bootstrap.conf (buildreq): Reference Specl 14.0.0 with correct version number. (travis_extra_rocks): Add ansicolors for color specl outpet. * .travis.yml: Regenerate. 2015-01-01 Gary V. Vaughan maint: add 5.3 to compatiblity statement in files' preamble. * ext/include/_helpers.c, ext/posix/bit32.c, ext/posix/ctype.c, ext/posix/curses.c, ext/posix/curses/chstr.c, ext/posix/curses/window.c, ext/posix/dirent.c, ext/posix/errno.c, ext/posix/fcntl.c, ext/posix/fnmatch.c, ext/posix/getopt.c, ext/posix/glob.c, ext/posix/grp.c, ext/posix/libgen.c, ext/posix/poll.c, ext/posix/posix.c, ext/posix/pwd.c, ext/posix/sched.c, ext/posix/signal.c, ext/posix/stdio.c, ext/posix/stdlib.c, ext/posix/sys/msg.c, ext/posix/sys/resource.c, ext/posix/sys/socket.c, ext/posix/sys/stat.c, ext/posix/sys/statvfs.c, ext/posix/sys/time.c, ext/posix/sys/times.c, ext/posix/sys/utsname.c, ext/posix/sys/wait.c, ext/posix/syslog.c, ext/posix/termio.c, ext/posix/time.c, ext/posix/unistd.c, ext/posix/utime.c, lib/posix.lua.in, lib/posix/_argcheck.lua, lib/posix/compat.lua, lib/posix/deprecated.lua, lib/posix/util.lua: Add 5.3 to compatibility statement in files' preamble. maint: update copyrights. * COPYING, bootstrap.conf, configure.ac, ext/include/_helpers.c, ext/posix/bit32.c, ext/posix/ctype.c, ext/posix/curses.c, ext/posix/curses/chstr.c, ext/posix/curses/window.c, ext/posix/dirent.c, ext/posix/errno.c, ext/posix/fcntl.c, ext/posix/fnmatch.c, ext/posix/getopt.c, ext/posix/glob.c, ext/posix/grp.c, ext/posix/libgen.c, ext/posix/poll.c, ext/posix/posix.c, ext/posix/pwd.c, ext/posix/sched.c, ext/posix/signal.c, ext/posix/stdio.c, ext/posix/stdlib.c, ext/posix/sys/msg.c, ext/posix/sys/resource.c, ext/posix/sys/socket.c, ext/posix/sys/stat.c, ext/posix/sys/statvfs.c, ext/posix/sys/time.c, ext/posix/sys/times.c, ext/posix/sys/utsname.c, ext/posix/sys/wait.c, ext/posix/syslog.c, ext/posix/termio.c, ext/posix/time.c, ext/posix/unistd.c, ext/posix/utime.c, lib/posix.lua.in, lib/posix/_argcheck.lua, lib/posix/compat.lua, lib/posix/deprecated.lua, lib/posix/util.lua, local.mk: Add 2015 to copyright statement. rockspec: Lua 5.4 and higher not yet supported. * rockspec.conf (dependencies): Add lua < 5.4 constraint. maint: use correct Specl >= 14 arity for bad argument errors. Now that Specl's badargs module is generating examples with the correct messages, we can now say 'no more than 0 arguments'. * ext/include/_helpers.c (checknargs): Return singular 'argument' in error message only for exactly 1 expected argument, otherwise plural. slingshot: sync with upstream. * slingshot: Sync with upstream. * bootstrap: Update from slingshot. * configure.ac: Remove SS_CONFIG_TRAVIS invocation. Move extra rocks from here... * bootstrap.conf (travis_extra_rocks): ...to here. (require_bootstrap_uptodate): Remove. * .gitignore: Remove slingshot.m4. 2014-12-22 Gary V. Vaughan configury: enable mkdtemp on _XOPEN_SOURCE incompatible hosts. * configure.ac (POSIX_EXTRA_CPPFLAGS) : Add -DLPOSIX_2008_COMPLIANT instead of -D_XOPENSOURCE=700. * ext/include/_helpers (LPOSIX_2008_COMPLIANT): When manually defined, also ensure LPOSIX_2001_COMPLIANT is defined. 2014-12-19 Gary V. Vaughan maint: use table.unpack over unpack for 5.3.0 compatibility. Lua 5.3 has table.unpack but not _G.unpack; Lua 5.2 has table.unpack and _G.unpack; Lua 5.1 has _G.unpack but not table.unpack * lib/posix.lua.in (unpack): Use table.unpack over unpack, to work on all three! * lib/posix/deprecated.lua (unpack): Likewise. maint: add missing NEWS. * NEWS: Note recent QNX support. stdlib: mkdtemp returns an error on substandard hosts. * ext/posix/stdlib.c (mkdtemp): Move POSIX compliance guards inside the function definition, with an alternate function body that returns an error when there is no mkdtemp in the C library. (posix_stdlib_fns): Remove POSIX compliance guard from mkdtemp. maint: detect POSIX 2001 or POSIX 2008 compliance. Close #197. * configure.ac: Reformat comments. Pass LPOSIX_2001_COMPLIANT directly to cpp on QNX. * ext/include/_helpers.c (LPOSIX_2008_COMPLIANT): Enable only if _POSIX_C_SOURCE or _XOPEN_SOURCE are set appropriately. (LPOSIX_2001_COMPLIANT): Add _XOPEN_SOURCE >= 600 condition. * ext/posix/stdlib.c (Pmkdtemp): Disable this function unless LPOSIX_2008_COMPLIANT is defined. Reported by James Harris maint: post-release administrivia. * NEWS: Add header line for next release. * .prev-version: Record previous version. * ./local.mk (old_NEWS_hash): Auto-update. Release version 33.1.0 * NEWS.md: Record release date. specs: adjust setrlimit error message expectations. * specs/posix_sys_resource_spec.yaml (setrlimit): Adjust error messages to reflect recent int->number table field type changes. slingshot: sync with upstream, for Lua 5.3.0 improvements. * slingshot: Sync with upstream. * bootstrap: Update from slingshot. * NEWS: Move from here... * NEWS.md: ...to here. Convert to Markdown format. * .gitignore: Add NEWS. * local.mk (old_NEWS_hash): Regenerate. (luaexec_LTLIBRARIES): Change from assigment to appending. * .travis.yml: Regenerate. 2014-12-18 Gary V. Vaughan resources: don't truncate rlim structure field values. With f8d8939 we were too zealous with changing all internal types from lua_Number (et. al) to lua_Integer (et. al), where lua_Integer is not wide enough to contain an rlim_t. * ext/include/_helpers (checknumberfield, pushnumberfield) (setnumberfield): New function and macros equivalent to the earlier implementations of checkintegerfield, pushintegerfield and setintegerfield respectively. * ext/posix/sys/resource.c (pushrlimit): Set PosixRlimit table entries with setnumberfield. (setrlimit): Extract PosixRlimit fields with checknumberfield. * specs/posix_sys_resource_spec.yaml (setrlimit): Remove spurious braces. posix: fix bad argument errors for spawn. * specs/posix_spec.yaml (spawn): Uncomment badargs diagnosis. * lib/posix.lua.in (M.spawn): Fix argument type error message for nil-valued argument 2. 2014-12-17 Gary V. Vaughan sys.socket: support OpenBSD 5.6. Close #182. * ext/posix/sys/socket.c: Change the order of inclusion of some headers to satisfy OpenBSD 5.6. 2014-12-17 Reuben Thomas Fix argument checks for spawn and add specs 2014-12-17 Gary V. Vaughan sys.msg: only enable SysV messaging where it is supported. * configure.ac (AC_CHECK_HEADER): Add sys/msg.h. (AC_CHECK_FUNCS): Add msgrcv, msgsend. (HAVE_SYSV_MESSAGING): Define if the above are all present. * ext/posix/sys/msg.c (LPOSIX_2001_COMPLIANT): Change from using this... (HAVE_SYSV_MESSAGING): ...to this. configury: reformat AC_CHECK_FUNCS to discourage adding more! * configure.ac: Reformat. 2014-12-17 James Harris configury: no _XOPEN_SOURCE on QNX. * configure.ac (POSIX_EXTRA_CPPFLAGS): Don't add _XOPEN_SOURCE on QNX either. socket: guard AI_ADDRCONFIG definition. * ext/posix/sys/socket.c (luaopen_posix_sys_socket): For machines that don't define AI_ADDRCONFIG, wrap the binding in a CPP guard. unistd: stub gethostid for POSIX implementations that dropped it. * configure.ac (AC_CHECK_FUNCS): Add gethostid. * ext/posix/unistd.c (Pgethostid): If there is no gethostid on this host, return an error rather than trying to call it. configury: support separate libsocket. * configure.ac (LIBSOCKET): Check for a socket funtion carrying socket library. * local.mk (ext_posix_posix_la_LDFLAGS): Add $(LIBSOCKET). curses: fix compilation errors when host has no curses library. * ext/posix/curses/chstr.c: Adjust #ifdef HAVE_CURSES to make sure there's an emptyg posix_curses_chstr_fns definition. * ext/posix/curses/window.c: Likewise for posix_curses_windows_fns. * ext/posix/curses.h: Likewise for curseslib. Also move #includes for the above files out of the HAVE_CURSES guard. 2014-12-17 Gary V. Vaughan maint: add Lua 5.3 to README.md. * README.md: Add Lua 5.3 reference. slingshot: sync with upstream, for travis ownership fixes. * slingshot: Sync with uptstream. * .travis.yml: Regenerate. travis: debug check-local failure. * .travis.yml (script): Debug check-local failure. slingshot: sync with upstream, for Lua 5.3.x support. * slingshot: Sync with upstream. * .travis.yml: Regenerate. configury: bump release number to 33.1.0. * configure.ac (AC_INIT): Bump release number to 33.1.0. specs: move stdlib function specs to their own spec-file. * specs/posix_spec.yaml (abort, getenv, grantpt, mkdtemp, mkstemp) (openpt, ptsname, realpath, unlockpt, setenv): Move from here... * specs/posix_stdlib_spec.yaml (abort, getenv, grantpt, mkdtemp) (mkstemp, openpt, ptsname, realpath, unlockpt, setenv): New file. ...to here. * specs/specs.mk (specl_SPECS): Add specs/posix_stdlib_spec.yaml. doc: cross reference umask and sys.stat.umask. * ext/posix/sys/stat.c (umask): Reference posix.umask. * lib/posix/compat.lua (umask): Reference posix.sys.stat.umask. 2014-12-16 Gary V. Vaughan maint: support 5.3.0 integers correctly. Many integer fields and values were incorrectly becoming `.0` suffixed floats in Lua 5.3.0. * ext/include/_helpers.c (lua_isinteger): Define to lua_isnumber with pre-5.3.0 Lua headers. (checkinteger): Use it. (checkch): Use checkint over luaL_checknumber. (checkintegerfield): Use lua_pushinteger over lua_pushnumber. (pushnumberfield, setnumberfield): Rename from these... (pushintegerfield, setintegerfield): ...to these, and adjust to work with Integer subtypes in Lua 5.3.0. * ext/posix/curses.c (Punctrl): Use checkch over luaL_checknumber. * ext/posix/grp (pushgroup): Set gr_gid field as an integer. * ext/posix/poll.c (poll_fd_list_check_table): Use lua_isinteger for argument check. * ext/posix/pwd.c (pushpasswd): Use setintegerfield for pw_uid and pwd_gid fields. * ext/posix/sys/resource.c (pushrlimit): Use setintegerfield for rlim_cur and rlim_max fields. * ext/posix/sys/socket.c (pushsockaddrinfo): Use pushintegerfield for family, port, pid and groups fields. (Pgetaddrinfo): Use pushintegerfield for socktype and protocol fields. * ext/posix/sys/stat.c (pushstat): Use setintegerfield for all fields. * ext/posix/sys/statvfs.c (pushstatvfs): Use setintegerfield for all fields. * ext/posix/sys/time.c (pushtimeval): Use setintegerfield for tv_sec and tv_usec fields. * ext/posix/sys/times.c (pushtimefield): Use pushintegerfield. * ext/posix/termio.c (Ptcgetattr): Use pushintegerfield for iflag, oflag, lflag, cflag and cc fields. * ext/posix/time.c (pushtimespec): Use setintegerfield for tv_sec and tv_nsec fields. (pushtm): Use setintegerfield for all fields. * ext/posix/unistd.c (mygetuid. mygetgid): Use lua_isinteger and lua_tointeger for argument checking. * NEWS: Update. stdlib: accept optional 3rd argument to setenv. Close #185. * ext/posix/stdlib.c (Psetenv): Allow optional 3rd argument again. * NEWS: Update. maint: remove unused luaexec_LDFLAGS macro. Silence an Automake warning about unused luaexec_LDFLAGS. * local.mk (luaexec_LDFLAGS): Remove. slingshot: sync with upstream, for git submodule fixes. Latest slingshot bootstrap passes arguments to 'git submodule init' correctly. * slingshot: Sync with upstream. * bootstrap: Update from slingshot. * .travis.yml: Regenerate. specs: specify localtime and gmtime month values correctly. * specs/posix_time_spec.yaml (gmtime, localtime): Add a specification for December epoch returning month 11. Fix description of month range to be 0-11. * specs/posix_compat_spec.yaml (gmtime, localtime): Add a specification for December epoch returning month 12. Fix description of month range to be 1-12. Fix specification to check month range 1-12. 2014-12-16 Reuben Thomas Fix #187 Fix #189 2014-11-06 Gary V. Vaughan deprecated: handle nonexistent files gracefully. * lib/posix/deprecated (stat, statvfs): If the underlying C API call does not return a table, simply return nil instead of calling doselection. sys.socket: initialize hints with zeros. * ext/posix/sys/socket.c (Pgetaddrinfo): It's not safe to rely on field values in uninitialised automatic struct addrinfo declaration. Use memset to overwrite garbage. * NEWS: Update. maint: support _POSIX_C_SOURCE in lieu of _POSIX_VERSION. On OpenBSD 5.6, _POSIX_VERSION is set to just 199009L by default, and messing with _XOPEN_SOURCE or setting _POSIX_VERSION directly changes the C library header declarations. It seems that _POSIX_C_SOURCE is defined to 200112L by default, indicating that the newer functions luaposix wants to bind to really are available. * configure.ac (POSIX_EXTRA_CPPFLAGS): Elide _XOPEN_SOURCE definition on OpenBSD. * ext/include/_helpers.c (LPOSIX_2001_COMPLIANT): New preprocessor symbol, defined when either _POSIX_VERSION or _POSIX_C_SOURCE are bigger than 200112L. * ext/posix/stdlib.c, ext/posix/sys/msg.c, ext/posix/sys/socket.c, ext/posix/sys/times.c, ext/posix/syslog.c, ext/posix/unistd.c: Predicate on new LPOSIX_2001_COMPLIANT definition instead of _POSIX_VERSION. sys.socket: make some more preprocessor constants conditional. * ext/posix/sys/socket.c (AI_ALL, AI_V4MAPPED): Add preprocessor guards, as these two are not defined on at least OpenBSD 5.6. configury: propagate _XOPEN_SOURCE cpp defines fully. * configure.ac (POSIX_EXTRA_CFLAGS): A misnomer... (POSIX_EXTRA_CPPFLAGS): ...better named like this. * local.mk (AM_CPPFLAGS): Add POSIX_EXTRA_CPPFLAGS, so addition preprocessor definitions reach submodule compilation too. (ext_posix_posix_la_CFLAGS): Remove. 2014-11-05 Gary V. Vaughan doc: use OpenGroup SUSv3 urls for manual page links. * build-aux/config.ld.in (custom_see_handler): Send manual page links to OpenGroup SUSv3 specifications instead of kernel.org. maint: update README. * README.md: Update some bitrot. configury: add sys/socket.h to other socket header checks. The net/if.h check fails on at least OpenBSD 5.6 without this patch. * configure.ac (AC_CHECK_HEADERS): Add sys/socket.h to default headers when checking for net/if.h and linux/netlink.h. configury: set LIBRT only if it is required for clock_gettime. * configure.ac (LIBRT): Extract from != Darwin guard and set to -lrt if that is required for clock_gettime to work. (POSIX_EXTRA_CFLAGS): Move up to compiler flag setting section. (AC_CHECK_FUNCS): Move out of library checking section. sys.resource: provide RLIMIT_AS fallback for OpenBSD 5.6. * ext/posix/sys/resource.c (RLIMIT_AS): Fallback to RLIMIT_DATA if not otherwise defined. maint: preliminary Lua 5.3.0-beta compatibility. Close #181. * configure.ac (AX_PROG_LUA): Accept Lua 5.3 interpreters. * ext/include/lua52compat.h: Remove. * local.mk (EXTRA_DIST): Adjust accordingly. * ext/include/_helpers.c (lua_objlen, lua_strlen, luaL_openlib) (luaL_register): Lua 5.2 and 5.3 compatibility definitions. * ext/posix/sched.c, ext/posix/termio.c: Use luaposix optint() rather than deprecated luaL_optint(). * NEWS: Update. bit32: remove remaining `require "bit"` invocations. * lib/posix.lua.in: require "posix.bit32" unconditionally. * specs/posix_unistd_spec.yaml: Likewise. maint: remove dependency on luabitop. * specs/spec_helper.lua (bit): Fallback on posix.bit32 if there is no native bit32 module. * lib/posix/compat.lua, lib/posix/deprecated.lua: Use posix.bit32 unconditionally. * rockspec.conf (dependencies): Remove luabitop. bit32: fetch uint32_t definition from stdint.h. * ext/posix/bit32.c: include stdint.h instead of sys/types.h. bit32: new module for lua5.1 compatibility. * specs/posix_bit32_spec.yaml: Specify behaviours of band, bnot and bor. * specs/specs.mk (specl_SPECS): Add posix_bit32_spec.yaml. * ext/posix/bit32.c: New module implementing band, bnot and bor. * ext/posix/posix.c: #include bit32.c. * build-aux/config.ld.in (file): Add ext/posix/bit32.c. * local.mk (EXTRA_ext_posix_posix_la_SOURCES): Likewise. (posix_submodules): Likewise. (ext_posix_bit32_la_LDFLAGS): Set module LDFLAGS. * NEWS: Update. 2014-11-04 Gary V. Vaughan maint: ignore src.rock files. * .gitignore: Add *.src.rock. maint: update README. * README.md: Fix some outdated paragraphs. maint: post-release administrivia. * NEWS: Add header line for next release. * .prev-version: Record previous version. * ./local.mk (old_NEWS_hash): Auto-update. Release version 33.0.0 * NEWS: Record release date. configury: adopt semantic versioning. * configure.ac (AC_INIT): Bump version to 33.0.0. doc: document returned error numbers in many APIs. * ext/posix/fcntl.c, ext/posix/poll.c, ext/posix/sched.c, ext/posix/signal.c, ext/posix/stdio.c, ext/posix/stdlib.c, ext/posix/sys/msg.c, ext/posix/sys/resource.c, ext/posix/sys/socket.c, ext/posix/sys/stat.c, ext/posix/sys/times.c, ext/posix/sys/utsname.c, ext/posix/sys/wait.c, ext/posix/syslog.c, ext/posix/termio.c, ext/posix/time.c, ext/posix/unistd.c, ext/posix/utime.c, lib/posix/compat.lua, lib/posix/deprecated.lua: Document third returned error number for many APIs. 2014-11-03 Gary V. Vaughan syslog: add LOG_MASK, and pass bits to openlog and setlogmask. Close #156. * specs/posix_spec.yaml (openlog): Move from here... * specs/posix_deprecated_spec.yaml (openlog): ...to here. * specs/posix_spec.yaml (setlogmask): Move from here... * specs/posix_compat_spec.yaml (setlogmask): ...to here. * specs/posix_spec.yaml (closelog, syslog): Move from here * specs/posix_syslog_spec.yaml (closelog, syslog): New file. ...to here. * specs/specs.mk (specl_SPECS): Add posix_syslog_spec.yaml. * specs/posix_syslog_spec.yaml (openlog, setlogmask) (LOG_MASK): Specify behaviour of new minimal bindings. * ext/posix/compat.lua (openlog, setlogmask): Simplify accordingly. * lib/posix/deprecated.lua (openlog): Reimplement old string specified option API in Lua over new minimal binding. * ext/posix/syslog.c (PLOG_MASK): New function for converting option priorities to mask bits. * lib/posix/compat.lua (setlogmask): Reimplement old auto-ORing API over new LOG_MASK and minimal setlogmask bindings. * NEWS: Update. doc: remove unused posix.util.html. * local.mk (dist_modules_DATA): Remove doc/modules/posix.util.html. posix: move openpty utility into posix and add argchecks. * lib/posix/util.lua (openpty): Move from here... * lib/posix.lua (openpty): ...to here. Add argcheck wrapper. * lib/posix/util.lua: Reexport openpty for backwards compatibility. * specs/posix_spec.yaml (openpty): Add specs for argchecks. * build-aux/config.ld.in (file): Remove lib/posix/util.lua. * NEWS: Update. specs: set initial describe headers consistently. * specs/curses_spec.yaml, specs/posix_compat_spec.yaml, specs/posix_ctype_spec.yaml, specs/posix_deprecated_spec.yaml, specs/posix_fcntl_spec.yaml, specs/posix_fnmatch_spec.yaml, specs/posix_grp_spec.yaml, specs/posix_pwd_spec.yaml, specs/posix_sys_msg_spec.yaml, specs/posix_sys_resource_spec.yaml, specs/posix_sys_stat_spec.yaml, specs/posix_sys_statvfs_spec.yaml, specs/posix_sys_time_spec.yaml, specs/posix_sys_times_spec.yaml, specs/posix_sys_utsname_spec.yaml, specs/posix_time_spec.yaml, specs/posix_unistd_spec.yaml: Use dot delimmited module names consistently in initial describe heading. doc: show return type correctly on exec and execp. * ext/posix/unistd.c (Pexec, Pexecp): Show return type correctly. doc: show return type of posix.signal.signal. * ext/posix/signal.c (signal): Show return type. refactor: move lua docs to the top of LDoc index sidebar. * build-aux/config.ld.in (files): Move Lua files to the top of the list. unistd: deprecate exec with string tuple args. Close #167. * specs/posix_spec.yaml (exec, execp): Move from here... * specs/posix_deprecated.yaml (exec, execp): ...to here. * specs/posix_unistd.yaml (exec, execp): ...and much simplified specification here. * ext/posix/unistd.c (runexec): Simplify accordingly. * lib/posix/deprecated (exec, execp): Reimplement string tuple passing, [0]-crippled API again over C binding. * NEWS: Update. signal: modernize posix.signal. Close #161. * specs/posix_spec.yaml (kill, killpg, raise, signal): Move from here... * specs/posix_signal_spec.yaml (kill, killpg, raise, signal): New file. ...to here. * specs/specs.mk (specl_SPECS): Add specs/posix_signal_spec,yaml. * examples/signal.lua: Rewrite in modern style. * ext/posix/signal.c (Psignal): Update LDocs. (luaopen_posix_signal): Add SIG_DFL and SIG_IGN constants. * NEWS: Update. 2014-11-02 Gary V. Vaughan specs: don't truncate output after fcntl examples. * specs/lposix_spec.yaml (fcntl F_GETFL): Make sure to save and correctly restore stdio buffering correctly around examples. * NEWS: Update. deprecated: make sure bitwise operations are defined. * lib/posix/deprecated.lau (bit): Require a bit operation lib. (band, bnot, bor): Define local bitwise operators. refactor: separate undocumented compat APIs. * lib/posix/compat.lua (doselection, PosixTm, LegacyTm, pushmode) (bind, clock_getres, clock_gettime, connect, fadvise, fnmatch) (getgroup, getpasswd, getpid, getrimit, gettimeofday, gmtime) (hostid, isgraph, isprint, localtime, mktime, nanosleep, pathconf) (setrlimit, stat, statvfs, strftime, strptime, sysconf, times) (uname): Move from here... * lib/posix/deprecated.lua (doselection, PosixTm, LegacyTm) (pushmode, bind, clock_getres, clock_gettime, connect, fadvise) (fnmatch, getgroup, getpasswd, getpid, getrimit, gettimeofday) (gmtime, hostid, isgraph, isprint, localtime, mktime, nanosleep) (pathconf, setrlimit, stat, statvfs, strftime, strptime, sysconf) (times, uname): New file. ...to here. * build-aux/sanity-cfg.mk (sc_error_message_uppercase): Adjust accordingly. * build-aux/config.ld.in (file): Add lib/posix/compat.lua. * lib/posix/compat.lua: Document within posix module. 2014-10-28 Gary V. Vaughan refactor: separate private argument checking helpers. * lib/posix/compat.lua (argerror, argtypeerror, badoption) (checkint, checkselection, checkstring, checktable, optint) (optstring, opttable, toomanyargerror): Move from here... * lib/posix/_argcheck.lua (argerror, argtypeerror, badoption) (checkint, checkselection, checkstring, checktable, optint) (optstring, opttable, toomanyargerror): New file. ...to here. * local.mk (dist_luaposix_DATA): Add lib/posix/_argcheck.lua. socket: bind connect and bind minimally. Close #158. * specs/posix_spec.yaml (accept, bind, connect, getaddrinfo) (listen, recv, recvfrom, send, sendto, setsockopt, shutdown) (socket, socketpair): Move from here... * specs/posix_sys_socket_spec.yaml (accept, bind, connect) (getaddrinfo, listen, recv, recvfrom, send, sendto, setsockopt) (shutdown, socket, socketpair): New file. ...to here. (bind, connect): Adjust specifications to expect 0 returned upon success. * specs/posix_deprecated_spec.yaml (bind, connect): New file. Check for backward compatible return types when imported from posix module. * specs/specs.mk (specl_SPECS): Add specs/posix_sys_socket_spec.yaml and specs/posix_deprecated_spec.yaml. * ext/posix/sys/socket.c (bind, connect): Simplify accordingly. * examples/socket.lua: Adjust to new style submodule imports. * lib/posix/deprecated.lua (bind, connect): Write wrapper functions to implement `true` return API. * local.mk (dist_luaposix_DATA): Add lib/posix/deprecated.lua. * lib/posix.lua.in: Import deprecated APIs. time: remote debugging with Travis!! * lib/posix/compat.lua (clock_getres): Fix if guard for undefined clock_getres. (clock_gettime): Fix indentation. * specs/psoix_time_spec.yaml (clock_getres, clock_gettime): Use prototype instead of type to get metatable _type! time: bind clock_getres and clock_gettime minimally. Close #159. * specs/posix_time_spec.yaml (clock_getres, clock_gettime): Adjust to specify passing of integer constants and return PosixTimespec tables. * specs/posix_compat_spec.yaml (clock_getres, clock_gettime): Specify backwards compatible behaviours accepting optional name and returning separate sec, nanosec results. * ext/posix/time.c (get_clk_id_const): Remove. (clock_getres, clock_gettime): Simplify. * lib/posix/compat.lua (clock_getres, clock_gettime): Reimplement old API over new minimal binding. * NEWS: Update 2014-10-25 Gary V. Vaughan time: bind nanosleep minimally. Close #162. * specs/posix_spec.yaml (nanosleep): Move from here... * specs/posix_compat_spec.yaml (nanosleep): ...to here. * specs/posix_time_spec.yaml (nanosleep): Specify behaviour of minimal binding. * ext/posix/time.c (totimespec, pushtimespec): New functions. Convert between C struct timespec and Lua PosixTimespec table. (nanosleep): Simplify accordingly. * lib/posix/compat.lua (nanosleep): Reimplement old API over new minimal binding. * NEWS: Update. time: pass struct tm equivalent tables with POSIX field names. * specs/posix_spec.yaml (gmtime, localtime, mktime, strftime) (strptime): Move from here... * specs/posix_compat_spec.yaml (gmtime, localtime, mktime) (strftime, strptime): ...to here. Add full specifications. * specs/posix_time_spec.yaml (clock_getres, clock_gettime, gmtime) (localtime, mktime, strftime, strptime, time): Specify behaviours of thin bindings for these APIs. * specs/specs.mk (specl_SPECS): Add specs/posix_time_spec.yaml. * ext/posix/time.c (Stm_fileds, totm, pushtm): Convert and verify C struct tm records and Lua PosixTm tables. (gmtime, localtime, mktime, strftime, strptime): Simplify accordingly. * lib/posix/compat.lua (PosixTm, LegacyTm): Convert between new PosixTm tables and old custom field name `struct tm` tables. (gmtime, localtime, mktime, strftime, strptime): Reimplement legacy table manipulation APIs over new thin bindings. * NEWS: Update. maint: tidy up sanity check configuration. * build-aux/sanity-cfg.mk: Escape '.' in regexps properly. Add lib/posix/compat.lua to sc_error_message_uppercase. 2014-10-24 Gary V. Vaughan resource: bind getrlimit and setrlimit minimally. Close #164. * specs/posix_spec.yaml (getrlimit, setrlimit): Move from here... * specs/posix_compat_spec.yaml (getrlimit, setrlimit): ...to here. * specs/posix_sys_resource_spec.yaml (getrlimit, setrlimit): New file. Specify minimal binding behaviours. * specs/specs.mk (specl_SPECS): Add specs/posix_sys_resource_spec.yaml. * ext/include/_helpers.c (checkfieldtype): Improve nil diagnostic to read 'no value'. (lookup_symbol): Remove unused function. * ext/posix/sys/resource.c (rlimit_map, Krlimit, Srlimit): Remove unused internal APIs. (pushrlimit): Push a PosixRlimit table onto the stack. (getrlimit, setrlimit): Simplify accordingly. * lib/posix/compat.lua (optint): New helper function. (getrlimit, setrlimit): Reimplement string resource multi-return API in Lua. * NEWS: Update. refactor: reorder renamed fcntl functions alphabetically. * ext/posix/fcntl.c: Order functions alphabetically. compat: adjust argerror diagnostics for backwards compatibility. * lib/posix/compat.lua (fadvise): Adjust argerror diagnostics. maint: adjust badarguments example generation for fadvise. * specs/posix_compat_spec.yaml (fadvise): Adjust fadvise generation specifier. maint: missing declaration. * ext/posix/fcntl.c (Pposix_fadvise): Add missing declaration. fcntl: bind posix_fadvise minimally. Close #169. * specs/posix_spec.yaml (fadvise): Move from here... * specs/posix_compat_spec.yaml (fadvise): ...to here. * specs/posix_fcntl_spec.yaml (posix_fadvise): Specify argcheck behaviours on supporting systems. * ext/posix/fcntl.c (Pfadvise): Rename from this... (Pposix_fadvise): ...to this. Change first argument to a file descriptor to match POSIX API. * lib/posix/compat.lua (fadvise): Reimplement file handle argument version in Lua. * NEWS: Update. refactor: move _helper.c functions into only calling submodule. * ext/include/_helpers.c (mygetuid, mygetgid): Move from here... * ext/posix/unistd.c (mygetuid, mygetgid): ...to here. maint: remove unused doselection helper. * ext/include/_helpers.c (Selector, doselection): Remove. * ext/posix/sys/resource.c (Pgetrlimit): Remove unsolvable FIXME comment. times: bind times minimally. Close #165. * specs/posix_spec.yaml (times): Move from here... * specs/posix_compat_spec.yaml (times): ...to here. * specs/posix_sys_times_spec.yaml (times): New file. Specify minimal binding of times(2). * specs/specs.mk (specl_SPECS): Add specs/posix_sys_times_spec.yaml. * ext/posix/sys/times.c (struct mytimes, Ftimes, Stimes): Remove. (Ptimes): Simplify accordingly. * lib/posix/compat.lua (times): Reimplement legacy multi-string or table io/API over minimal C binding. * NEWS: Update. 2014-10-23 Gary V. Vaughan compat: fix a typo, so stat is wrapped with _DEBUG false. * lib/posix/compat.lua (stat): When _DEBUG is false, make sure to still add a stat function entry to the export table! statvfs: bind statvfs minimally. * specs/posix_spec.yaml (statvfs): Move from here... * specs/posix_compat_spec.yaml (statvfs): ...to here. * specs/posix_sys_statvfs_spec.yaml (statvfs): New file. Specify a minimal binding of statvfs(2). * specs/specs.mk (specl_SPECS): Add specs/posix_sys_statvfs_spec.yaml. * ext/posix/sys/statvfs.c (Fstatvfs, Kpathvfs, Sstatvfs): Remove. (Pstatvfs): Simplify drastically. (luaopen_posix_sys_vfs): Add statvfs f_flags bitmasks. * lib/posix/compat.lua (statvfs): Reimplement legacy multi-string or table io/API over minimal C binding. * NEWS: Update. maint: don't rely on undefined evaluation order. * ext/posix/unistd.c (Ppathconf): The C standard allows arguments to be evaluated in any order, and we have specl examples that require argchecks proceed from left to right, so hoist the first argument out of the nested call to satisfy that. unistd: wrap pathconf minimally. * specs/posix_spec.yaml (pathconf): Move from here... * specs/posix_compat_spec.yaml (pathconf): ...to here. * specs/posix_unistd_spec.yaml (pathconf): Specify a minimal binding of pathconf(2). * ext/posix/unistd.c (pathconf_map, Fpathconf, Kpathconf) (Spathconf): Remove. (pathconf): Simplify drastically. (luaopen_posix_unistd): Add pathconf argument constants. * lib/posix/compat.lua (pathconf): Reimplement legacy multi- string or table i/o API over minimal C binding. * NEWS: Update. unistd: wrap sysconf minimally. * specs/posix_spec.yaml (sysconf): Move from here... * specs/posix_compat_spec.yaml (sysconf): ...to here. * specs/posix_unist_spec.yaml (sysconf): Specify minimal binding of sysconf(2). * ext/posix/unistd.c (sysconf_map, Fsysconf, Ksysconf, Ssysconf): Remove. (sysconf): Simplify drastically. (luaopen_posix_unistd): Add sysconf argument constants. * lib/posix/compat.lua (sysconf): Reimplement legacy multi-string or table i/o API over minimal C binding. * NEWS: Update. posix: factor out doselection argument checking function. * lib/posix/compat.lua (badoption, checkint, checkstring) (checktable, optstring): Accept and propagate new error level parameter. (checkselection): Use them to factor out argument checking for doselection argchecking wrappers. (getpasswd, getpid, stat): Simplify argchecking wrappers accordingly. * NEWS: Update. 2014-10-22 Gary V. Vaughan refactor: factor out doselection-like functionality. * lib/posix/compat.lua (doselection): Given a table of field names, and a mapping table return a tuple of remapped names, or the whole table when no fields are passed. (getpasswd, getpid, stat): Simplify accordingly. specs: specify posix.sys.stat.stat behaviour. * specs/posix_sys_stat_spec.yaml (stat): New examples based on lstat. specs: add missing file. * specs/posix_fcntl_spec.yaml: New file. posix: move mode munching from C to Lua. Close #147. * specs/posix_spec.yaml (chmod, mkdir, mkfifo, msgget, open): Move from here... * specs/posix_compat_spec.yaml (chmod, mkdir, mkfifo, msgget) (open): ...to here, and add functionality examples. * specs/posix_sys_msg_spec.yaml (msgget), specs/posix_sys_stat_spec.yaml (chmod, mkdir, mkfifo): Updated versions of original examples, tailored to work with integer mode arguments. * local.mk (specl_SPECS): Add specs/posix_fcntl_spec.yaml and specs/posix_sys_msg_spec.yaml. * ext/posix/fcntl.c (Popen): Drastically simplified, to a minimal POSIX binding. * ext/posix/sys/msg.c (Pmsgget): Likewise. * ext/posix/sys/stat.c (Pchomd, Pmkdir, Pmkfifo): Likewise. * ext/include/_helpers.c (M, rwxrwxrwx, octal_mode, mode_munch): Remove. No longer in use. * lib/posix/compat.lua (checkint): New support function. (chmod, mkdir, mkfifo, msgget, open): Reimplement legacy mode munching APIs over minimal C bindings. (create): Adjust to use new minimal open binding. 2014-10-21 Gary V. Vaughan sys.stat: wrap umask minimally. * specs/posix_spec.yaml (umask): Move from here... * specs/posix_compat_spec.yaml (umask): ...to here. * specs/posix_sys_stat_spec.yaml (umask): Specify minimal binding for umask(2). * ext/posix/sys/stat.c (umask): Simplify drastically. * ext/include/_helpers.c (pushmode): Remove. No longer used. * lib/posix/compat.lua (rwxrwxrwx, octal_mode, mode_munch): Translated from C equivalents in ext/include/_helpers.c. (umask): Use them to reimplement legacy modestring based API. refactor: move pushtimeval function to ext/posix/sys/time.c. There's only one call-site for this function, so no need to keep it in the shared helpers file. * ext/include/_helpers.c (pushtimeval): Move from here... * ext/posix/sys/time.c (pushtimeval): ...to here. maint: retain backwards compatibility with v32 posix.stat. We now have `posix.sys.stat` for thin bindings of stat and lstat, so maintain backwards compatibility with v32 in `posix.stat`. * specs/posix_compat_spec.yaml (lstat): Remove. (stat): Adjust to expect lstat under the hood. * specs/posix_spec.yaml: Adjust stat/lstat clients. * lib/posix/compat.lua (lstat): Remove. (stat): Adjust to use lstat under the hood. * NEWS: Update. specs: fix a bug in lstat.st_blocks example. * specs/posix_sys_stat_spec.yaml (lstat): Don't expect number of disk blocks used by a file to equal the number used by the directory that file is in! compat: import bitwise operations before use. * lib/posix/compat.lua: Import bitwise operations before use. maint: disable prohibit_stat_st_blocks sanity check. * build-aux/sanity-cfg.mk (local-checks-to-skip): Add sc_prohibit_stat_st_blocks, because we need to use st_blocks here until licensing allows using the gnulib/module/stat-size. maint: add missing file. * specs/posix_sys_stat_spec.yaml: New file, forgotten from last commit. sys.stat: wrap stat and lstat properly. * specs/posix_spec.yaml (lstat, stat): Move from here... * specs/posix_compat_spec.yaml (lstat, stat): ...to here. * specs/posix_sys_stat_spec.yaml: New file. Specify correct thin binding for stat(2) and lstat(2). * specs/specs.mk (specl_SPECS): Add posix_sys_stat_spec.yaml. * ext/posix/sys/stat.c (pushstat): New function. Push a struct stat-like table on top of the stack. (S_ISBLK, S_ISCHR, S_ISDIR, S_ISFIFO, S_ISLNK, S_ISREG) (S_ISSOCK): New APIs. (S_IFMT, S_IFBLK, S_IFCHR, S_IFDIR, S_IFIFO, S_IFLNK, S_IFREG) (S_IRWXU, S_IRUSR, S_IWUSR, S_IXUSR, S_IRWXG, S_IRGRP, S_IWGRP) (S_IXGRP, S_IRWXO, S_IROTH, S_IWOTH, S_IXOTH, S_ISGID, S_ISUID): New constants. (Plstat, Pstat): Simplify accordingly. (filetype, Fstat, Sstat): Remove. * specs/spec_helper.lua (rmtmp): Update to use low-level stat call. * lib/posix/compat.lua (lstat, stat): Reimplement wierd multi- return value, table or tuple input APIs over new lean bindings. * NEWS: Update. maint: name posix_compat_spec.yaml correctly. * specs/posix_compat.yaml: Move from here... * specs/posix_compat_spec.yaml: ...to here. * specs/specs.mk (specl_SPECS): Adjust accordingly. refactor: use std.object.type compatible metatables. * specs/spec_helper.lua (prototype): Copied from lua-stdlib. * specs/posix_grp_spec.yaml (getgrent, getgrgid, getgrnam): Specify prototype responses for return tables. * specs/posix_pwd_spec.yaml (getpwent, getpwnam, getpwuid): Likewise., * specs/posix_sys_time_spec.yaml (gettimeofday): Likewise. * specs/posix_sys_utsname_spec.yaml (uname): Likewise. * ext/include/_helpers.c (LPOSIX_STMT_BEG, LPOSIX_STMT_END): New macros for safe compound statement macro definitions. (LPOSIX_CONST, pushnumberfield, pushstringfield): Use them here. (pushliteralfield): New macro for literal fields. (setnumberfield, setstringfield, settypemetatable): New macros for easy return table creation. (pushtimeval): Simplify accordingly. Set metatable._type. * ext/posix/curses/chstr.c (luaopen_posix_curses_chstr): Ditto. * ext/posix/curses/window.c (luaopen_posix_curses_window): Ditto. * ext/posix/grp.c (pushgroup): Ditto. * ext/posix/pwd.c (pushpasswd): Ditto. * ext/posix/sys/socket.c (pushsockaddrinfo): Ditto. * ext/posix/sys/utsname.c (pushutsname): Ditto. * NEWS: Update. maint: add missing file. * specs/posix_sys_time_spec.yaml: Add missing file. doc: name timeval fields correctly. * ext/posix/sys/time.c (timeval): Prefix both field names with `tv_` per C struct timeval, and pushtimeval table. sys.time: wrap gettimeofday properly. * specs/posix_spec.yaml (gettimeofday): Move from here... * specs/posix_compat.yaml (gettimeofday): ...to here. * specs/posix_sys_time_spec.yaml (gettimeofday): Specify correct thin binding for gettimeofday(2). * specs/specs.mk (specl_SPECS): Add posix_sys_time_spec.yaml. * ext/include/_helpers.c (pushtimeval): New function. Push a struct timeval-like table on top of the stack. * ext/posix/sys/time.c (Pgettimeofday): Simplify accordingly. * lib/posix/compat.lua (gettimeofday): Rewrite misnamed table fields returning API here for backwards compatibility. 2014-10-20 Gary V. Vaughan refactor: simplify push{string,number}field and clients. * ext/include/_helpers.c (pushnumberfield, pushstringfield): Reimplement as macros, with fewer arguments required. Adjust all callers. * ext/posix/sys/socket.c (sockaddr_to_lua): Renamed from this... (pushsockaddrinfo): ...to this, and simplify considerably. Adjust all callers. socket: allow getaddrinfo results as connect address argument. Undo overzealous rejection of misnamed fields to socket.connect. * ext/posix/sys/socket.c (Safinet_fields): Also permit fields written to getaddrinfo results. maint: move stat and lstat from posix.unistd to posix.sys.std. * ext/posix/unistd.c (filetype, Fstat, Sstat, Plstat, Pstat): Move from here... * ext/posix/sys/stat.c (filetype, Fstat, Sstat, Plstat, Pstat): ...to here. utsname: wrap uname properly. Close #154. * specs/posix_spec.yaml (uname): Move from here... * specs/posix_compat.yaml (uname): ...to here. Add diagnose bad option example. * specs/posix_sys_utsname_spec.yaml (uname): Specify correct thin binding for uname(2). * specs/specs.mk (specl_SPECS): Add posix_sys_utsname_spec.yaml. * ext/posix/sys/utsname.c (pushutsname): New function to push a table with struct utsname fields. (uname): Use it to push the actual results of the call. * lib/posix/compat.lua (uname): Rewrite old format specifier replacing API here for backwards compatibility. ctype: wrap isprint and isgraph properly. Close #160. * specs/posix_spec.yaml (isprint, isgraph): Move from here... * specs/posix_compat.yaml (isprint, isgraph): ...to here. Add result specifications. * specs/posix_ctype_spec.yaml (isprint, isgraph): Specify correct thin binding for these functions. * specs/specs.mk (specl_SPECS): Add posix_ctype_spec.yaml. * ext/posix/ctype.c (isprint, isgraph): Return the actual result of calling these functions. * lib/posix/compat.lua (isprint, isgraph): Rewrite the weird true/ false return API here for backwards compatibility. fnmatch: wrap fnmatch(3) properly. Close #168. * specs/posix_spec.yaml (fnmatch): Move from here... * specs/posix_compat.yaml (fnmatch): ...to here. * specs/posix_fnmatch_spec.yaml (fnmatch): Specify correct thin binding for fnmatch(3). * specs/specs.mk (specl_SPECS): Add posix_fnmatch_spec.yaml. * ext/posix/fnmatch.c (fnmatch): Return the actual result of the call. (luaopen_posix_fnmatch): Export FNM_NOMATCH constant. * lib/posix/compat.lua (fnmatch): Rewrite the weird true/false error raising API here for backwards compatibility. doc: add curses constants LDocs. * ext/posix/curses.c: Document constants. (register curses constants): Fix a typo so that KEY_F31 is defined as advertised. * NEWS: Update. doc: LDoc config improvements. * build-aux/config.ld.in (title): Display package name as well as release number. (description): Mention inclusion of curses bindings explicitly. (backtick_references): Require @{...} for cross-references, leaving backticks for terminal font markup. doc: tidy up LDoc output for posix.termio. * ext/posix/termio.c: Tidy up formatting for LDocs. 2014-10-19 Gary V. Vaughan slingshot: sync with upstream, for git submodule fixes. * slingshot: Sync with upstream. * bootstrap: Import from slingshot. doc: add LDocs for submodule constants. * ext/posix/errno.c, ext/posix/fcntl.c, ext/posix/fnmatch.c, ext/posix/sched.c, ext/posix/signal.c, ext/posix/stdio.c, ext/posix/sys/msg.c, ext/posix/sys/socket.c, ext/posix/sys/wait.c, ext/posix/syslog.c, ext/posix/unistd.c: Add LDocs for constants. * NEWS: Update. 2014-10-17 Gary V. Vaughan posix: use correct POSIX gethostid API. Closes #153. * specs/posix_spec.yaml (hostid): Move from here... * specs/posix_compat.yaml (hostid): ...to here. * specs/posix_unistd_spect.yaml (gethostid): Specify with correct POSIX API name. * ext/posix/unistd.c (Phostid): Rename from this... (Pgethostid): ...to this. * lib/posix/compat.lua (hostid): An alias to gethostid for backwards compatibility. * NEWS: Update. maint: add missing lib/posix/compat.lua file. * lib/posix/compat.lua: New file, forgotten from an earlier commit. maint: add missing specs/posix_compat.yaml file. * specs/posix_compat.yaml: New file, forgotten from previous commit. 2014-10-16 Gary V. Vaughan refactor: maintain backwards compatibility for getpasswd. Closes #148. Separate backwards compatibility functions so that they still work as before, but do not appear in the documentation. * specs/posix_spec.yaml (creat, getgroup, getpasswd, getpid): Move from here... * specs/posix_compat_spec.yaml (creat, getgroup, getpasswd) (getpid): New file. ...to here. * lib/posix.lua.in (argerror, argtypeerror, checkstring) (checktable, toomanyargerror, creat, getgroup, getpasswd) (getpid): Move from here... * lib/posix/compat.lua (argerror, argtypeerror, checkstring) (checktable, toomanyargerror, creat, getgroup, getpasswd) (getpid): New file. ...to here. * NEWS: Update. refactor: simplify posix.getpasswd for consistency. * specs/posix_spec.yaml (getpasswd): Simplify behaviours for consistency with pasix.getgroup. * lib/posix.lua.in (getpasswd): Simplify accordingly. * NEWS: Update. unistd: implement getpid and similar APIs. Closes #152. * specs/posix_unistd_spec.yaml: New file. Specify behaviours for getegid, geteuid, getgid, getpgrp, getpid, getppid, getuid. * specs/specs.mk (specs_SPECS): Add specs/posix_unistd_spec.yaml. * ext/posix/unistd.c (getpid): Delete. (setegid, geteuid, getgid, getpgrp, getpid, getppid, getuid): New functions. Satisfy specifications. * lib/posix.lua.in (getpid): Reimplement legacy API over new POSIX bindings. * NEWS: Update. posix: getgroup argument defaults to egid. * specs/posix_spec.yaml (getgroup): Specify behaviour with no arguments. * lib/posix.lua.in (group): New LDocs for getgroup return table fields. (getgroup): Adjust LDocs accordingly. Default to egid with no argument. * NEWS: Update. pwd: implement POSIX pwd APIs. Closes #150. (getpwuid, setpwent): Specify correct behaviours. * ext/posix/pwd.c (endpwent, getpwent, getpwnam, getpwuid) (setpwent): Implement bindings to these POSIX pwd APIs. * ext/posix/pwd.c (getpasswd): Remove. * lib/posix.lua.in (getpasswd): Reimplement over POSIX APIs to continue satisfying specifications. * NEWS: Update. refactor: tidy up formatting in grp.c. * ext/posix/grp.c: Tidy up formatting. 2014-10-14 Gary V. Vaughan specs: specify timer math behaviours. * specs/posix_spec.yaml (timeradd, timercmp, timersub): Specify behaviours. * lib/posix.lua.in (timeradd, timercmp, timersub): Argcheck wrappers return inner function results. (timercmp, timersub): Fix typo with initial definition scopes. refactor: reorder posix.lua.in functions alphabetically. * lib/posix.lua.in: Reorder functions alphabetically. specs: add argument checking to Lua language posix functions. * specs/posix_spec.yaml (creat, getgroup, spawn, pipeline) (pipeline_iterator, pipeline_slurp, euidaccess, timeradd) (timercmp, timersub): Add basic argument checking behaviour specifications. * lib/posix.lua.in: Move submodule imports to the start, so they are available to local Lua functions. Cache import table lookups into upvalues for fast access. (creat, getgroup, spawn, pipeline, pipeline_iterator) (pipeline_slurp, euidaccess, timeradd, timercmp, timersub): Use cached upvalues everywhere. Split argument type checking into wrapper function which is not used when global `_DEBUG` is false. refactor: factor Lua argument checking into helper functions. * lib/posix.lua.in (argerror, toomanyargerror, argtyperror): Argument error message management, inspired by stdlib. (checkstring, checktable): Check argument types, inspired by Lua C API. (creat, getgroup, pipeline): Simplify accordingly. maint: revert a1f9049 'move creat from Lua to C'. * ext/posix/fcntl.c (creat): Remove. * lib/posix.lua (creat): Implement in Lua. * specs/posix_spec.yaml (creat): Adjust. * NEWS: Update. specs: allow empty root group membership. * specs/posix_grp_spec.yaml (getgrgid, getgrnam): Allow empty root group membership. * specs/posix_spec.yaml (getgroup): Likewise. maint: remove trailing blanks. * specs/posix_grp_spec.yaml: Remove trailing blanks. grp: implement POSIX group APIs. Closes #151. * specs/posix_grp_spec.yaml (endgrent, getgrent, getgrgid) (getgrnam, setgrent): Specify correct behaviours. * ext/posix/grp.c (endgrent, getgrent, getgrgid, getgrnam) (setgrent): Implement bindings to these POSIX group APIs. * specs/posix_spec.yaml (getgroup): Specify expected behaviour. * ext/posix/grp.c (getgroup): Remove. * lib/posix.lua (getgroup): Reimplement over POSIX APIs to continue satisfying specifications. * NEWS: Update. specs: remove unused curses subdirectory paths. * specs/spec_helper.lua (package.cpath): Remove unused curses subdirectory paths. 2014-10-13 Gary V. Vaughan refactor: write final semi-colons at expansion site. Give text editors a fighting chance of doing auto-indentation properly. * ext/posix/curses.c (CCR): Remove final semi-colon from macro expansion. Write a literal semi-colon at each expansion site. curses: add curses.A_COLOR constant where supported. * ext/posix/curses.c (register_curses_constants): Define A_COLOR. * NEWS: Update. doc: add summary sentence to each curses API. * ext/posix/curses.c, ext/posix/curses/window.c: Add API summary lines. 2014-10-11 Gary V. Vaughan doc: put release number in index.html. * build-aux/config.ld.in (project): Add release number. configury: fix documentation dependencies. * local.mk (allhtml): All generated documentation. Use it to ensure we regenerate as necessary. maint: add missing boilerplate copyright to lua sources. * lib/posix.lua.in, lib/posix/util.lua: Add boilerplate copyright doc: add per-module overview. * build-aux/config.ld.in (boilerplate): Set to true so we can put a copyright comment at the very top of each file. * ext/posix/ctype.c, ext/posix/curses.c, ext/posix/curses/chstr.c, ext/posix/curses/window.c, ext/posix/dirent.c, ext/posix/errno.c, ext/posix/fcntl.c, ext/posix/fnmatch.c, ext/posix/getopt.c, ext/posix/glob.c, ext/posix/grp.c, ext/posix/libgen.c, ext/posix/poll.c, ext/posix/pwd.c, ext/posix/sched.c, ext/posix/signal.c, ext/posix/stdio.c, ext/posix/stdlib.c, ext/posix/sys/msg.c, ext/posix/sys/resource.c, ext/posix/sys/socket.c, ext/posix/sys/stat.c, ext/posix/sys/statvfs.c, ext/posix/sys/time.c, ext/posix/sys/times.c, ext/posix/sys/utsname.c, ext/posix/sys/wait.c, ext/posix/syslog.c, ext/posix/termio.c, ext/posix/time.c, ext/posix/unistd.c, ext/posix/utime.c: Move copyright comments to the very top of the file. Add a short overview description. curses: remove separate curses doc generation. * build-aux/make_lcurses_doc.pl: Remove. * local.mk (DIST_DOC_DATA, EXTRA_DIST): Adjust accordingly. (classesdir): Location for ldoc class html files. (dist_classes_DATA): Add new generated curses class docs. * ext/posix/curses.c: Rewrite equivalent docs here. * NEWS: Update. doc: add updated curses example. * examples/curses.lua: Updated example from old lcurses docs. curses: don't forget to open curses submodules. * ext/posix/curses.c (luaopen_posix_curses): Open submodules. curses: factor out chstr and window objects. * ext/posix/curses.c: Factor out chstr and window objects, methods and support functions from here... * ext/posix/curses/chstr.c, ext/posix/curses/window.c: ...to here. * ext/posix/curses.c, ext/posix/curses/chstr.c, ext/posix/curses/window.c: Add rudimentary LDocs to every API. * build-aux/config.ld.in (file): Add ext/posix/curses/window.c, ext/posix/curses/chstr.c and ext/posix/curses.c. * ext/posix/curses/chstr.c: Add __call metamethod for creating new objects. * ext/posix/curses/chstr.c, ext/posix/curses/window.c: Add _type field for compatibility with `std.object.type`. * local.mk (EXTRA_ext_posix_posix_la_SOURCES): Add ext/posix/curses/chstr.c and ext/posix/curses/window.c. (posix_submodules): Add ext/posix/curses/chstr.la and ext/posix/curses/window.la. * build-aux/config.ld.in (custom_see_handler): Adjust to create working URLs for curses 3X manual pages. 2014-10-10 Gary V. Vaughan refactor: rename chstr_ prefixed functions to C prefix. * ext/posix/curses.c: Rename chstr_ prefixed function to C prefix. (chstrlib): Use LUAPOSIX_FUNC instead of MENTRY. refactor: rename curses api function with P prefix. * ext/posix/curses.c: Rename C prefixed functions with P prefix. refactor: use _helpers.c checkint and optint in curses submodule. * ext/posix/curses.c: Use checkint and optint throughout instead of luaL_checkint & luaL_checknumber and luaL_optint resp. refactor: reformat curses.c to match posix sources. * ext/posix/curses.c: Reformat. refactor: unroll curses submodule function generator macros. * ext/posix/curses.c: Unroll obfuscating function generating macros. (LC_NUMBER, LC_NUMBER2, LC_STRING, LC_STRING2, LC_BOOL) (LC_BOOLOK, LCW_BOOLOK, LCW_BOOLOK2, LCW_WIN2, LCW_WIN2YX) (LC_ATTROK, LC_TOGGLEOK, LCW_WINBOOLOK, LCW_WININTOK): Remove. * ext/include/_helpers.c (pushboolresult, pushintresult) (pushstringresult): New macros to simplify returning a single object on the stack. * ext/include/curses.c (pushokresult): Likewise. * ext/posix/ctype.c, ext/posix/curses.c, ext/posix/dirent.c, ext/posix/fnmatch.c, ext/posix/signal.c, ext/posix/stdio.c, ext/posix/stdlib.c, ext/posix/sys/socket.c, ext/posix/time.c, ext/posix/unistd.c: Simplify accordingly. curses: use _helpers.c macros. * ext/posix/curses.c (LCURSES_SPLICE, LCURSES_STR, LCURSES_STR_1): Remove. Adjust all callers to use LPOSIX equivalents from ext/include/_helpers.c. (curseslib, windowlib): Use LPOSIX_FUNC to declare table entries rather than custom MENTRY macros. posix: consolidate included C sources. * ext/include/strlcpy.c: Add multiple include guards. * ext/posix/_helpers.c: Move from here... * ext/include/_helpers.c: ...to here. * local.mk (EXTRA_ext_posix_posix_la_SOURCES) (EXTRA_DIST): Adjust accordingly. curses: integrate into posix tree. * ext/curses/curses.c: Move from here... * ext/posix/curses.c: ...to here. * local.mk * ext/posix/curses.c (luaopen_curses_c): Rename from this... (luaopen_posix_curses): ...to this. * lib/curses.lua: Adjust accordingly. * local.mk (curses_cpath, ext_curses_curses_c_la_SOURCES) (ext_curses_curses_c_la_LDFLAGS): Remove. (std_cpath): Simplify accordingly. (EXTRA_ext_posix_posix_la_SOURCES): Add ext/posix/curses.c. (ex_posix_curses_la_LDFLAGS, ext_posix_posix_la_LDFLAGS): Add $(CURSES_LIB). (posix_submodules): Add ext/posix/curses.la. * ext/posix/curses.c (luaopen_posix_curses): Add a version entry to the returned table to match other posix modules. * build-aux/make_lcurses_doc.pl: Adjust accordingly. * ext/posix/posix.c: Include curses.c module. * configure.ac (WANTEDLIBS, WANTEDLUA): Remove. Treat it like other posix modules with no OS support. * local.mk (dist_lua_DATA, luaexec_LTLIBRARIES): Adjust accordingly. 2014-10-09 Gary V. Vaughan configury: make posix module version dynamic. * lib/posix.lua: Move from here... * lib/posix.lua.in: ...to here. (version): Use @PACKAGE_STRING@ in place of hard-coded 33. * configure.ac (AC_CONFIG_FILES): Add lib/posix.lua. * .gitignore: Add lib/posix.lua. configury: add missing fdatasync declaration if necessary. Fixes #172. * configure.ac (AC_CHECK_DECLS_ONCE): Check for missing fdatasync declaration, e.g. on Mac OS 10.9. * ext/posix/unistd.c (Pfdatasync): Roll our own to save a compiler warning if the system didn't supply one. posix: build and install modules correctly. * configure.ac (POSIX_EXTRA_LDFLAGS): Rename from this... (LIBRT): ...to this. (LIBCRYPT): Set according to results of AC_SEARCH_LIBS. * local.mk (lib_LTLIBRARIES): Moved from the C library tree... (luaexec_LTLIBRARIES): ...to the Lua cpath tree. (check_LTLIBRARIES): Move from here... (EXTRA_LTLIBRARIES): ...to here. (check_local): Ensure standalone modules build correctly... (clean_local): ...and that file droppings are removed. * NEWS: Update. posix: allow standalone reuse of posix submodules. * ext/posix/sys/msg.c, ext/posix/sys/socket.c, ext/posix/syslog.c: Move guards to ensure even on hosts with no sys/msg.h, we don't get an empty object file. * local.mk (noinst_LTLIBRARIES): Add standalone compilations to ensure the submodules really build as separate compilation units. * NEWS: Update. posix: split posix subfiles into separate modules. * ext/posix/_helpers.h: Removed. Content moved from here... * ext/posix/_helpers.c: ...to here. Adjust all callers. * ext/posix/posix.c (R, luaopen_posix_c): Move registered functions and constants from here... * ext/posix/ctype.c, ext/posix/dirent.c, ext/posix/errno.c, ext/posix/fcntl.c, ext/posix/fnmatch.c, ext/posix/getopt.c, ext/posix/glob.c, ext/posix/grp.c, ext/posix/libgen.c, ext/posix/poll.c, ext/posix/pwd.c, ext/posix/sched.c, ext/posix/signal.c, ext/posix/stdio.c, ext/posix/stdlib.c, ext/posix/sys/msg.c, ext/posix/sys/resource.c, ext/posix/sys/socket.c, ext/posix/sys/stat.c, ext/posix/sys/statvfs.c, ext/posix/sys/time.c, ext/posix/sys/times.c, ext/posix/sys/utsname.c, ext/posix/sys/wait.c, ext/posix/syslog.c, ext/posix/termio.c, ext/posix/time.c, ext/posix/unistd.c, ext/posix/utime.c: ...to here. Provide individual `luaopen_` entry functions. build-aux/config.ld.in, build-aux/sanity-cfg.mk: Adjust accordingly. * ext/posix/posix.c: Reduce to a single compilation unit that includes the sources for all the other submodules. * lib/posix.lua (openpty): Move from here... * lib/posix/util.lua (openpty): New file. ...to here. * lib/posix/sys.lua: Move definitions from here... * lib/posix.lua: ...to here. * lib/posix/sys.lua: Re-export backwards compatibility APIs from here too. * lib/posix.lua: Re-export all submodule entry points from here too to retain the flat namespace of old releases. * local.mk: Adjust accordingly. * NEWS: Update. posix: missing headers for Linux portability. * ext/posix/pwd.c: Include unistd.h for geteuid and others. * ext/posix/stdlib.c: Include fcntl.h for open. * ext/posix/sched.c: Include unistd.h for _POSIX_PRIORITY_SCHEDULING. * ext/posix/sys/msg.c, ext/posix/sys/socket.c, ext/posix/syslog.c: Include unistd.h for _POSIX_VERSION. * ext/posix/sys/times.h: Include unistd.h for sysconf. maint: split giant posix.c file into manageable chunks. * ext/posix/posix.c: Separate into sections... * ext/posix/_helpers.c, ext/posix/_helpers.h, ext/posix/ctype.c, ext/posix/dirent.c, ext/posix/errno.c, ext/posix/fcntl.c, ext/posix/fnmatch.c, ext/posix/getopt.c, ext/posix/glob.c, ext/posix/grp.c, ext/posix/libgen.c, ext/posix/poll.c, ext/posix/pwd.c, ext/posix/sched.c, ext/posix/signal.c, ext/posix/stdio.c, ext/posix/stdlib.c, ext/posix/syslog.c, ext/posix/termio.c, ext/posix/time.c, ext/posix/unistd.c, ext/posix/utime.c: ...here. * ext/posix/posix.c: #include sources back into here. * build-aux/config.ld.in (file): Adjust accordingly. * build-aux/sanity-cfg.mk: Likewise. * lib/posix.lua: Likewise. 2014-10-09 Gary V. Vaughan Merge pull request #173 from tylerneylon/master doc: gettimeofday uses microsec, not nano. * ext/posix/posix.c (gettimeofday): Fix a typo in usec documentation. Reported by Tyler Neylon 2014-10-09 Tyler Neylon Fix a typo: gettimeofday uses microsec, not nano. 2014-10-09 Gary V. Vaughan maint: git ignore .dirstamp files. * .gitignore: Add .dirstamp catch all. Remove per-directory duplicates of the same. slingshot: resync with upstream for yaml bugfix. * slingshot: Resync with upstream for yaml quoting bugfix. * .travis.yml: Regenerate. slingshot: sync with upstream for mkrockspecs bugfix. * slingshot: Sync with upstream for mkrocspecs bugfix. * .travis.yml: Regenerate. 2014-10-06 Gary V. Vaughan maint: simplify installation instructions in README.md. * README.md (Installation): Remove --server flag; moonscript.org is checked automatically now. maint: add myself to the copyright holders in posix.c. * ext/posix/posix.c: Add myself to the copyright holders. specs: compare file size rather than racey modification times. Fix #145. * specs/posix_spec.yaml (stat): Compare the size statistic rather than mtime to avoid a race condition. posix: remove call to 5.2-only lua_tointegerx and simplify. * ext/posix/posix.c (interror): Remove, and fold functionality from here... (checkinteger): ...to here. (argtypeerror): Simplify accordingly. specs: don't fail tty tests when run from /dev/console * specs/posix_spec.yaml (ttyname): Allow /dev/console. posix: enforce argument types for clock_getres and clock_gettime. * ext/posix/posix.c (Pclock_getres, Pclock_gettime): Use luaL_checkstring instead of lua_tostring to enforce argument type checking. 2014-10-05 Gary V. Vaughan posix: add posix.IPPROTO_UDP. * ext/posix/posix.c: Add IPPROTO_UDP definition. doc: improve posix LDocs. * expt/posix/posix.c: Use [opt] annotations, and add missing manual references. configury: remove duplicated SPECL_ENV settings. * specs/specs.mk (SPECL_ENV): Remove - these same valuas are already propagated automatically by slingshot. posix: show correct argument errors for fadvise and setsockopt. * ext/posix/posix.c (Pfadvise): Use checkint rather than luaL_checkinteger for correct argument error formatting. (Psetsockopt): Likewise for luaL_checknumber. slingshot: sync with upstream for SPECL_ENV improvements. * slingshot: Sync with upstream. * specs/specs.mk (SPECL_ENV): Set according to slingshot recommendations. * specs/specs_helper.lua (package.path): Likewise. posix: argument errors overhaul. * specs/spec_helper.lua (bind, init): Remove. * specs/lposix_spec.yaml, specs/posix_spec.yaml: Specify argument error diagnostics for all APIs. * ext/posix/posix.c: Use checknargs, or other means to diagnose argument type and arity errors for all APIs. * NEWS: Update. maint: reformat for consistency and GNU style function headers. * ext/posix/posix.c: Put function return types on a separate line for easy function name grepping; don't use cuddle braces; indent case branches one tab; exdent labels one tab; don't put a space between function call and arguments; do put a space between flow control keyword and arguments. maint: add buildreq tools to bootstrap.conf. * bootstrap.conf (buildreq): List bootstrap build requirements. 2014-10-01 Gary V. Vaughan docs: move lseek, sync and nice to the correct sections. * ext/posix/posix.c (lseek): Move to "File descriptors" section. (sync): Move to "File system" section. (nice): Move to "Process management" section. maint: fix a type name typo. * ext/posix/posix.c (poll_fd_list_from_table): Replace missing 'e' in lua_State from last commit. maint: reformat for consistency. * ext/posix/posix.c: Use TAB indents, comma-space argument separators and function declarations all-on-one-line consistently. doc: modernize LDocs. * ext/posix/posix.c (Pgetopt, Ppoll, Pfcntl, Pdirname, Pfnmatch) (Pglob, Psymlink, Paccess, Pfadvise, Pumask, Putime, Pwaitpid) (Psetlogmask): Modernize LDocs. doc: use correct manual references for isprint and isgraph. * ext/posix/posix.c (isgraph, isprint): Use correct manual page references. 2014-09-21 Gary V. Vaughan specs: expect sockaddr.groups type to be number, not string. * specs/posix_spec.yaml (bind, connect, sendto): Expect correct type for AF_NETLINK socket groups field. Merge branch 'zevv-sockaddr-errors' posix: provide idiomatic argument errors from sockaddr calls. * specs/spec_helper.lua (init): New helper to return a partial application of expected argument error call. * specs/posix_spec.yaml (bind, connect, sendto): Use it to specify expected bad argument errors. * ext/posix/posix.c (try_getfield): Move from here... (checkfieldtype): ...to here. Lua functions normally throw an error for bad arguments, so do that for posix API argument errors too. (sockaddr_from_lua): Use it. Provide a default case branch to report unsupported socket family arguments. (checknargs): Throw an error for too many arguments. (Pbind, Pconnect, Psendto): Use it. Revert to reporting invalid socket address if sockaddr_from_lua fails without diagnosing a type error. 2014-09-20 Ico Doornekamp posix: add better error reporting on sockaddr table member fields. * ext/posix/posix.c (try_getfield): New function. Wrap `lua_getfield`, but push more accurate error diagnostics in case of type mismatch. (sockaddr_from_lua, Pconnect, Pbind, Psendto): Use it. 2014-08-26 Gary V. Vaughan slingshot: synch with upstream, for slack integrations. * slingshot: Synch with upstream. * .slackid: Add slack id. * .travis.yml: Regenerate. Merge branch 'hjelmeland-f_sched_setscheduler' posix: tidy up rt_sched patches for merging. * configure.ac (AC_CHECK_FUNCS): Add sched_getscheduler and sched_setscheduler. * ext/posix/posix.c (Psched_setscheduler, Psched_getscheduler): Improve compilation guards to also require HAVE_SCHED_GETSCHEDULER and HAVE_SCHED_SETSCHEDULER before exposing to Lua. * examples/rt_sched.lua: Remove trailing tabs. 2014-08-26 Egil Hjelmeland whitespace polish whitespace polish Added sched_setscheduler example/test Use ifdef _POSIX_PRIORITY_SCHEDULING to protect sched_setscheduler merge upstream 2014-08-19 Gary V. Vaughan posix: support IPC_NOWAIT constant. Closes #140. * ext/posix/posix.c (luaopen_posix_c): Add IPC_NOWAIT constant. Reported by Bernd Eggink. 2014-07-31 Gary V. Vaughan travis: use luarocks beta with rocks.moonscript.org. * .travis.yml: Regenerate with latest slingshot. maint: upgrade slingshot to work even when luarocks.org is down. * slingshot: Upgrade to latest upstream. doc: update luarocks install instructions. * README.md (Installation): Update to reference moonscript rocks repository, which has better uptime than the default luarocks domain used by released LuaRocks. 2014-07-26 Egil Hjelmeland Added sched_setscheduler()/sched_getscheduler() 2014-07-17 Gary V. Vaughan Merge branch 'waffle-iron-master' 2014-07-17 Making GitHub Delicious. add waffle.io badge 2014-06-29 Gary V. Vaughan refactor: move common spec initialisation to spec_helper.lua. This also allows running the latest (unreleased) specl directly from the bulid directory without having to call `make check`. * specs/spec_helper.lua: New file. Set package.path and package.cpath so that specl can find specified modules without LUA_PATH and LUA_CPATH. Add common code... * specs/lposix_spec.yaml, specs/posix_spec.yaml: ...from here. * specs/specs.mk (EXTRA_DIST): Add specs/spec_helper.lua. posix: move creat from Lua to C. Better support for projects that copy posix.c into their own tree and compile directly. * lib/posix.lua (creat): Move from here... * ext/posix/posix.c (creat): ...to here. * NEWS: Update. 2014-06-28 Gary V. Vaughan posix: tighten up readlink call. * specs/posix_spec.yaml (readlink): New specifications for readlink behaviours and error handling. * ext/posix/posix.c (Preadlink): Implement better error handling, and robustness. * NEWS: Update. posix: wrap stat and lstat correctly. * specs/posix_spec.yaml (describe stat): Adjust specs for correct behaviour of stat. (describe lstat): New examples to specify behaviour of new lstat wrapper. * ext/posix/posix.c (Pstat): Call stat(2), not lstat(2)! (Plstat): New wrapper for lstat(2). (R): Add Plstat. * NEWS: Update. 2014-05-30 Gary V. Vaughan maint: post-release administrivia. * configure.ac (AC_INIT): Bump release number to 33. * NEWS: Add header line for next release. * .prev-version: Record previous version. * ./local.mk (old_NEWS_hash): Auto-update. Release version 32 * NEWS: Record release date. 2014-05-25 Gary V. Vaughan maint: bump copyright to include 2014. * COPYING: Bump copyright years to include 2014. travis: ignore CVE-2012-3386 failure on Ubuntu Precise. Travis runs on Ubuntu 12.04 LTS, which ships an automake old enough to still be vulnerable... but we're running CI checks here, so that shouldn't fail the whole build! * .travis.yml: Skip CVE-2012-3386 check. travis: ensure sanity-checks don't back up before a release. * .travis.yml: Append `make syntax-check` to prevent sanity erosion! posix: avoid spurious parens in cpp directives. * ext/posix/posix.c: Remove some spurious parentheses in ifdef statements. posix: use strlcpy instead of broken strncpy. * ext/curses/strlcpy.c: Move from here... * ext/include/strlcpy.c: ...to here. (strlcpy): Declare static to prevent symbol clashes. * local.mk (ext_curses_curses_c_la_CPPFLAGS): Remove. strlcpy is now in existing header directory. * build-aux/sanity-cfg.mk: Adjust strlcpy path references. * ext/posix/posix.c: Include strlcpy.c. (sockaddr_from_lua, Psetsockopt): Use strlcpy to avoid security and safety problems with strncpy. maint: remove spurious trailing blank lines. * examples/netlink-uevent.lua, examples/ping.lua: Remove spurious trailing blank lines. configury: exclude ext/posix/posix.c from file_system check. * build-aux/sanity-cfg.mk (sc_file_system): Exclude ext/posix/posix.c. doc: add missing termios api LDocs. * ext/posix/posix.c (tcdrain, tcflow, tcflush, tcgetattr) (tcsendbreak, tcsetattr): Add missing LDoc api headers. * NEWS: Update. doc: add missing socket api LDocs. * ext/posix/posix.c (accept, bind, connect, getaddrinfo, listen) (recv, recvfrom, send, sendto, setsockopt, shutdown, socket) (socketpair): Add missing LDoc api headers. * NEWS: Update. maint: `P` function prefix is for Published APIs exposed to Lua. Naming a C function with a leading `P` indicates that it is published to Lua. Rename some functions that are not named according to this scheme. * ext/posix/posix.c (Ppoll_event_map) (Ppoll_events_createtable, Ppoll_events_from_table) (Ppoll_events_to_table, Ppoll_fd_list_check_table) (Ppoll_fd_list_from_table, Ppoll_fd_list_to_table): Rename from these... (poll_event_map, poll_events_createtable, poll_events_from_table) (poll_events_to_table, poll_fd_list_check_table) (poll_fd_list_from_table, poll_fd_list_to_table): ...to these. Adjust all callers. tests: remove spurious tests-termios.lua. * tests-termios.lua: Remove. The existing examples/termios.lua demonstrates more functionality. docs: reorder posix.c and break into groups of named functions. * build-aux/config.ld.in (sort): Alphabetize documentation within sections. * ext/posix/posix.c: Add section blocks for related functions and move declarations into appropriate sections. slingshot: sync with upstream. * slingshot: Sync with upstream, particularly for datarootdir fixes that make docs visible with `luarocks doc luaposix`. * bootstrap.conf (slingshot_files): Remove m4/ax_compare_version.m4. * .gitignore: Update. doc: show LDocs for lib/posix.lua and lib/posix/sys.lua. * ext/posix/config.ld: Move from here... * build-aux/config.ld.in: ...to here. (title): Add Package name and version. (file): Add lib/posix.lua and lib/posix/sys.lua. (merge): Set to true to combine LDocs for lib/posix.lua and ext/posix/posix.c into a single document module. (format): Change from discount to markdown. * ext/posix/posix.c (@module): Change to `posix` to merge with lib/posix.lua. * lib/posix.lua: Add `@module posix` declaration. * lib/posix/sys.lua: Add `@module posix.sys` declaration. (euidaccess, spawn, timeradd): Fix LDoc formatting errors. * local.mk (examplesdir, modulesdir): New subdirectory locations for generated documentation to install to. (dist_examples_DATA): List generated examples files explicitly to avoid GNU make dependency on $(wildcard) expansion. (dist_modules_DATA): Add doc/modules/posix.html and doc/modules/posix.sys.html. (dist_data_DATA): Replace this... (dist_lua_DATA): ...with this (luaposixdir): Subdirectory for sys.lua to install to. (dist_luaposix_DATA): Add lib/posix/sys.lua. ($(dist_doc_DATA)): Fix LDoc invocation for new config.ld location. (doc): Add $(dist_examples_DATA) and $(dist_modules_DATA) dependencies. (EXTRA_DIST): Add missing examples files. Change location of config.ld. (MAINTAINERCLEANFILES): Add $(dist_examples_data) and $(dist_modules_DATA). * NEWS: Update. sys: new submodule for non-POSIX apis. Close #73 * lib/posix.lua (list, euidaccess, pipeline, pipeline_iterator) (pipeline_slurp, spawn, timeradd, timersub): Move from here... * lib/posix/sys.lua (list, euidaccess, pipeline) (pipeline_iterator, pipeline_slurp, spawn, timeradd, timersub): New file. ...to here. * lib/posix.lua (__index): Attempt to load a suitably named submodule to satisfy missing keys. * NEWS: Update. 2014-05-24 Gary V. Vaughan docs: add some formatting consistency. * ext/posix/posix.c: Escape underscores for markdown processing where necessary to avoid spurious italics, and try to be more consistent with string examples in double quotes and constants in fixed width font. posix: fix gettimeofday LDocs to match API. Fix #133. * ext/posix/posix.c (Pgettimeofday): Has returned a Lua table with `sec` and `usec` fields for quite some time... make sure the LDocs reflect that! 2014-05-21 Gary V. Vaughan specs: check fork() child processes in parent process. Close #110. * specs/posix_spec.yaml (fork): Running expect in the forked specl child process has no effect on the state and reporting in the parent. Write the results from the child into a shared pipe and check them in the parent instead. Merge pull request 122 from cathalgarvey/luaposix Almost entirely rewritten to be lighter, correctly formatted, and to work when the host has no posix_advise implementation. Merge pull request #122 from cathalgarvey/luaposix Entirely rewritten. configury: add back net/if.h accidentally removed in merge conflict. * configure.ac (AC_CHECK_HEADERS): Add back net/if.h. examples: predicate ping example on p.SO_BINDTODEVICE. * examples/ping.lua: If either p.SOCK_RAW or p.SO_BINDTODEVICE are not defined, then the underlying OS libraries didn't have the necessary functionality for luaposix to bind to... so skip the example in that case. Merge pull request #132 from zevv/ping. posix: add support for netlink sockets with uevent netlink example. 2014-05-21 Gary V. Vaughan Merge branch 'netlink' of github.com:zevv/luaposix into zevv-netlink Conflicts: configure.ac ext/posix/posix.c 2014-05-21 Gary V. Vaughan Merge pull request #131 from zevv/ping posix: add SOCK_RAW, IPPROTO_ICMP and SO_BINDTODEVICE support. 2014-05-21 Ico Doornekamp Added support for netlink sockets with small uevent netlink example Added SOCK_RAW, IPPROTO_ICMP and SO_BINDTODEVICE; this allows sending and receiving of raw icmp (e.g. ping) packets from lua 2014-05-21 Gary V. Vaughan posix: add Debug priority to syslog LDocs. * ext/posix/posix.c (syslog): Add Debug priority to LDocs. posix: include strings.h for strcasecmp declaration. * configure.ac (AC_CHECK_HEADERS): Add strings.h. * ext/posix/posix.c (strings.h): If the host system is POSIX compliant enough to ship this header, include it for a strcasecmp declaration. posix: FreeBSD 10 doesn't define O_DSYNC. * ext/posix/posix.c (O_DSYNC): Set a fallback definition of 0. 2014-05-21 Gary V. Vaughan Merge pull request #128 from ittner/fix-getopt-ldoc-warning doc: Remove ldoc warning for getopt @see 2014-05-21 Gary V. Vaughan travis: update scripts from slingshot. * .travis.yml: Regenerate with latest slingshot for a slew of improvements. NEWS: Update. * NEWS: Update. gnulib: sync with upstream. * gnulib: Update to latest master. slingshot: sync with upstream. * slingshot: Sync with upstream for grep GNUism fix. * bootstrap: Sync with slingshot/bootstrap. * .travis.yml: Regenerate. 2014-05-11 Alexandre Erwin Ittner doc: Remove ldoc warning for getopt @see 2014-03-14 Reuben Thomas openpty: add missing posix. prefix to call of close 2014-01-05 Gary V. Vaughan slingshot: sync with upstream. Fix the annoying contest.sed file dropping bug. * slingshot: Sync with upstream. * bootstrap: Sync with slingshot. 2014-01-04 Gary V. Vaughan maint: update copyright notices to include 2014. * .x-update-copyright: New file. Exclude files not owned by this project from update-copyright rules. * build-aux/.gitignore: Add update-copyright. * bootstrap.conf, configure.ac, local.mk: Bump copyright year. slingshot: sync with upstream, and simplify accordingly. * slingshot: Sync with upstream. * bootstrap: Update from slingshot. * bootstrap.slingshot: Remove, no longer required. * bootstrap.conf: Remove bootstrap.slingshot source boilerplate. (luaposix_force_readme): Remove. Automated by slingshot now. * .gitignore: Update. * .travis.yml: Until github.com/stevedonovan/LDoc catches up with require fixes for luaposix, use gvvaughan/LDoc on Travis. 2013-12-11 Gary V. Vaughan doc: add missing LDoc function tag. * ext/posix/posix.c (strptime): Add missing @function tag. doc: fix LDoc manual page custom_see_handler pattern. * ext/posix/config.ld (custom_see_handler): Add a missing closing `%)`. (upat): Pull the format string up per LDoc documentation. slingshot: sync with upstream. * slingshot: Update from latest upstream, particularly for an empty table access fix in mkrockspecs. doc: move DateTime functions back to their own LDoc section. (Fix #119) * ext/posix/posix.c: Move Date and Time functions back to the end of the implementation functions to avoid picking up non- datetime related functions in the generated LDoc docs. slingshot: sync with upstream. * slingshot: Update to latest upstream revision, particularly to pick up fixes for changes in Travis wrt. libyaml.so location. * .travis.yml: Regenerate. 2013-12-11 Gary V. Vaughan Merge pull request #121 from zevv/socketpair Added socketpair() and AF_UNIX domain Merge pull request #120 from craigbarnes/treefix Avoid unnecessary table creation and unpacking in examples/tree.lua Merge pull request #118 from craigbarnes/linkfix Fix typo in readme Merge pull request #117 from fperrad/master fix without IPv6 2013-11-25 Cathal Garvey Added Pfadvise and constant advise values. Untested. 2013-10-31 Ico Doornekamp Added socketpair() and AF_UNIX domain 2013-09-21 Craig Barnes Avoid unnecessary table creation and unpacking in examples/tree.lua Fix typo in LuaRocks URL 2013-09-20 Francois Perrad fix without IPv6 2013-09-13 Gary V. Vaughan slingshot: sync with upstream. * slingshot: Update to latest revision, particularly to get the fix for release announcement content. 2013-09-09 Gary V. Vaughan maint: post-release administrivia. * configure.ac (AC_INIT): Bump revision to 32. * NEWS: Add header line for next release. * .prev-version: Record previous version. * ./local.mk (old_NEWS_hash): Auto-update. Release version 31 * NEWS: Record release date. slingshot: sync with upstream. * slingshot: Update to latest version for recent bootstrap fixes, among others. * bootstrap: Regenerate. maint: update NEWS. * NEWS: Update with user visible changes since previous release. posix: fix a typo in tc[gs]etattr constant definitions. * ext/posix/posix.c (VTOP): Changed spelling from this... (VSTOP): ...to this. maint: bump revision to 31. * configure.ac (AC_INIT): Bump release revision to 31. maint: remove trailing spaces added by previous merge. * ext/posix/posix.c (Ptcsetattr, Ptcgetattr): Remove trailing whitespace. 2013-09-07 Gary V. Vaughan Merge pull request #116 from zevv/termios-cc-flags Added missing termios cc flags 2013-09-03 Ico Doornekamp all termios c_cc flags available are now used in tcgetattr() and tcsetattr(), even though no symbols may be available for each flag. this makes sure a tcsetattr() after a tcgetattr() preserves all flags, even the non POSIX cmplient ones 2013-09-02 Ico Doornekamp Added missing termios cc flags 2013-08-29 Gary V. Vaughan maint: post-release administrivia. * NEWS: Add header line for next release. * .prev-version: Record previous version. * ./local.mk (old_NEWS_hash): Auto-update. Release version 30 * NEWS: Record release date. maint: update NEWS. * NEWS: Update with user visible changes since previous release. boostrap: sync with upstream. This version fixes some cosmetic and CLI inconsistencies, as well as improving portability to BSDs. * bootstrap: sync with upstream. configury: don't nuke the lib subdirectory. Now that we've made use of lib for Lua library files, make sure not to let gnulib-tool scribble in it. * bootstrap.conf (source_base): Tell gnulib-tool to put its empty library directory somewhere harmless. (luaposix_remove_empty_lib): And then remove that. maint: reorganise sources into subdirectories. Rather than dump everything into the project root directory indiscriminately, move extension modules into subdirectories of a new 'ext/' subdirectory, Lua libraries into 'lib/'. And adjust the build system to work with that layout. * lua52compat.h: Move from here... * ext/include/lua52compat.h: ...to here. * local.mk (AM_CPPFLAGS): Add -I ext/include. * lcurses.c, strlcpy.c, curses.lua: Move from here... * ext/curses/curses.c, ext/curses/strlcpy.c, lib/curses.lua: ...to here. * lposix.c, posix.lua: Move from here... * ext/posix/posix.c, lib/posix.lua: ...to here. * configure.ac (AM_INIT_AUTOMAKE): Add subdir-objects for future compatibility with Automake 2.0. (WANTEDLIBS, WANTEDLUA): Adjust paths. * local.mk (std_cpath, std_path, EXTRA_LTLIBRARIES, lib_LTLIBRARIES) (dist_data_DATA, dist_doc_DATA, EXTRA_DIST): Likewise. * tree.lua: Move from here... * examples/tree.lua: ...to here. * make_lcurses_doc.pl, config.ld: Move from here... * build-aux/make_lcurses_doc.pl, ext/posix/config.ld: ...to here, and adjust for relative path changes. * dummy.c: No longer used. Remove. * build-aux/sanity-cfg.mk: Remove references to dummy.c. Adjust for relative path changes. * .gitignore: Update. examples: error messages are not capitalized. * examples/lock.lua: Don't capitalize error messages. Discovered by 'make syntax-check' 2013-08-27 Gary V. Vaughan posix: remember to register Pshutdown function. * lposix.c (R): Add Pshutdown MENTRY. posix: remove unused variables. * lposix.c (Precvfrom): Remove unused host and serv variables. (Paccept): Likewise, and remove unused r as well. posix: mark unused parameters for gcc. * lposix.c (UNUSED): New macro, expands to __unused__ with GNU C. (FgetID, Fsysconf, Pcloselog, Psync): Use it to mark unused function parameters. posix: report correct bad option number. * lposix.c (badoption): Report the passed option number as being the bad option. 2013-08-27 Gary V. Vaughan Merge pull request #114 from GranPC/patch-1 Fix repeated "Test ipv4" instead of "Test ipv6" 2013-08-27 Gary V. Vaughan docs: fix typo in chdir ldoc comments. * lposix.c (Pchdir): Supply a valid usage example. Closes issue #113. Reported by Craig Barnes. 2013-08-26 Gary V. Vaughan Merge pull request #112 from craigbarnes/master Fix and clean up Markdown formatting in README 2013-08-26 Enrico Tassi posix: port getcwd to Hurd. * lposix.c (Pgetcwd): Use get_current_dir_name function on Hurd. 2013-08-26 Gary V. Vaughan maint: git ignore build-aux/compile. * build-aux/.gitignore: Add compile. configury: don't use unicode characters in shell comments. * configure.ac: Replace unicode apostrophes with ASCII equivalents. typo: set the configure package version correctly. * configure.ac (AC_INIT): The correct release number is 30. posix: improve portability of constant definitions. Rather than try to catalog what compiler/OS releases supply what constant symbols in their headers with a rats nest of `#if __BSD` etc, wrap all of the contentious preprocessor defines in matching `#ifdefs` so that they are only provided by luaposix in the environments that define them. This should provide much better future portability to new compiler/OS combinations. * lposix.c (lua_open_posix_c): Simplify the declarations by using a consistent MENTRY definition. Except for extremely well-known groups of symbols, and groups that are already inside _POSIX_VERSION >= 200112L guards, wrap each constant declaration in a matching `#ifdef`. 2013-08-12 GranPC Fix repeated "Test ipv4" instead of "Test ipv6" 2013-08-10 Alexander V. Nikolaev Merge pull request #111 from markgurevich/mg/2625/file-locks-v2 Lock or unlock files with fcntl() 2013-08-08 Craig Barnes Fix and clean up Markdown formatting in README.md 2013-07-24 Mark Gurevich Lock or unlock files with fcntl() 2013-06-27 Gary V. Vaughan typo: fix target URL of Travis badge link in README.md. * README.md: Fix target URL of Travis badge link. maint: post-release administrivia. * NEWS: Add header line for next release. * .prev-version: Record previous version. * ./local.mk (old_NEWS_hash): Auto-update. * configure.ac (AC_INIT): Bump revision to 30. Release version 29 * NEWS: Record release date. configury: distribute config.ld. * local.mk (EXTRA_DIST): Add config.ld, and various example files. slingshot: update. * slingshot: Update to version with spurious gitmodule output from sanity checks fixed, and improved release branch cleanup. configury: run automake without --foreign flag. * configure.ac (AM_INIT_AUTOMAKE): Remove foreign. * bootstrap.conf (luaposix_force_changelog, luaposix_finish): Remove. Bootstrap handles this automatically. (luaposix_force_readme): Distribute README file. * .gitignore: Add README. curses: remove trailing whitespace. * lcurses.c (Wresize): Remove trailing whitespace. NEWS: update. 2013-06-27 Gary V. Vaughan Merge pull request #105 from aeron005/master Added wresize binding in curses library 2013-06-27 Gary V. Vaughan slingshot: update. * slingshot: Update to version with ax_lua.m4 cross compilation fix. Reported by Reuben Thomas. Closes #98. 2013-06-27 Gary V. Vaughan sync, fsync, fdatasync, nice, lseek: a bunch of new calls. * lposix.c (Psync, Pfsync, Pfdatasync): Wrap disk synchronisation calls. (Pnice): New call. Change process priority. (Plseek): New call. Move current position of a file discriptor. * specs/posix_spec.yaml (sync, fsync, fdatasync): New pending expectations. (nice, lseek): Specify basic behaviour of these new calls. Submitted by zevv@github.com, from a patch by Ico Doornekamp. Closes #93. 2013-06-27 Gary V. Vaughan specs: convert socket tests from issue #92 to specl. * specs/posix_spec.yaml (socket handling): New spec, not working on Mountain Lion, at least :( Awaiting feedback, see issue #92. Reported by zevv@github, from a patch by Ico Doornekamp. specs: replace racy posix.times specs with more robust implementation. * specs/posix_spec.yaml (time accounting): Note the inconsistency between posix.times() and posix.times (...all keys...) from issue #107, and replace racy spec for posix.times(). 2013-06-27 Gary V. Vaughan docs: fix typo in clock_gettime ldoc comments. * lposix.c (Pclock_gettime): Fix a cut-n-paste duplication typo. Reported by Steve Donovan. Closes #104. 2013-06-27 Gary V. Vaughan slingshot: update. * slingshot: Update. * configure.ac (SS_CONFIG_TRAVIS): Remove luafilesystem now that slingshot takes care of ldoc prerequisites. * .travis.yml: Regenerate. * .gitignore: Ignore doc directory rather than docs, as latest ldoc seems to be putting files in the former now. travis: regenerate .travis.yml. .travis.yml: Regenerate. configury: travis builds with 5.2 require luafilesystem rock. * configure.ac (SS_CONFIG_TRAVIS): Add luafilesystem to extra rocks list. configury: bump SPECL_MIN to 8. * configure.ac (SPECL_MIN): Bump to 8, because we're using the Specl 8 hell.spawn APIs now. typo: the documentation directory is called doc, not docs! * local.mk (dist_doc_DATA, MAINTAINERCLEANFILES): Use correctly spelled 'doc' instead of previous typo, 'docs'. specl: update to Specl 8 changes in hell.spawn. * specs/posix_spec.yaml: Specl 8 no longer copies table entries from require results into environments automatically, so make sure we capture the table, and then use qualified access to spawn. slingshot: update. * slingshot: Update. * bootstrap.slingshot: Install latest revision. 2013-05-23 aeron005 Added binding for wresize to curses library 2013-05-09 Gary V. Vaughan Revert "Release version 29" This reverts commit bfce2bc28a5a5f675e4b6f7ef790bcdbfba15aad. syntax-check: remove trailing whitespace. * build-aux/sanity-cfg.mk (error-message-uppercase): Exclude examples/socket.lua, which otherwise triggers false positives. * NEWS, examples/socket.lua, examples/termios.lua, lposix.c: Remove trailing whitespace. Release version 29 * NEWS: Record release date. configury: distribute INSTALL for autotools instructions. * bootstrap.conf (gnulib_non_module_files): Add doc/INSTALL. typo: use correct spelling of prefix in README.md. * README.md: s/perfix/prefix/g 2013-05-09 Gary V. Vaughan Merge pull request #99 from zevv/fix-dir-example Fixed dir example for 5.2 Merge pull request #96 from zevv/fix-glob-example Fixed glob example Merge pull request #100 from zevv/add-b57600 Added missing 57k6 baudrate to termios table Merge pull request #95 from zevv/fix-poll I broke poll with commit 8deb0ebd041ab6d4761f86a7a906dd850111bae7 Merge pull request #94 from zevv/fix-poll-example Fix poll example, open failed due to wrong 2nd argument type 2013-05-09 Gary V. Vaughan specs: add pending guards to weird Travis failures. * specs/posix_spec.yaml: Mark pending those examples inexplicably failing on Travis, per github issue #102. configury: bump release version to 29. * configure.ac (AC_INIT): Bump release version to 29. The '5.1.' prefix is a misnomer now tha we support Lua 5.2, and bumping the prefix to '5.2.' would be no better, since we support Lua 5.1 simultaneously, and 5.3 will be along one of these days. sanity: add configuration fragment with sanity exclusions. * build-aux/sanity-config.mk (sc_require_config_h) (sc_require_config_h_first): Exclude dummy.c and strlcpy.c, which are both included directly into another source file before compilation. * .gitignore, build-aux/.gitignore: Adjust. syntax-check: fix many tiny errors raised by sanity.mk. * config.ld: Remove trailing blank line. * lcurses.c, strlcpy.c: Remove useless preprocessor parens. * lcurses.c: Use the blessed `#include ` format. * local.mk: Remove leading space from SPACE-TAB sequence. * lposix.c (STREQ): Define to avoid using inverted strcmp logic. Also remove useless preprocessor parens, and trailing whitespace. * posix.lua, specs/posix_spec.yaml: Remove trailing whitespace. * specs/posix_spec.yaml: Use 'file system' in preference to .filesystem'. maint: collect previous release notes into NEWS. * NEWS: New file, required for the Slingshot release process. * local.mk (old_NEWS_hash): Update. 2013-05-09 Reuben Thomas specs: ttyname can contain 'pts' rather than 'tty' specs: fix some spec failures on Linux. * specs/posix_spec.yaml (uname): uname -a can display information that uname(2) does not return, so change the command to say explicitly what fields we want. 2013-05-09 Gary V. Vaughan specs: convert adhoc tests to specl specs. * tests-curses.lua: Remove. Move contents from here... * specs/curses_spec.yaml: New file. ...to here, and reformat. * tests-posix.lua: Remove. * specs/posix_spec.yaml: New file. Implement equivalent (or better!) specs here. * specs/specs.mk (specl_SPECS): Add new specs. specs: convert lunit fcntl checks to specl specs. * README: Remove reference to lunit. * tests-fcntl.lua: Remove. * specs/posix_lua_spec.yaml: New file with equivalent checks for Specl. * specs/specs.mk (specl_SPECS): Add specs/posix_lua_spec.yaml. * local.mk: Include specs/specs.mk. slingshot: adopt slingshot release mechanism. * README: Move from here... * README.md: ...to here. Adjust for GH Markdown. * GNUmakefile, Makefile.am, build-aux/mkrockspecs, m4/ax_compare_version.m4, m4/ax_lua.m4: Remove. These files are handled by slingshot now. * rockspecs.lua, m4/ax_with_prog.m4: Remove. No longer used. * bootstrap.slingshot: New file. Slingshot bootstrap plugin. * bootstrap.conf: Source it. * configure.ac: Adjust to drive slingshot processes. * local.mk: New file. Project local make rules. * rockspec.conf: New file. Slingshat rockspec template. * specs/specs.mk: Simplified. * .prev-version: Record previous version number. * .gitignore: Update. * .travis.yml: Regenerate. termios: remove deprecated legacy symbols. Don't write new code with these, they are not definied by stricly POSIX conformant hosts. See: http://pubs.opengroup.org/onlinepubs/009695399/basedefs/termios.h.html * lposix.c (XCASE, IUCLC, OUCLC): Remove. termios: make XSI extensions optional. Mac OS X is a POSIX conformant system, but does not implement all XSI extensions. Only create constant for XSI extensions if they are defined by the host system. See: http://pubs.opengroup.org/onlinepubs/009695399/basedefs/termios.h.html * lposix.c (CBAUD, EXTA, EXTB, ECHOCTL, ECHOPRT, ECHOKE, FLUSHO) (PENDIN): Wrap with preprocessor guards. (DEFECHO, LOBLK, SWTCH, VDISCARD, VDSUSP, VLNEXT, VREPRINT) (VSTATUS, VWERASE): Additional conditional XSI extensions. 2013-04-23 Ico Doornekamp Fixed dir example for 5.2 Added missing 57k6 baudrate to termios table 2013-04-17 Ico Doornekamp Fixed glob example, added missing 'posix ='. Also removed the readlink() part because /proc on linux violates posix and does not properly fill in st_size on lstat(), causing readlink() to fail with EINVAL. Fix poll example, open failed due to wrong 2nd argument type, probably from old lposix API? I broke poll with commit 8deb0ebd041ab6d4761f86a7a906dd850111bae7 The result is just fine for calling poll() only once, but breaks for subsequent calls to poll() when passing the same table. In this case, the events are not cleared from the revents table, causing false positives. 2013-04-16 Reuben Thomas Merge pull request #90 from zevv/getopt Rename getopt_long() to getopt(), long options are now optional. Merge pull request #91 from zevv/termios Moved tests-termios.lua to examples/termios.lua 2013-04-16 Ico Doornekamp Added minimal termios test. 2013-04-16 Reuben Thomas Mention where to look for other contributors. Merge pull request #82 from zevv/socket Added socket functions and test script 2013-04-16 Ico Doornekamp Changed getopt_long semantics, reorderd iterator return values, optarg is now string instead of number. This allows getopt_long to closely mimic getopt Renamed getopt_long to getopt, changed short options type from number to string, updated example Added POSIX socket functions and constants 2013-04-16 Reuben Thomas Merge pull request #83 from zevv/termios Added termios and test script 2013-04-16 Ico Doornekamp Added termios and test script 2013-04-14 Reuben Thomas Copy stdlib code into posix.lua, minimally modified Solves the discussion in already-closed issue #80, and closes pull request #88 and closes pull request #89. 2013-04-13 Reuben Thomas Merge pull request #85 from zevv/poll-only-triggered-revents poll only returns active events in revents table, increases performance Move require of std.list to correct place 2013-04-13 Ico Doornekamp Simplified lua_pushboolean() expression poll only returns active events in revents table, increases performance 2013-04-12 Reuben Thomas Require stdlib; fixes #80 2013-04-11 Reuben Thomas .gitignore: add TAGS lposix.c: fix lua_Alloc calls that free (they should pass the current size); fix a memory leak in msgrcv lposix.c: fix error-case space leak in Pread; fixes issue #78 2013-04-11 Gary V. Vaughan posix.lua: fix a typo in assert. * posix.lua (pipeline): t1 is not declared, use type of t in the assert error. 2013-03-28 Reuben Thomas lposix.c: change bogus @long tags to @int tags. lposix.c: add function line for pipe (was missing) Thanks to behoffski for the report. 2013-03-24 Reuben Thomas lposix.c: fix @function line of isprint (was wrongly "isgraph") Thanks to behoffski for the report. 2013-03-23 Reuben Thomas tests-posix.lua: fix pipeline test for VPATH build tests-posix.lua: fix pipeline test Should call pipeline_slurp, not pipeline_iterator to get whole output in one go. This has the nice side-effect of testing both pipeline_iterator and pipeline as well, as pipeline_slurp calls pipeline_iterator, which calls pipeline. 2013-03-20 Reuben Thomas Makefile.am: unset LUA_INIT_5_2 in calls to get information from woger. This is an ugly hack, but since it will work at least until the release of Lua 5.3, it's better than nothing. configure.ac: bump version to 5.1.28 Simplify and fix pipeline_iterator, and add a test. 2013-03-18 Reuben Thomas posix.lua: fix bug in posix.pipeline_iterator, where it always closed the pipe on first iteration 2013-03-17 Reuben Thomas configure.ac: bump version to 5.1.27 posix.lua: rename posix.system to posix.spawn, keeping old name as alias for now. 2013-03-16 Reuben Thomas Allow posix.system to take a function, a shell command, or a file and list of arguments. Use it in pipeline. Allow pipeline functions to take an extra parameter giving the function to use to make a pipe (e.g. so posix.openpty can be used instead). Change argument to a table rather than a list of tasks. 2013-03-14 Reuben Thomas posix.lua: tidy up pipeline and add pipeline_iterator and pipeline_slurp 2013-03-13 Reuben Thomas Merge pull request #72 from nmcveity/fix-5.1-compat Removed Lua 5.2 functions lua_len and lua_tointegerx COPYING: bump copyright year Add pipeline function to execute a pipeline of shell commands & Lua functions 2013-03-05 nmcveity Removed Lua 5.2 functions lua_len and lua_tointegerx This fixes issue #71. 2013-03-04 Reuben Thomas Makefile.am: stop making unnecessary ChangeLog. 2013-03-03 Reuben Thomas lposix.c: fix a space leak in realpath configure.ac: bump version to 5.1.26. lposix.c: change some @param's to @string where possible Add posix.realpath. lposix.c: add support for SA_* flags when establishing a signal handler 2013-03-02 Reuben Thomas posix.lua: add posix.openpty 2013-02-28 Reuben Thomas lposix.c: improve documentation of posix.read lposix.c: document posix.wait's return values properly lposix.c: add killpg 2013-02-20 Reuben Thomas Makefile.am: release directory should already be on release branch; remove checkout command Makefile.am: use simpler and more robust scheme of parallel checkout for checking in release code. Allow exec/execp arguments to be supplied as a table, including argv[0]. Closes #65. configure.ac: bump version to 5.1.25 Merge pull request #67 from zserge/master Support for message queues 2013-02-19 Reuben Thomas Merge pull request #68 from sam-github/pts-support Fix posix.openpt() requireing and ignoring a path. When no LDoc installed, create docs directory before touching files in it; fixes issue #66 2013-02-18 Sam Roberts Fix posix.openpt() requireing and ignoring a path. 2013-02-18 Serge Zaitsev added basic message queues support 2013-02-18 Reuben Thomas Merge pull request #58 from sam-github/pts-support Support Unix 98 style pseudoterminals, as specified in POSIX.1-2001 2013-02-18 Sam Roberts Tests for pseudoterminal support. 2013-02-17 Sam Roberts Support Unix 98 style pseudoterminals, as specified in POSIX.1-2001 Support consists of openpt(), ptsname(), grantpt(), and unlockpt(). The master fd can be created by calling openpt(), or by opening "/dev/ptmx" (as specified by POSIX). 2013-02-15 Reuben Thomas Makefile.am: fix woger command for new rockspec arrangement. Makefile.am: prevent unpacked sources being recursively checked in to release branch. Makefile.am: remove references to defunct files. rockspecs.lua: don't need to turn dots in version into dashes to get release tag. .gitignore: remove tarball pattern, as we no longer have tarballs. Revert 31671409e62e: bit32 doesn't build with Lua 5.2, so require luabitop instead. rockspecs.lua: fix a misnamed variable configury: add rockspec-generating files for git/release rockspecs. Makefile.am: remove obsolete definition of ROCKSPEC configure.ac: remove useless AC_SUBST calls for precious variables. tests-posix.lua: remove a debugging line. lposix.c: correct cross-reference to getopt.lua Bump version down to 5.1.24: we haven't made such a release yet configury: update for releasing on 'release' branch of github rather than via tarballs. Update ax_lua.m4 to latest: no code changes, formatting only. tests-posix.lua: remove commented-out test for non-POSIX putenv function Add STD{IN,OUT,ERR}_FILENO constants. Add isatty. 2013-02-12 Reuben Thomas Use bit32 (now available for 5.1) rather than luabitop: slightly simplifies things. 2013-02-11 Reuben Thomas lposix.c: Reuben Thomas is no longer the maintainer. m4/ax_compare_version.m4: add support file for ax_lua.m4 2013-02-07 Alexander V. Nikolaev Merge pull request #61 from gvvaughan/pull-request/maint-clean-ldocs-output configury: clean up ldoc droppings with make maintainer-clean Merge pull request #62 from gvvaughan/pull-request/remove-empty-lib-subdir gnulib: no need to link always empty libgnu. 2013-02-06 Reuben Thomas configury: update ax_lua.m4 to latest version, which simplifies configure.ac slightly. 2013-01-29 Gary V. Vaughan gnulib: no need to link always empty libgnu. Now that we have no C modules from gnulib, there's no need to build and link the always empty library any more. * Makefile.am (SUBDIRS): Remove. * configure.ac (AC_CONFIG_FILES): Remove lib/Makefile. * bootstrap.conf (gnulib_tool_options): Add --avoid=dummy to skip the one remaining empty gnulib C source file. (luaposix_remove_empty_lib): gnulib-tool now generates a useless lib subdirectory containing just a Makefile.am and .gitignore. We don't use or need it any more, so delete it. (luaposix_finish): Don't copy dummy.c out of gnulib. configury: clean up ldoc droppings with make maintainer-clean * Makefile.am (MAINTAINERCLEANFILES): Add docs/index.html and docs/ldoc.css. 2013-01-27 Alexander V. Nikolaev Merge pull request #59 from gvvaughan/pull-request/handle-missing-ldoc configury: handle missing ldoc binary. 2013-01-26 Gary V. Vaughan configury: handle missing ldoc binary. * configure.ac (LDOC): Set with AX_WITH_PROG. (HAVE_LDOC): New conditional. * Makefile.am (HTML): Fold into... (dist_doc_DATA): ...here. Run ldoc when available, otherwise touch the requried files to prevent build failure. 2013-01-10 Reuben Thomas Merge pull request #56 from gvvaughan/pull-request/curses-resizeterm-support curses: conditional resizeterm support. Merge pull request #55 from gvvaughan/pull-request/fix-waddstr-double-append-bug curses: don't waddstr() each string twice. Merge pull request #53 from gvvaughan/pull-request/remove-automake-werror configury: remove automake -Werror option. Merge pull request #52 from gvvaughan/pull-request/add-am-prog-ar configury: use AM_PROG_AR for automake 1.13. Merge pull request #50 from gvvaughan/pull-request/keep-gnulib-revision-under-version-control configury: keep gnulib revision under version control. Merge pull request #51 from gvvaughan/pull-request/sync-upstream-bootstrap bootstrap: sync with upstream. Merge pull request #54 from gvvaughan/pull-request/no-need-for-lt-output configury: no need to fork for libtool.m4 variables. 2013-01-10 Gary V. Vaughan curses: conditional resizeterm support. * configure.ac (AC_CHECK_FUNCS): Check whether resizeterm is implemented by the selected curses library. * lcurses.c (Cresizeterm): If it is, use it, otherwis throw an error to explain why not. (curseslib): Add it to the toplevel curses functions. curses: don't waddstr() each string twice. Fix a bug introduced by commit 5aa297512. * lcurses.c (Waddstr): Only add the string one time! configury: no need to fork for libtool.m4 variables. libtool.m4 is expanded into configure already, so the values are available after LT_INIT in configure.in without creating config.lt to copy the values we already have into an early libtool script, and then fork again to grep the content of those copies back into configure!! (LT_OUTPUT is only necessary if you need to run configure time compilation tests using the libtool script to wrap the actual compiler). * configure.ac (LT_OUTPUT): Remove. (shrext): shrext_cmds is already set by LT_INIT, so just use it without calling the early libtool script. configury: remove automake -Werror option. This option causes automake to bail out after warning about the use of gmake extensions. * configure.ac (AM_INIT_AUTOMAKE): Remove -Werror. bootstrap: sync with upstream. This revision fixes some small bugs, and is compatible with non-gnu awk and non-gnu sed again. * bootstrap: sync with upstream. configury: keep gnulib revision under version control. It's important to keep the gnulib revision number used by any particular checkout of luaposix under version control rather than hoping that whatever the current HEAD is will work. * .gitignore: Remove gnulib. * gnulib: Add current master revision. configury: use AM_PROG_AR for automake 1.13. * configure.ac (AM_PROG_AR): Required by recent automake releases, but not available in very old releases. 2012-12-24 Reuben Thomas configure.ac: fix regeneration of luaposix.rockspec 2012-12-23 Reuben Thomas configure.ac: fix a comment luaposix.rockspec.in: remove redundant dir setting 2012-12-15 Alexander V. Nikolaev configure.ac: bump version to 5.1.25 rockspec: Add missing dependency for luabitop luaposix depends on bitop library on lua 5.1 since luaposix 5.1.16 2012-12-05 Alexander V. Nikolaev Merge pull request #48 from Keen-github/vs/2230/fix_hack_for_luaposix_compatibility Added 'day' field for compatibility to Lua os.date(); fixed issue #32. 2012-11-14 Valeriy Skurikhin Added 'day' field for compatibility to Lua os.date(); fixed issue #32. 2012-10-25 Reuben Thomas Use lstat to read size of a link (for Preadlink); fixes issue #47. 2012-10-17 Reuben Thomas configure.ac: bump version to 5.1.24 lcurses.c: don't run strlen unnecessarily; w[mv]addstr does that anyway 2012-10-04 Reuben Thomas Makefile.am: now that github-upload is fixed, consolidate release into a single target Makefile.am: correct github_user parameter to woger (thanks, Liam) release: luarocks-related tweaks Makefile.am: make check-luarock depend on the rockspec, as github seems to work after all release: automatically check the rockspec before making a release 2012-10-03 Reuben Thomas Make Lua 5.2-compatibility more Lua 5.2-ish. tree.lua: make Lua 5.2-compatible 2012-09-26 Reuben Thomas rockspec: make build_command more robust build: install documentation with 'make install' and from luarocks 2012-09-23 Reuben Thomas lposix.c: improve comment of mkstemp 2012-09-21 Reuben Thomas configure.ac: bump version to 5.1.23 2012-09-20 Reuben Thomas lcurses.c: define LUA_COMPAT_ALL to get luaL_register. 2012-09-13 Reuben Thomas dummy.c: fix copyright notice to be public domain version: bump to 5.1.22. gnulib: re-add dummy.c with correct license to fix Mac OS X build (issue #46) 2012-09-11 Reuben Thomas configure.ac: enable automake to generate dependencies for rockspec (thanks, Hisham Muhammad). 2012-09-07 Reuben Thomas Merge pull request #45 from wcmaier/fix/github-url Update Github URL. 2012-09-07 Will Maier Update Github URL. 2012-09-03 Reuben Thomas Bump version to 5.1.21. 2012-09-01 Reuben Thomas README: Add link to online HTML docs. README: Update location of repo and contact details. 2012-08-31 Reuben Thomas bootstrap.conf: no longer require now-defunct `missing' script. 2012-08-30 Reuben Thomas Add docstrings (using Steve Donovan's ldoc) to lposix.c The documentation comes from from Steve Donovan and the Alpine Linux wiki (Natanael Copa). Reindent Psignal, which was a bit out of order. Make rpoll use file descriptors, not Lua file objects, so it can be used with both (via fileno). 2012-06-28 Reuben Thomas Document dependency on bitop library with Lua 5.1 (thanks to Bernd Eggink). Remove documentation of configure options, one of which was obsolete. 2012-06-22 Reuben Thomas Simplify Lua 5.2 compatibility lposix.c: revert to using MYNAME, as it is different from PACKAGE. build: don't unset LUA_INIT, as it may be needed to set Lua paths. Update bug reporting advice (thanks, Yuri Takhteyev). 2012-06-21 Reuben Thomas Fix some incorrectly-named references to posix module. Simplify construction of messages with autoconf variables. 2012-06-05 Reuben Thomas build: don't include non-MIT-licensed dummy.c from gnulib (fixes issue #42). 2012-06-04 Reuben Thomas Merge pull request #41 from gvvaughan/pull-request/timer-macros gettimeofday: change format to a table with sec and usec fields. 2012-06-01 Gary V. Vaughan gettimeofday: replace C timer macros with lua equivalents. * lposix.c (Ptimeradd, Ptimercmp, Ptimersub): Remove. * posix.lua (timeradd, timercmp, timersub): New Lua equivalents to removed C implementations. 2012-05-29 Gary V. Vaughan gettimeofday: change format to a table with sec and usec fields. * lposix.c (Pgettimeofday): Return a single table with sec and usec fields, rather than a pair of numbers. (Ptimeradd, Ptimercmp, Ptimersub): New functions to emulate the macros timeradd, timercmp and timersub respectively. 2012-05-29 Reuben Thomas Merge pull request #40 from gvvaughan/pull-request/feature-tests-not-version-checks crypt: this function is available on darwin, but no crypt.h header is 2012-05-29 Gary V. Vaughan statvfs: check for actual presence of function and header. * configure.ac (sys/statvfs.h): Test for presence of this header. (statvfs): Test for availability of this API. * lposix.c (sys/statvfs.h): Include it, if configure found it. (Pstatvfs): Wrap statvfs if configure found the API. (R): List Pstatvfs if we wrapped it earlier. crypt: this function is available on darwin, but no crypt.h header is One of the main principles of Autoconf is that you should test for features, not for versions - exactly because of compilation problems like this, where Apple sets _POSIX_VERSION to make us think that crypt.h is available, but there is no crypt.h header. * configure.ac (crypt.h): Test for presence of this header. (crypt): If the crypt function is available, whether or not the additional -lcrypt library is required, define HAVE_CRYPT. * lposix.c (crypt.h): Include it if configure found it. (Pcrypt): Define it if configure detected a system crypt API. (R): List Pcrypt, if we defined it earlier. 2012-05-28 Reuben Thomas posix.lua: update call of posix.open to match new API. Add missing posix suffix to a call of access. Merge pull request #39 from stevedonovan/master Implement signal queue so signals arriving while in a Lua signal handler are not lost. 2012-05-28 Steve Donovan signal handling queue implemented 2012-05-23 Reuben Thomas Bump version to 5.1.20. getgroup: fix an off-by-one error (thanks, Steve Donovan) lposix.c: more minor whitespace fixes posix.lua: add a missing space (whitespace fix). system: Kill the fork if execp fails (thanks, Steve Donovan) lposix.c: require a mode for open with O_CREAT, and only then. tests: update for revised open API. lposix.c: minor whitespace fixes. lposix.c: make file & creation flags public; pass flags to open as an integer mask, not a table. 2012-05-22 Reuben Thomas Fix some comments. 2012-05-21 Reuben Thomas Remove non-POSIX crypt_r and replace function checks with POSIX version checks. Add a pointer to documentation and some basic coding principles. 2012-05-13 Reuben Thomas Update web site URL and be more explicit about system requirements. 2012-05-12 Alexander V. Nikolaev Rework test for glob() -- use temporary directory This allow us to not depend from *.la files from build. Simple tests for mkdtemp and mkstemp 2012-05-12 Your Name <7hemroc@gmail.com> Add mkdtemp() 2012-05-12 Alexander V. Nikolaev Memory leak in mkstemp Pmkstemp not release temporary string buffer, if mkstemp() raise an error 2012-05-12 Reuben Thomas Merge pull request #35 from likema/master Add statvfs and crypt_r. 2012-05-02 Reuben Thomas lcurses.c: Remove some casts to chtype that only cause trouble. strlcpy.c: add prototype to squash compiler warning. strlcpy.c: Make function declaration ANSI. 2012-04-30 Like Ma Add AC_USE_SYSTEM_EXTENSIONS to configure.ac for define _GNU_SOURCE in config.h.in 2012-04-23 Like Ma Merge remote-tracking branch 'upstream/master' 2012-04-11 Reuben Thomas Copy with -1 return for _PC_PATH_MAX. 2012-04-10 Reuben Thomas Bump version to 5.1.19. Replace LGPLed strlcpy with BSD licensed strlcpy, from http://opensource.apple.com/source/OpenSSH/OpenSSH-7.1/openssh/bsd-strlcpy.c 2012-04-08 Reuben Thomas Fix memory leaks introduced by fix to cope with arbitrary-length paths. 2012-04-05 Reuben Thomas Add tests for dirname and basename. Work with arbitrary-length paths. 2012-04-03 Reuben Thomas Remove XSR errno.h codes (thanks Enrico Tassi). 2012-03-26 Reuben Thomas Don't use gnulib sigaction module, as its license is incompatible; don't want COPYINGv3. Back to using only a double fork of lunit. 2012-03-25 Reuben Thomas README: Update URL to lunit: for now need my version. Makefile.am: tell lunit which Lua interpreter to use. tests-fcntl.lua: make them work with Lua 5.2. Improve documentation for use with Lua 5.2. Bump version to 5.1.18. posix.lua: make Lua 5.2-compatible. Make configure accept Lua 5.2. Add correct license, and refer to it in README. 2012-02-29 Reuben Thomas Bump version to 5.1.17. Return old C handler from signal, so it can be chained; fix masking of signals during Lua handler. 2012-02-21 Reuben Thomas Make curses module work with Lua 5.2 module system (patch by StarWing). 2012-02-18 Reuben Thomas Makefile.am: update woger call. Makefile.am: Update woger call. Makefile.am: add lua52compat.h to EXTRA_DIST. 2012-02-12 Reuben Thomas Merge pull request #28 from likema/HEAD~~ Use AC_SEARCH_LIBS instead of AC_CHECK_LIBS in configure.ac. 2012-02-11 Like Ma Use crypt_r instead of crypt if it exists for thread-safe. Add statvfs Use AC_SEARCH_LIBS instead of AC_CHECK_LIBS to fix function crypt not found when configuring. 2012-02-11 Reuben Thomas Fix bug in chmod (closes issue #55). Update ax_with_curses.m4. 2012-02-03 Reuben Thomas Remove some non-POSIX features. Remove non-standard memrchr. 2012-02-02 Reuben Thomas Fix signal handling so all signals are handled, one at a time. 2012-02-01 Reuben Thomas lposix.c: overhaul time struct functions; add mktime. lposix.c: fix whitespace typo. 2012-02-01 Reuben Thomas Overhaul use of numeric types going to Lua. Use lua_pushinteger rather than lua_pushnumber where it makes sense. In lcurses, use lua_pushboolean for all boolean quantities, and always return Lua booleans, not C booleans. Remove some unused function macros. 2012-02-01 Reuben Thomas Fix a docstring mistake: refer to os.execute, not os.system. 2012-01-31 Reuben Thomas Remove setting _POSIX_C_SOURCE on Darwin, as apparently this only restricts APIs, or instates obsolescent APIs. Remove some pointless quotes. Remove SIGPROF and SIGPOLL, which are marked obsolescent. 2012-01-27 Reuben Thomas curses: update ax_with_curses.m4 to latest version. 2012-01-17 Reuben Thomas In strftime, make isdst optional like all other fields. Add strptime. Simplify a lua_pushlstring call to a lua_pushstring call. Simplify hostid, making it return a number, not a string. Merge pull request #23 from hishamhm/master Add support of octal stat modes in mode_munch 2012-01-16 Hisham Muhammad Make octal_mode use strtol, as requested by rrthomas. 2011-12-29 Hisham Muhammad Add support of octal stat modes in mode_munch 2011-12-28 Reuben Thomas Update and make precise the versions of Lua catered to. Move Lua 5.2 compatibility into a separate file; use it in lcurses.c. Change version check to be “== 502” rather than “> 501” now that 5.2 is released and we have no idea what 5.3 or later will bring. Remove unused lua_setenv macro. Add memrchr. Add a comment explaining that posix.signal has sensible semantics. 2011-12-26 Reuben Thomas Fix an egregious bug in the previous commit which only updated a Lua handler when the previous handler was also a Lua function. Merge pull request #22 from gvvaughan/pull-request/expose-use_default_colors Pull request/expose use default colors Merge pull request #21 from gvvaughan/pull-request/refactor-lcurses-with-cpp refactor: use lposix-style macro splicing in lcurses. 2011-12-26 Gary V. Vaughan curses: expose use_default_colors to lua. * lcurses.c (Cuse_default_colors): Marshalling for use_default_colors. (curseslib): Add it. refactor: use lposix-style macro splicing in lcurses. Make the style of lcurses.c more like lposix.c, with the aid of splice and stringify macros, and judicious renaming to make their usage pattern the same too. * lcurses.c (LCURSES_SPLICE, LCURSES_STR, LCURSES_STR_1): Analagous to LPOSIX_SPLICE, LPOSIX_STR and LPOSIX_STR_1 respectively. (LC_NUMBER, LC_NUMBER2, LC_STRING, LC_STRING2, LC_BOOL) (LC_BOOL2, LC_BOOLOK, LC_BOOLOK2): Change prefix of generated functions from `lc_' to `C' so that LCURSES_STR_1 can be used idiomatically. (LCW_BOOLOK): Likewise, only changing from `lcw_' to `W' prefix. (LCW_BOOLOK2): New macre used when the curses symbol and the lua api have different names. (lcw_new, lcw_get, lcw_check, lc_checkch, lc_optch): Rename from these... (lc_newwin, lc_getwin, lc_checkwin, checkch, optch): ...to these, respectively, no need to namespace static symbols so carefully. Adjust all callers. (CC2): Remove. (CF): New macro for generating FN key exports into lua. Use it to export all 64 valid FN keys. (LCW_WIN2): New macro. (Wsyncup, Wcursyncup, Wsyncdown): Use it to define these functions. (LCW_WIN2YX): New macro. (Wgetyx, Wgetparyx, Wgetbegyx, getmaxyx): Use it to define these functions. (LC_ATTROK): New macro. (Cslk_attron, Cslk_attroff, Cslk_attrset): Use it to define these functions. (LC_TOGGLEOK): New macro. (Ccbreak, Cecho, Craw, Cnl): Use it to define these functions. (LCW_WINBOOLOK): New macro. (Wintrflush, Wmeta, Wnodelay, Widlok, Wleaveok, Wscrollok): Use it to define these functions. (LCW_WININTOK): New macro. (Wattroff, Wattron, Wattrset): Use it to define these functions. (chstrlib, windowlib, curseslib): Much simplified by naming implementation functions more carefully, and defining temporary MENTRY macro to expand and splice arguments that populate the tables. 2011-12-26 Reuben Thomas signal: Cope with C handler functions. Fix a bug in setting symbolic (SIG_IGN/DFL) handlers. Make setting handler to nil indistinguishable from setting to SIG_DFL. 2011-12-24 Reuben Thomas Explain why we don’t use an upvalue in an obvious situation. Redo signal API to be more conventional, allowing signal handlers to be reset (no __newindex nonsense). Use LPOSIX_STR_1 to prevent premature expansion of signal handler macro names. Merge pull request #20 from gvvaughan/pull-request/use-cpp-to-keep-symbols-in-sync refactor: use macro splicing for more tabulation. 2011-12-24 Gary V. Vaughan refactor: use macro splicing for more tabulation. This would have prevented the recent unsynced signal tables bug, but also use cpp metaprogramming to write more repetitive code that needs to stay in sync between various strings and symbols. * lposix.c (LPOSIX__STR): Remove +1 offset. (LPOSIX__STR_1, LPOSIX_STR_1): Better name for +1 offset stringification macros. Adjust all callers. (sigmacros_map): New cpp table of signal symbol basenames. (Ssigmacros, Fsigmacros): Generate from sigmacros_map. (R): Use cpp to keep lua symbols and C implementations in sync. (luaopen_posix_c): Replace each group of preprocessor exports with a cpp macro call to keep C API macro values and their lua symbol names in sync. 2011-12-23 Reuben Thomas Allow signal handlers to be set to nil (unset), as well as a function or macro. Bump version to 5.1.16. Clarify a NULL pointer. Remove non-POSIX SIG_IGN and SIG_HOLD. Fix some deviant indentation. 2011-11-18 Reuben Thomas Merge pull request #19 from spbnick/master Fix corner cases in Pread and Pgetgroups. Thanks to Nikolai Kondrashov. 2011-11-18 Nikolai Kondrashov Fix getgroups corner cases Fix getgroups memory deallocation by simply using lua_newuserdata instead of potentially mismatching lalloc/free pair. Handle getgroups(0, NULL) returning 0 - although practically impossible, documentation doesn't say it can't happen. Handle getgroups returning negative values (reporting errors). 2011-11-17 Nikolai Kondrashov Handle and report Pread allocation errors properly Report Pread buffer allocation errors with pusherror, account for allocation functions which don't modify errno. Handle allocation of zero bytes in Pread properly: don't consider returned NULL an error. Add some "air" into Pread formatting. 2011-10-28 Reuben Thomas Merge pull request #18 from ittner/fix-unused-var Remove unused variable (thanks, Alexandre Ittner). Merge pull request #17 from ittner/add-fnmatch Add function fnmatch() (thanks, Alexandre Ittner). 2011-10-27 Alexandre Erwin Ittner Remove unused variable in the poll interface Add function fnmatch() According to http://pubs.opengroup.org/onlinepubs/9699919799/functions/fnmatch.html plus GNU extensions (if available) 2011-10-25 Reuben Thomas Merge pull request #16 from spbnick/master Add full poll(2) interface 2011-10-22 Nikolai Kondrashov Add full poll(2) interface Rename Ppoll to Prpoll to match external name of "rpoll". Add full poll(2) interface under name "poll". The arguments to the "poll" function are fd->pollfd map and an optional timeout in milliseconds (default being -1, i.e. infinity). "Pollfd" is a table analogue of struct pollfd, with "event" and "revent" fields being tables with boolean fields corresponding to bits, named without "POLL" suffix. Example usage: local pollfd_map = { [fd1] = {events = {IN = true}}, [fd2] = {events = {IN = true}}, [fd3] = {events = {IN = true}} } while next(pollfd_map) ~= nil do local ready, errmsg = posix.poll(pollfd_map) if ready == nil then error(errmsg) end for fd, pollfd in pairs(polfd_map) do if pollfd.revents.IN or pollfd.revents.HUP then local input, errmsg, errno = posix.read(fd, 8) if input == nil then error(errmsg) elseif #input == 0 then pollfd_map[fd] = nil else print(tostring(fd) .. ":", input:byte(1, -1)) end end end end 2011-10-10 Alexander V. Nikolaev Don't leave status uninitialized SUSv4 states that &status is undefined if WNOHANG option is passed to waitpid and no processes are ready to be collected at the time of call. 2011-10-10 Alexander V. Nikolaev Fix bug -- posix.read returns wrong value Pread() is documented to return a single value, and pushed only one return value to stack, but it told Lua that it returns two values. Note that this change may existing workarounds and should be explicitly mentioned in release notes. 2011-10-10 Reuben Thomas Expose new fcntl function (oops!) and rewrite tests to use it. tests: Call fcntl tests with lunit (fixes issue #13); thanks Mikhail Gusarov. 2011-10-09 Reuben Thomas Rewrite fcntl support. * Remove fcntl table and special handlers for F_GET/SETFL. * Add instead a single fcntl functions, with constants for all the standard commands except for the file-locking commands (this would require support for struct flock). 2011-09-29 Reuben Thomas rockspec: move distribution & home page to github Makefile.am: update to latest woger Bump version to 5.1.15. tests: rename test_fcntl.lua -> tests-fcntl.lua for consistency tests: fix Lua paths and xargs usage to run tests correctly Fix license. Merge pull request #11 from avnik/feature-pipe-and-dup2 Add dup, pipe & more, from avnik. Thanks! 2011-09-27 Mikhail Gusarov Tests for fcntl (untested) 2011-09-25 Alexander V. Nikolaev Add setfl/getfl Access to functionality of fcntl(fd, F_GETFL) and fcntl(fd, F_SETFL, arg) 2011-09-23 Alexander V. Nikolaev Export WNOHANG to lua and pass options to wait Add pipe() and test Add dup/dup2 functions 2011-09-23 Reuben Thomas Makefile.am: replace literal name of package with $(PACKAGE) once more. 2011-09-19 Reuben Thomas Makefile.am: fix deps of the rockspec. Makefile.am: make release message shorter and more precise. Use $PACKAGE instead of luaposix. Fix distribution of rockspec source. Bump version to 5.1.14. Make some symbolic constants case-insensitive in Lua. configure.ac: use $PACKAGE rather than spelling out the name. Makefile.am: actually make rockspec on release 2011-09-17 Reuben Thomas Makefile.am: fixes for building with rockspec. Don’t put the fully expanded rockspec in EXTRA_DIST, as this creates a recursive dependency (on the distribution archive). Fix the extraction of the summary description from the rockspec. Whitespace fixes to reminder output at end of make release. 2011-09-17 Reuben Thomas rockspec: Find a remaining non-parametrized reference to the package name. rockspec: auto-generate (except for part of download URL, argh). 2011-09-16 Reuben Thomas Bump version to 5.1.13. tests-posix.lua: Fix glob test again; we seem to have no .o files, so use .la files. 2011-09-13 Reuben Thomas Don't build or install useless static libs or versioned symlinks. 2011-09-11 Reuben Thomas Update curses documentation for luaposix integration. 2011-09-10 Reuben Thomas configury: don’t try to guess install paths. Remove machinery for guessing non-standardized install paths, and instead expand documentation so it covers the standard Debian/Ubuntu case. 2011-09-09 Reuben Thomas .gitignore: Add distribution tarball. Merge pull request #10 from gvvaughan/pull-request/refactor-lookup_symbol-mappings refactor: lookup_symbol mappings with macro splicing 2011-09-09 Gary V. Vaughan refactor: lookup_symbol mappings with macro splicing Tabulate just the basename for each mapping, and then stringify with an offset, or splice in the prefix before macro expansion as each static table initializer is built by the preprocessor. 2011-09-09 Reuben Thomas Makefile.am: fix make distcheck. .gitignore: Add *.html and ChangeLog. Distribute tests. Distribute strlcpy.c. configury: Make building curses optional. Merge lcurses into luaposix. 2011-09-08 Reuben Thomas Merge pull request #9 from gvvaughan/pull-request/tabulate-lookup_symbol-mappings bugfix: tabulate lookup_symbol mappings 2011-09-08 Gary V. Vaughan bugfix: tabulate lookup_symbol mappings By keeping the map relationship explicitly in a macro expanded table, prevent: And in this case fix a bug in the earlier changeset 58f586b where they got out of sync. 2011-09-08 Reuben Thomas Merge pull request #8 from gvvaughan/pull-request/add-libcrypt-if-required configury: add libcrypt if required Merge pull request #7 from gvvaughan/pull-request/no-m4-quotes-in-configure-ac configury: no m4 quotes in configure.ac Merge pull request #6 from gvvaughan/pull-request/need-dummy-incase-gnulib-has-no-objects configury: need dummy module incase gnulib has no other objects Merge pull request #5 from gvvaughan/pull-request/let-bootstrap-conf-manage-gnulib-gitignore configury: let bootstrap.conf manage gnulib .gitignore Merge pull request #4 from gvvaughan/pull-request/darwin-has-no-o-rsync-definition portability: darwin has no O_RSYNC definition 2011-09-08 Gary V. Vaughan configury: add libcrypt if required When the crypt() function does not work unaided, try again by adding libcrypt to LIBS and substituting into Makefile.in. portability: darwin has no O_RSYNC definition configury: need dummy module incase gnulib has no other objects It's only safe to use --avoid=dummy when there will never be a libgnu.a built, i.e there are no other modules with C code, and thus the parent project is never linked with libgnu. 2011-09-08 Gary V. Vaughan configury: let bootstrap.conf manage gnulib .gitignore No need to check these files in when bootstrap.conf has functions to manage them automatically without creating merge conflicts. For this changeset to work properly, you'll need to `git clean -f -x -d` and then rerun bootstrap to generate a proper set of .gitignore files. 2011-09-08 Gary V. Vaughan configury: no m4 quotes in configure.ac Also, for the sake of forming good habits, keep the lvalua on the left of a comparison, and avoid the potential for uname returning something that test might interpret as an argument. 2011-09-07 Reuben Thomas lposix.c: Include config.h. Rename luaopen function to match new library name. Add missing quotes. Replace previous machinery for detecting extra cc and ld flags. autotoolize the build system. Add read and write. 2011-09-07 Reuben Thomas Add open and close. Generalise get_rlimit_const to lookup_symbol, and use it for open flags. Add a FIXME. 2011-09-06 Reuben Thomas Tidy up whitespace and comments a bit for consistency. 2011-06-20 Reuben Thomas Merge pull request #3 from jdegges/master Add nanosleep. 2011-06-20 Joey Degges Add nanosleep. 2011-06-04 Reuben Thomas Remove unneeded shim for luaL_register; Lua 5.2 still has compatibility code for this. 2011-05-11 Reuben Thomas Remove pushfile, which uses undocumented tricks which don’t work on LuaJIT, and hence dup, fdopen and pipe. Reformat test.lua a bit more consistently. Separate out Lua 5.2 compatibility. 2011-05-11 David Favro Ported to 5.2.0-alpha. * Lightly tested. * Conditional compilation, so remains backwards-compatible with 5.1. 2011-05-11 David Favro Makefile fix/enhancement. * Fixed incorrect version string in library. * Compiles with -O2 rather than no optimization. * Added 'debug' target. This may not work for non-GNU makes. 2011-05-11 David Favro Fixed bugs in dup(). * Fixed bug: segfault (null pointer dereference) in dup(x,nil). * Fixed bug: non-conforming mode "rw" changed to "w+". POSIX specifies "w+" or "r+" for read/write open. "rw" is incorrect and fails to open for writing on GNU libc's fdopen(). 2011-05-11 David Favro Updated test.lua and added new tests. * Removed deprecated constructs foreach(), getn(). * Added --no-times command-line option since that test is a bear to wait for. * Added new tests: dup(), fdopen(). 2011-04-27 Reuben Thomas Bump version to 5.1.11. Fix a typo which caused a buffer overrun. Bump version to 5.1.10. Fix typo in Pmkstemp. Fix possibly dangerous typos in mode_munch. Update maintainer and bump copyright year. Fix typo in error mesage. Add mkstemp. 2011-04-03 Gary V. Vaughan lposix.c: Widen the _XOPEN_REALTIME guards around CLOCK_MONOTONIC et.al. Several constants that are only defined with _XOPEN_REALTIME were referenced even when _XOPEN_REALTIME is -1. Makefile: Darwin needs -D_POSIX_C_SOURCE in order to define SIGPOLL 2011-03-30 Reuben Thomas Make sure _XOPEN_REALTIME is defined before testing its value. Remove non-POSIX rlimit resources, and as missing RLIMIT_AS. 2011-03-29 Reuben Thomas Test _XOPEN_REALTIME correctly (!= -1, not merely defined). 2011-03-24 Reuben Thomas Update maintainer and git repo location. Bump version to 5.1.9. Fix some Darwin problems. Guard realtime functions with _XOPEN_REALTIME, and remove a bogus debug line. Add getgroups. Add set_errno. Add _exit. Add signals support. Use lua_setfield where possible. 2011-03-22 Natanael Copa release 5.1.8 2010-11-13 Reuben Thomas Add getopt_long. 2010-11-12 Reuben Thomas Update maintainer and documentation information. 2010-10-26 Natanael Copa isgraph/isprint: use function pointer to save a few bytes 2010-10-26 Natanael Copa test: use execp instead of exec when testing fork (cherry picked from commit 42ec4caff2d4895577298f6f26156b80beacdaa6) Conflicts: test.lua 2010-10-26 Reuben Thomas Add isprint and isgraph. Add errno and stdio.h constants. Add abort and raise. Add some comments. Remove excess white space to aid readability, and fix some indenting. Remove Lua 5.0 compatibility. Add copyright notices for new contributors and tidy up old ones. Fold modemuncher.c into lposix.c, removing modesel array (same as lposix.c's M array). Use pushmode in Pumask, and hence remove modechopper from modemuncher.c. Put old ChangeLog in correct date order; remove non-ChangeLog format EOF marker. 2010-10-26 Reuben Thomas Tidy up modemuncher.c. Remove never-compiled debug code. This code is fairly well tested now. Fix whitespace and indentation. Remove camelCase name of modeLookup struct and typedef, which is only used once, and use an anonymous struct instead. Rename the only remaining camelCase identifier in the entire file to a non-camelCase one. 2010-10-26 Reuben Thomas Remove unnecessary phony targets. Fix building with glibc (support for crypt). Remove non-POSIX gecos field of struct passwd. Improve a comment. Fix inconsistent indentation. Remove support for obsolete timezone argument of gettimeofday. Remove declaration of crypt; it's a build system problem. Add .gitignore file. Compile syslog functions on any system with new-enough POSIX. Clean up whitespace. Remove bogus whitespace. 2010-10-26 Natanael Copa Revert "test: use execp instead of exec when testing fork" This reverts commit 42ec4caff2d4895577298f6f26156b80beacdaa6. reverting so i can apply patchset 2010-10-23 Natanael Copa test: use execp instead of exec when testing fork 2010-09-15 Natanael Copa use integers for gettimeofday so it works for platforms that uses float for lua numbers. Add note to ChangeLog that we moved to git rename ChangeLog to ChangeLog.old We will only use git to provide the history from now on. fix bug in setrlimit 2010-08-12 Natanael Copa release 5.1.7 2010-08-11 Tim Niemueller Make clock_* arguments optional With the last change the clock id argument was no longer optional as intended. 2010-08-11 Natanael Copa set LIBVERSION=6 should have been done before the 5.1.5 release :-( 2010-08-10 Tim Niemueller Make clock_get* functions take string argument For consistency with existing functions. 2010-08-10 Natanael Copa added function definitions for 'make show-funcs' 2010-08-09 Tim Niemueller Use realtime clock by default in clock_get* Added strftime Add localtime, gmtime and time Compilation fixes + Fix compilation warnings (uninitialized values, signed vs. unsigned) + if VERSION macro is not passed on command line, set to "unknown", allows to integrate source file into other buildsystems more easily Add gettimeofday, clock_getres, clock_gettime 2010-03-29 Natanael Copa release 5.1.5 use git describe to generate version string and use cgit do distribute tarball so we dont need the tar stuff in makefile 2009-08-11 Natanael Copa luafication of getrlimit/setrlimit Use strings as parameters to select resource rather than integer constants. 2009-08-11 Enrico Tassi set/getrlimit, set/getuid and setlogmask bindings Hi, while packagin the jabber server "prosody" for Debian, I noticed that it was using a custom binding of some posix function not available in luaposix. After asking prosody author, I wrote a patch for luaposix that adds the missing functionalities prosody is actually shipping in a custom .so. The attached patch binds the following functions: set/getrlimit, set/getuid and setlogmask. I'd like it to be integrated in a future release of luaposix, if posible. Cheers -- Enrico Tassi 2008-07-18 Natanael Copa Set LIBVERSION=4 for release 5.1.4. 2008-07-18 Natanael Copa support for crypt() from openwrt. https://dev.openwrt.org/cgi-bin/trac.fcgi/browser/packages/lang/luaposix/patches/200-crypt.patch?rev=11585 2008-07-18 Natanael Copa ignore POLLHUP and POLLNVAL since they are only for output http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=491257 2008-06-03 Natanael Copa updated readme and changelog use luaL_register From: Felix Fietkau here's a small patch that fixes luaposix compile on Darwin / Mac OS X 2008-01-29 Natanael Copa added fdopen() updated changelog version 5.1.2 added syslog funcs dup() takes and returns lua files. added fileno() exec renamed to execp and new exec func uses execv(3) rather than execvp(3) 2008-01-28 Natanael Copa dont run test by default sorted #includes, removed dead code, whitspacefixes 2008-01-25 Natanael Copa cleaned up Makefile avoid warning on 64 bit hosts 2008-01-24 Natanael Copa added poll() from http://lua-users.org/lists/lua-l/2007-11/msg00346.html included stuff from http://lua-users.org/lists/lua-l/2006-10/msg00448.html Initial revision