Commit Graph

109 Commits

Author SHA1 Message Date
Guillem Jover
509841b533 build: Use AM_V_at for mkdir 2013-05-27 04:05:17 +02:00
Guillem Jover
7c4caa679a Fix comparison between signed and unsigned integer compiler warnings 2013-05-27 04:05:17 +02:00
Guillem Jover
30349f8922 Update radixsort module from NetBSD
Merge some interesting changes.
2013-05-27 04:05:17 +02:00
Guillem Jover
96a2dae352 Update setmode module from NetBSD
Merge some interesting changes.
2013-05-27 04:05:17 +02:00
Casper Dik
a4812cdf24 Fix getpeereid() compilation on Solaris
The code in getpeereid() is unlikely to compile as ucred_t is an opaque
struct (ucred_t * works but ucred_t does not). Either you need to give
a pointer initialized to NULL and getpeerucred() allocates a new ucred
or you call it with an allocated ucred as in this patch.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
2013-05-27 04:05:17 +02:00
Guillem Jover
d3a09e1cf4 Switch dehumanize_number() to use expand_number()
The function is a duplicate of expand_number(), but covering less
prefixes and with a slightly different function signature.

Spotted-by: Peter da Silva <resuna@gmail.com>
2013-05-27 04:03:14 +02:00
Guillem Jover
e9933255d4 Make setproctitle() available in 0.2 and 0.5 version nodes
Make the 0.5 version the default, so that code wanting the actual
implemented version can get a proper versioned depdendency. For code
linked against the old version, make it available as an alias.
2013-05-27 03:24:22 +02:00
Guillem Jover
c984dacd65 Implement sendmail semantics for setproctitle()
Prefix the title with "progname: ", and skip it if the format string
starts with '-' (which gets skipped on output too).
2013-05-27 03:24:20 +02:00
Guillem Jover
35785f8dd1 Modify setproctitle() to conform to project coding style
Use local getprogname()/setprogname() instead of reimplementing them
locally. Use clearenv() if available, not just on glibc. Use bool
instead of _Bool. Use paranthesis on sizeof. Fold the SPT_MIN macro
into spt_min(). Make spt_init() static. Avoid unnecessary gotos.
2013-05-27 03:20:17 +02:00
William Ahern
2a0260d08c Add a setproctitle() implementation
Taken from libnostd.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
2013-05-27 02:49:29 +02:00
Guillem Jover
f8d52ead5e Add x32 support to nlist() 2013-05-27 02:49:29 +02:00
Guillem Jover
cf683a275a Add arm64 (aka aarch64) to nlist() 2013-05-27 02:49:28 +02:00
Guillem Jover
a97ce513e0 Add new fgetwln() function
Man page taken from FreeBSD.
2013-05-27 02:49:28 +02:00
Strake
ee0489eb2b Add new fparseln() function
Taken from NetBSD.

[guillem@hadrons.org:
 - Import from NetBSD instead of FreeBSD to get a 3-clause BSD license,
   instead of a 4-clause one.
 - Define compatibility macros.
 - Change library from libc to libbsd and header in man page.
 - Add copyright information to COPYING.
 - Add symbol to map file. ]

Signed-off-by: Guillem Jover <guillem@hadrons.org>
2013-05-27 02:47:32 +02:00
Guillem Jover
cb7bc0d85e Add file buffer pool support to fgetln()
This avoids buffer overwrites during concurrent or intermixed calls to
fgetln() when using more than one different stream (currently 32), which
the original interface supports natively by using an internal buffer
from the FILE structure. Although this workaround is rudimentary, it
should cover most of the theoretically problematic cases.
2013-05-27 02:12:51 +02:00
Guillem Jover
1be0bdb2c9 Add new strnstr() function
Taken from FreeBSD.
2013-05-27 02:12:43 +02:00
Guillem Jover
ff0d700df0 Add new wcslcat() and wcslcpy() functions
Taken from FreeBSD.
2013-05-27 02:11:59 +02:00
Guillem Jover
918a4dba4a Release libbsd 0.4.2 2012-06-27 09:15:15 +02:00
Guillem Jover
14524b545d build: Set default compiler variables from configure
This centralizes the setting so there's no duplication anymore,
makes sure the user supplied variables are never overridden, and
are only set when using gcc.

Reported-by: Samuli Suominen <ssuominen@gentoo.org>
2012-06-03 07:46:00 +02:00
Guillem Jover
c21d788fea Release libbsd 0.4.1 2012-06-01 08:28:00 +02:00
Guillem Jover
fdcae57707 build: Set runtimelibdir to libdir
This makes sure the install-exec-hook under src works as expected even
when no runtimelibdir was specified, otherwise the symlinks end up
pointing to non-existing targets.

Reported-by: Ryan Mullen <rmmullen@gmail.com>
2012-06-01 08:27:33 +02:00
Guillem Jover
e9e4a60d7e build: Use MKDIR_P variable instead of literal «mkdir -p» 2012-06-01 08:15:00 +02:00
Guillem Jover
309c82a016 Release libbsd 0.4.0 2012-05-29 07:33:16 +02:00
Guillem Jover
cd67cb1417 Use implicit <md5.h> from overlay instead explicit <bsd/md5.h>
This was assuming an installed <bsd/md5.h> on the system, due to the
build system not including -Iinclude/ anymore.

Regression introduced in commit 901ed630fc.
2012-05-29 07:31:06 +02:00
Guillem Jover
e7f3976088 Add email address to my name 2012-05-29 04:51:45 +02:00
Guillem Jover
752997462a Base getprogname() on program_invocation_short_name presence instead of glibc 2012-05-29 04:51:04 +02:00
Guillem Jover
d5d9186937 Base fpurge() implementation on __fpurge presence instead of glibc 2012-05-29 04:51:04 +02:00
Guillem Jover
f8e8063079 Base fgetln() implementation on getline presence instead of glibc 2012-05-29 04:51:04 +02:00
Robert Millan
6434858314 Add new expand_number() function
Taken from FreeBSD.

[guillem@hadrons.org:
 - Include <stdint.h> in <bsd/libutil.h>. ]

Signed-off-by: Guillem Jover <guillem@hadrons.org>
2012-05-29 04:50:55 +02:00
Guillem Jover
943939d0e5 Add new closefrom() function
Code taken from sudo, man page from FreeBSD.
2012-05-29 04:36:23 +02:00
Guillem Jover
3d614131b5 Base errc() and warnc() on vwarnc() and verrc() respectively 2012-05-29 04:36:23 +02:00
Guillem Jover
8723226040 Use system __progname variable in progname module if available 2012-05-29 04:36:23 +02:00
Guillem Jover
b5cc17d664 Use getexecname() if available for getprogname()
This function is present on Solaris.
2012-05-29 04:36:23 +02:00
Guillem Jover
980f04f77b build: Do not define already defined _GNU_SOURCE
The macro is defined by configure on config.h which is now implicitly
included by all source files.
2012-05-29 04:36:22 +02:00
Guillem Jover
8d2f12d7f0 build: Include <config.h> through -include for all source files 2012-05-29 04:36:22 +02:00
Guillem Jover
88004b30ff build: Set -Wno-unused-parameter to default CFLAGS 2012-05-29 04:36:22 +02:00
Guillem Jover
dcaa93d984 build: Switch to autotools 2012-05-29 04:35:55 +02:00
Guillem Jover
0aa777f47e Move .pc and .map files to src/ 2012-01-03 07:02:37 +01:00
Guillem Jover
540ab03b18 Move man pages to man/ 2012-01-03 07:02:34 +01:00
Guillem Jover
2fb7200d45 Fix typos in source comments
Found by codespell.
2011-10-23 19:28:14 +02:00
Guillem Jover
4a6303ba3b Constify bsd_getopt(3) arguments
This matches the standard declaration for getopt(3).
2011-06-08 02:10:38 +02:00
Guillem Jover
b891772ad6 Remove blank lines at EOF 2011-05-29 02:49:37 +02:00
Guillem Jover
9d04217174 Map getopt to bsd_getopt if we are using the overlay
This will ensure the code can safely and correctly use optreset
transparently.
2011-05-28 10:31:06 +02:00
Guillem Jover
94fe901eda Abort compilation if fgetln cannot be wrapped 2011-05-16 13:23:18 +02:00
Guillem Jover
28585a58bd Add fpurge function 2011-05-16 13:23:17 +02:00
Guillem Jover
8b6a74775b Conditionalize temporary compatibility inclusions
These inclusions were in place for backward compatibility purposes,
when the headers were split so that code using them would not break.
Make it possible for applications to disable them by defining
LIBBSD_CLEAN_INCLUDES so that buildability can be tested and fixed
before they get removed in a subsequent release.
2011-05-14 14:18:22 +02:00
Guillem Jover
c594192bac Correct library name in man pages 2011-05-14 14:18:06 +02:00
Guillem Jover
8478e57463 Update libbsd header references in man pages
Point to the namespaced path for libbsd specific headers.
2011-05-14 14:16:29 +02:00
Guillem Jover
520682e596 Add support for transparent compilation
This means that software being ported should not need to be modified in
the usual case, as the libbsd headers will take over the standard
namespace and fill the missing gaps, and include the system headers.

To use this the new libbsd-transparent.pc file can be used through
pkg-config, which should end up doing the right thing.
2011-05-14 13:43:49 +02:00
Guillem Jover
1497d34760 Initialize __progname to program_invocation_short_name
As we do not have cooperation from the crt0 code to set __progname, we
have to set it ourselves from getprogname() in case it's NULL. On GNU
systems we can use program_invocation_short_name which is actually set
on crt0.
2011-05-14 13:43:49 +02:00