skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

commit 3d210ed280513100f9466a2c171db77ee6952a25
parent 5246da15e870b83bb0c803bde31317b01731b23f
Author: Laurent Bercot <ska-skaware@skarnet.org>
Date:   Thu, 18 May 2017 13:33:40 +0000

 Add xpathexec_* functions, prepare for 2.5.1.0

Diffstat:
MAUTHORS | 1+
MNEWS | 6++++--
Mdoc/index.html | 2+-
Mdoc/libstddjb/djbunix.html | 17+++++++++++++++++
Mdoc/license.html | 2+-
Mdoc/upgrade.html | 5+++--
Mpackage/deps.mak | 8++++++++
Mpackage/info | 2+-
Msrc/include/skalibs/djbunix.h | 13+++++++++++--
Asrc/libstddjb/xexecvep.c | 10++++++++++
Asrc/libstddjb/xpathexec.c | 10++++++++++
Asrc/libstddjb/xpathexec0.c | 10++++++++++
Asrc/libstddjb/xpathexec0_run.c | 10++++++++++
Asrc/libstddjb/xpathexec_fromenv.c | 10++++++++++
Asrc/libstddjb/xpathexec_r.c | 10++++++++++
Asrc/libstddjb/xpathexec_r_name.c | 10++++++++++
Asrc/libstddjb/xpathexec_run.c | 10++++++++++
17 files changed, 127 insertions(+), 9 deletions(-)

diff --git a/AUTHORS b/AUTHORS @@ -6,6 +6,7 @@ Contributors: William E. Baxter <web@superscript.com> Olivier Brunel <jjk@jjacky.com> Lionel Van Bemten <lionel.van_bemten@nokia.com> + Rasmus Villemoes <rv@rasmusvillemoes.dk> Thanks to: Jean Marot <jean.marot@skarnet.org> diff --git a/NEWS b/NEWS @@ -1,9 +1,11 @@ Changelog for skalibs. -In 2.5.0.1 +In 2.5.1.0 ---------- - - Bugfix release. + - Bugfixes. + - More workarounds for sysdeps detection by broken toolchains. + - Added the xpathexec_* family of functions (in djbunix.h). In 2.5.0.0 diff --git a/doc/index.html b/doc/index.html @@ -60,7 +60,7 @@ with a standard C development environment </li> <h3> Download </h3> <ul> - <li> The current released version of skalibs is <a href="skalibs-2.5.0.1.tar.gz">2.5.0.1</a>. </li> + <li> The current released version of skalibs is <a href="skalibs-2.5.1.0.tar.gz">2.5.1.0</a>. </li> <li> Alternatively, you can checkout a copy of the <a href="http://git.skarnet.org/cgi-bin/cgit.cgi/skalibs/">skalibs git repository</a>: diff --git a/doc/libstddjb/djbunix.html b/doc/libstddjb/djbunix.html @@ -412,6 +412,23 @@ modified by the hidden modifier string. If this command line is empty, exit 0 instead. </p> +<p> <code> +void xexecvep (char const *, char const *const *, char const *const *, char const *) <br /> +void xpathexec_r (char const *const *, char const *const *, size_t, char const *, size_t) <br /> +void xpathexec_r_name (char const *, char const *const *, char const *const *, size_t, char const *, size_t) <br /> +void xpathexec_fromenv (char const *const *, char const *const *, size_t) <br /> +void xpathexec_run (char const *, char const *const *, char const *const *) <br /> +void xpathexec0_run (char const *const *, char const *const *) <br /> +void xpathexec (char const *const *) <br /> +void xpathexec0 (char const *const *) +</code> </p> + +<p> + Those functions provide the same functionality as the non-x-prefixed versions, +but if the execution fails (i.e. the process cannot exec into a new program), then +the process dies with a 111 exit code and an error message on stderr. +</p> + <p> The <a href="env.html">env</a> library interface provides additional functions to manipulate modifier strings and environments. diff --git a/doc/license.html b/doc/license.html @@ -74,7 +74,7 @@ color, or different text font. </li> <p> <em>I am aware that the previous restrictions sound completely ridiculous while the official skalibs documentation is incomplete. -As of 2.5.0.1, I'm not going to enforce those restrictions, but if you're +As of 2.5.1.0, I'm not going to enforce those restrictions, but if you're going to provide documentation for skalibs, don't keep it to yourself, please send it to me instead. :-) </em> </p> diff --git a/doc/upgrade.html b/doc/upgrade.html @@ -17,10 +17,11 @@ </p> -<h2> in 2.5.0.1 </h2> +<h2> in 2.5.1.0 </h2> <ul> - <li> No functional changes. </li> + <li> The <tt>xpathexec_*</tt> family of functions has been added to +<a href="libstddjb/djbunix.html">skalibs/djbunix.h</a>. </li> </ul> <h1> What has changed in skalibs </h1> diff --git a/package/deps.mak b/package/deps.mak @@ -669,6 +669,14 @@ src/libstddjb/wait_reap.o src/libstddjb/wait_reap.lo: src/libstddjb/wait_reap.c src/libstddjb/waitn.o src/libstddjb/waitn.lo: src/libstddjb/waitn.c src/include/skalibs/djbunix.h src/libstddjb/waitn_reap.o src/libstddjb/waitn_reap.lo: src/libstddjb/waitn_reap.c src/include/skalibs/djbunix.h src/libstddjb/waitpid_nointr.o src/libstddjb/waitpid_nointr.lo: src/libstddjb/waitpid_nointr.c src/include/skalibs/djbunix.h +src/libstddjb/xexecvep.o src/libstddjb/xexecvep.lo: src/libstddjb/xexecvep.c src/include/skalibs/djbunix.h src/include/skalibs/strerr2.h +src/libstddjb/xpathexec.o src/libstddjb/xpathexec.lo: src/libstddjb/xpathexec.c src/include/skalibs/djbunix.h src/include/skalibs/strerr2.h +src/libstddjb/xpathexec0.o src/libstddjb/xpathexec0.lo: src/libstddjb/xpathexec0.c src/include/skalibs/djbunix.h src/include/skalibs/strerr2.h +src/libstddjb/xpathexec0_run.o src/libstddjb/xpathexec0_run.lo: src/libstddjb/xpathexec0_run.c src/include/skalibs/djbunix.h src/include/skalibs/strerr2.h +src/libstddjb/xpathexec_fromenv.o src/libstddjb/xpathexec_fromenv.lo: src/libstddjb/xpathexec_fromenv.c src/include/skalibs/djbunix.h src/include/skalibs/strerr2.h +src/libstddjb/xpathexec_r.o src/libstddjb/xpathexec_r.lo: src/libstddjb/xpathexec_r.c src/include/skalibs/djbunix.h src/include/skalibs/strerr2.h +src/libstddjb/xpathexec_r_name.o src/libstddjb/xpathexec_r_name.lo: src/libstddjb/xpathexec_r_name.c src/include/skalibs/djbunix.h src/include/skalibs/strerr2.h +src/libstddjb/xpathexec_run.o src/libstddjb/xpathexec_run.lo: src/libstddjb/xpathexec_run.c src/include/skalibs/djbunix.h src/include/skalibs/strerr2.h src/libunixonacid/atomic_rm_rf.o src/libunixonacid/atomic_rm_rf.lo: src/libunixonacid/atomic_rm_rf.c src/include/skalibs/skamisc.h src/include/skalibs/unix-transactional.h src/libunixonacid/atomic_rm_rf_tmp.o src/libunixonacid/atomic_rm_rf_tmp.lo: src/libunixonacid/atomic_rm_rf_tmp.c src/include/skalibs/djbunix.h src/include/skalibs/random.h src/include/skalibs/stralloc.h src/include/skalibs/unix-transactional.h src/libunixonacid/bufalloc_timed_flush.o src/libunixonacid/bufalloc_timed_flush.lo: src/libunixonacid/bufalloc_timed_flush.c src/include/skalibs/bufalloc.h src/include/skalibs/functypes.h src/include/skalibs/unix-timed.h diff --git a/package/info b/package/info @@ -1,4 +1,4 @@ package=skalibs -version=2.5.0.1 +version=2.5.1.0 category=prog package_macro_name=SKALIBS diff --git a/src/include/skalibs/djbunix.h b/src/include/skalibs/djbunix.h @@ -61,6 +61,15 @@ extern void pathexec0_run (char const *const *, char const *const *) ; extern void pathexec (char const *const *) ; extern void pathexec0 (char const *const *) ; +extern void xpathexec_r (char const *const *, char const *const *, size_t, char const *, size_t) gccattr_noreturn ; +extern void xpathexec_r_name (char const *, char const *const *, char const *const *, size_t, char const *, size_t) gccattr_noreturn ; +extern void xpathexec_fromenv (char const *const *, char const *const *, size_t) gccattr_noreturn ; +extern void xexecvep (char const *, char const *const *, char const *const *, char const *) gccattr_noreturn ; +extern void xpathexec_run (char const *, char const *const *, char const *const *) gccattr_noreturn ; +extern void xpathexec0_run (char const *const *, char const *const *) gccattr_noreturn ; +extern void xpathexec (char const *const *) gccattr_noreturn ; +extern void xpathexec0 (char const *const *) gccattr_noreturn ; + #define prot_gid(gid) setgid(gid) #define prot_uid(uid) setuid(uid) extern int prot_readgroups (char const *, gid_t *, unsigned int) ; @@ -152,11 +161,11 @@ extern pid_t child_spawn2 (char const *, char const *const *, char const *const /* - Unified function to fork a child with communication canals. + Unified function to fork a child with communication channels (pipes). * uses posix_spawn() if available, else uses fork+exec * requests n (the last arg) communication fds between parent and child * if n=1, equivalent to child_spawn1_pipe; child writes, parent reads. - * if n>=2, the fds are pipes, parent reads on even and writes on odd. + * if n>=2, parent reads on even and writes on odd. */ extern pid_t child_spawn (char const *, char const *const *, char const *const *, int *, unsigned int) ; diff --git a/src/libstddjb/xexecvep.c b/src/libstddjb/xexecvep.c @@ -0,0 +1,10 @@ +/* ISC license. */ + +#include <skalibs/djbunix.h> +#include <skalibs/strerr2.h> + +void xexecvep (char const *file, char const *const *argv, char const *const *envp, char const *path) +{ + execvep(file, argv, envp, path) ; + strerr_dieexec(111, file) ; +} diff --git a/src/libstddjb/xpathexec.c b/src/libstddjb/xpathexec.c @@ -0,0 +1,10 @@ +/* ISC license. */ + +#include <skalibs/djbunix.h> +#include <skalibs/strerr2.h> + +void xpathexec (char const *const *argv) +{ + pathexec(argv) ; + strerr_dieexec(111, argv[0]) ; +} diff --git a/src/libstddjb/xpathexec0.c b/src/libstddjb/xpathexec0.c @@ -0,0 +1,10 @@ +/* ISC license. */ + +#include <skalibs/djbunix.h> +#include <skalibs/strerr2.h> + +void xpathexec0 (char const *const *argv) +{ + pathexec0(argv) ; + strerr_dieexec(111, argv[0]) ; +} diff --git a/src/libstddjb/xpathexec0_run.c b/src/libstddjb/xpathexec0_run.c @@ -0,0 +1,10 @@ +/* ISC license. */ + +#include <skalibs/djbunix.h> +#include <skalibs/strerr2.h> + +void xpathexec0_run (char const *const *argv, char const *const *envp) +{ + pathexec0_run(argv, envp) ; + strerr_dieexec(111, argv[0]) ; +} diff --git a/src/libstddjb/xpathexec_fromenv.c b/src/libstddjb/xpathexec_fromenv.c @@ -0,0 +1,10 @@ +/* ISC license. */ + +#include <skalibs/djbunix.h> +#include <skalibs/strerr2.h> + +void xpathexec_fromenv (char const *const *argv, char const *const *envp, size_t envlen) +{ + pathexec_fromenv(argv, envp, envlen) ; + strerr_dieexec(111, argv[0]) ; +} diff --git a/src/libstddjb/xpathexec_r.c b/src/libstddjb/xpathexec_r.c @@ -0,0 +1,10 @@ +/* ISC license. */ + +#include <skalibs/djbunix.h> +#include <skalibs/strerr2.h> + +void xpathexec_r (char const *const *argv, char const *const *envp, size_t envlen, char const *modifs, size_t modiflen) +{ + pathexec_r(argv, envp, envlen, modifs, modiflen) ; + strerr_dieexec(111, argv[0]) ; +} diff --git a/src/libstddjb/xpathexec_r_name.c b/src/libstddjb/xpathexec_r_name.c @@ -0,0 +1,10 @@ +/* ISC license. */ + +#include <skalibs/djbunix.h> +#include <skalibs/strerr2.h> + +void xpathexec_r_name (char const *file, char const *const *argv, char const *const *envp, size_t envlen, char const *modifs, size_t modiflen) +{ + pathexec_r_name(file, argv, envp, envlen, modifs, modiflen) ; + strerr_dieexec(111, file) ; +} diff --git a/src/libstddjb/xpathexec_run.c b/src/libstddjb/xpathexec_run.c @@ -0,0 +1,10 @@ +/* ISC license. */ + +#include <skalibs/djbunix.h> +#include <skalibs/strerr2.h> + +void xpathexec_run (char const *file, char const *const *argv, char const *const *envp) +{ + pathexec_run(file, argv, envp) ; + strerr_dieexec(111, file) ; +}