]> git.ipfire.org Git - thirdparty/libbsd.git/log
thirdparty/libbsd.git
9 years agotest: Add new unit tests for individual headers usage
Guillem Jover [Sat, 12 Dec 2015 13:26:50 +0000 (14:26 +0100)] 
test: Add new unit tests for individual headers usage

9 years agoTurn <bsd/bsd.h> inert when using LIBBSD_OVERLAY
Guillem Jover [Sun, 13 Dec 2015 23:44:47 +0000 (00:44 +0100)] 
Turn <bsd/bsd.h> inert when using LIBBSD_OVERLAY

Also print a warning stating this fact.

9 years agoAdd missing include to <md5.h>
Guillem Jover [Sun, 13 Dec 2015 23:37:34 +0000 (00:37 +0100)] 
Add missing include to <md5.h>

The header was not self-contained, it was missing definitions for some
types included in <sys/types.h>.

9 years agoUse the non-overlayed libbsd headers when we need our own definitions
Guillem Jover [Sat, 12 Dec 2015 13:27:12 +0000 (14:27 +0100)] 
Use the non-overlayed libbsd headers when we need our own definitions

9 years agoSwitch COPYING to Debian copyright machine readable format 1.0
Guillem Jover [Mon, 7 Dec 2015 01:40:46 +0000 (02:40 +0100)] 
Switch COPYING to Debian copyright machine readable format 1.0

9 years agoRelicense my contribution to BSD-2-clause
Guillem Jover [Mon, 7 Dec 2015 01:45:52 +0000 (02:45 +0100)] 
Relicense my contribution to BSD-2-clause

This avoids having two licenses on the same file.

9 years agoAdd missing copyright and license headers
Guillem Jover [Mon, 7 Dec 2015 00:53:49 +0000 (01:53 +0100)] 
Add missing copyright and license headers

9 years agoFix getentropy implementation to use the correct system hooks
Guillem Jover [Wed, 2 Dec 2015 03:00:58 +0000 (04:00 +0100)] 
Fix getentropy implementation to use the correct system hooks

Include getentropy_<SYSTEM>.c instead of arc4random_<SYSTEM>.c.

9 years agoAdd support for GNU/kFreeBSD for closefrom() and getentropy()
Guillem Jover [Wed, 2 Dec 2015 02:32:13 +0000 (03:32 +0100)] 
Add support for GNU/kFreeBSD for closefrom() and getentropy()

9 years agoUnify most arc4random Unix hooks into a single file
Guillem Jover [Wed, 2 Dec 2015 02:08:17 +0000 (03:08 +0100)] 
Unify most arc4random Unix hooks into a single file

The Unix hook should work for most Unix-like systems, move glibc
specific code there and a FreeBSd specific comment, and remove the rest.
Also change the code to always fallback to use the generic Unix code.

This should cover GNU/Hurd and GNU/kFreeBSD among others.

9 years agoUse local SHA512 header
Guillem Jover [Tue, 1 Dec 2015 02:39:10 +0000 (03:39 +0100)] 
Use local SHA512 header

Actually use the local private SHA512 header instead of relying on the
OpenSSL one for no good reason. Add definition for expected macro
SHA512_DIGEST_LENGTH.

9 years agoRelease libbsd 0.8.0 0.8.0
Guillem Jover [Mon, 30 Nov 2015 02:59:42 +0000 (03:59 +0100)] 
Release libbsd 0.8.0

9 years agoUpdate license and copyright information
Guillem Jover [Mon, 30 Nov 2015 02:53:21 +0000 (03:53 +0100)] 
Update license and copyright information

9 years agoUpdate arc4random module from OpenBSD and LibreSSL
Guillem Jover [Wed, 23 Sep 2015 17:39:47 +0000 (19:39 +0200)] 
Update arc4random module from OpenBSD and LibreSSL

Rework arc4random_stir() and arc4random_addrandom() code over the new
internal API, and documentation in the man page. Adapt the code to the
local build system.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=85827
9 years agoAdd private getentropy module from OpenBSD and LibreSSL
Guillem Jover [Wed, 23 Sep 2015 17:39:47 +0000 (19:39 +0200)] 
Add private getentropy module from OpenBSD and LibreSSL

Adapt the code to the local build system.

9 years agoAdd private SHA512 module from FreeBSD
Guillem Jover [Wed, 23 Sep 2015 18:13:33 +0000 (20:13 +0200)] 
Add private SHA512 module from FreeBSD

9 years agoAdd NIOS2 support to nlist()
Marek Vasut [Mon, 30 Nov 2015 19:39:00 +0000 (20:39 +0100)] 
Add NIOS2 support to nlist()

Add support for the NIOS2 soft-core CPU provided by Altera.

Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Cc: Ley Foon Tan <lftan@altera.com>
Cc: Thomas Chou <thomas@wytron.com.tw>
Cc: Walter Goossens <waltergoossens@home.nl>
9 years agoman: Rename funopen.3 to funopen.3bsd to avoid clash with funtools
Guillem Jover [Mon, 30 Nov 2015 18:32:48 +0000 (19:32 +0100)] 
man: Rename funopen.3 to funopen.3bsd to avoid clash with funtools

The funtools project ships a man page with the same, name. And although
it mith probably make more sense to rename the man page there, as BSD
systems will certainly not do so, this is the easiest and fastest way
to avoid a file conflict.

9 years agotest: Check asprintf() return code
Guillem Jover [Mon, 30 Nov 2015 22:48:17 +0000 (23:48 +0100)] 
test: Check asprintf() return code

9 years agotest: Add unit test for strmode()
Guillem Jover [Wed, 30 Sep 2015 02:17:15 +0000 (04:17 +0200)] 
test: Add unit test for strmode()

9 years agotest: Add unit test for arc4random()
Guillem Jover [Mon, 16 Nov 2015 00:12:24 +0000 (01:12 +0100)] 
test: Add unit test for arc4random()

9 years agobuild: Make git log invocation immune to local configuration
Guillem Jover [Mon, 30 Nov 2015 22:00:35 +0000 (23:00 +0100)] 
build: Make git log invocation immune to local configuration

9 years agobuild: Move hash/helper.c into new libbsd_la_included_sources
Guillem Jover [Mon, 30 Nov 2015 03:12:02 +0000 (04:12 +0100)] 
build: Move hash/helper.c into new libbsd_la_included_sources

Use this variable in EXTRA_DIST and libbsd_la_DEPENDENCIES.

9 years agobuild: Move proctitle_LDFLAGS inside BUILD_LIBBSD_CTOR conditional
Guillem Jover [Mon, 30 Nov 2015 01:48:23 +0000 (02:48 +0100)] 
build: Move proctitle_LDFLAGS inside BUILD_LIBBSD_CTOR conditional

9 years agoAdd explicit_bzero() function from OpenBSD
Guillem Jover [Wed, 23 Sep 2015 17:37:37 +0000 (19:37 +0200)] 
Add explicit_bzero() function from OpenBSD

9 years agoMake closefrom_procfs() fail when reallocarray() fails
Guillem Jover [Thu, 24 Sep 2015 02:01:11 +0000 (04:01 +0200)] 
Make closefrom_procfs() fail when reallocarray() fails

9 years agoLock the file streams in fgetln() and fparseln()
Guillem Jover [Wed, 23 Sep 2015 05:10:18 +0000 (07:10 +0200)] 
Lock the file streams in fgetln() and fparseln()

The fparseln() function had the NetBSD uppercase macros stubbed out,
so replace them with the actual stdio ones. The fgetln() function was
missing any locking at all.

9 years agoMark functions handling format strings with __printflike
Guillem Jover [Wed, 23 Sep 2015 03:50:52 +0000 (05:50 +0200)] 
Mark functions handling format strings with __printflike

9 years agoAdd compile and link-time deprecation warnings for fgetln()
Guillem Jover [Tue, 22 Sep 2015 14:22:56 +0000 (16:22 +0200)] 
Add compile and link-time deprecation warnings for fgetln()

Although the current implementation in libbsd is probably one of the
safest ones around, it still poses some problems when used with many
file streams. This function has now a replacement, that is both more
standard and portable. Ask users to switch to getline(3) instead.

9 years agobuild: Add support for linker warnings
Guillem Jover [Tue, 22 Sep 2015 14:21:12 +0000 (16:21 +0200)] 
build: Add support for linker warnings

9 years agoSwitch fparseln() implementation from fgetln() to getline()
Guillem Jover [Sat, 13 Dec 2014 20:28:36 +0000 (21:28 +0100)] 
Switch fparseln() implementation from fgetln() to getline()

9 years agotest: Add fparseln() unit test
Guillem Jover [Tue, 22 Sep 2015 20:30:17 +0000 (22:30 +0200)] 
test: Add fparseln() unit test

9 years agotest: Refactor stream testing functions into a new module
Guillem Jover [Tue, 22 Sep 2015 18:56:15 +0000 (20:56 +0200)] 
test: Refactor stream testing functions into a new module

9 years agoAvoid left shift overflow in reallocarray
Brent Cook [Sat, 13 Dec 2014 07:55:59 +0000 (08:55 +0100)] 
Avoid left shift overflow in reallocarray

Some 64-bit platforms (e.g. Windows 64) have a 32-bit long. So, shifting
1UL 32-bits to the left causes an overflow. This replaces the constant
1UL with (size_t)1 so that we get the correct constant size for the
platform.

Import from OpenBSD.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
9 years agoMake mergesort setup() static
Guillem Jover [Tue, 4 Nov 2014 04:34:46 +0000 (05:34 +0100)] 
Make mergesort setup() static

9 years agoUse ANSI C prototypes
Guillem Jover [Tue, 4 Nov 2014 04:33:26 +0000 (05:33 +0100)] 
Use ANSI C prototypes

9 years agoUse reallocarray() instead of malloc() or realloc()
Guillem Jover [Mon, 3 Nov 2014 22:21:52 +0000 (23:21 +0100)] 
Use reallocarray() instead of malloc() or realloc()

9 years agoDo not close file descriptors while scanning the /proc filesystem
Guillem Jover [Sun, 2 Nov 2014 23:43:27 +0000 (00:43 +0100)] 
Do not close file descriptors while scanning the /proc filesystem

Closing file descriptors changes the content of the fd directories in
the /proc filesystem, which means readdir() might get very confused.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=85663
9 years agoMove procfs based implementation into a new closefrom_procfs() function
Guillem Jover [Sun, 2 Nov 2014 22:58:23 +0000 (23:58 +0100)] 
Move procfs based implementation into a new closefrom_procfs() function

9 years agoRefactor file descriptor closure into a new closefrom_close()
Guillem Jover [Wed, 5 Nov 2014 19:01:53 +0000 (20:01 +0100)] 
Refactor file descriptor closure into a new closefrom_close()

9 years agoUpdate closefrom() function
Guillem Jover [Sat, 1 Nov 2014 23:23:00 +0000 (00:23 +0100)] 
Update closefrom() function

Import from sudo. Adapt the build system to detect the required features.

9 years agotest: Add closefrom() unit test
Guillem Jover [Wed, 23 Sep 2015 02:40:21 +0000 (04:40 +0200)] 
test: Add closefrom() unit test

9 years agotest: Add test case for fpurge(NULL)
Guillem Jover [Fri, 31 Oct 2014 23:55:55 +0000 (00:55 +0100)] 
test: Add test case for fpurge(NULL)

9 years agotest: Move and activate fpurge() test case from module to a dedicated file
Guillem Jover [Fri, 31 Oct 2014 23:54:09 +0000 (00:54 +0100)] 
test: Move and activate fpurge() test case from module to a dedicated file

9 years agobuild: Centralize testsuite LDADD setting in a single variable
Guillem Jover [Fri, 31 Oct 2014 23:52:42 +0000 (00:52 +0100)] 
build: Centralize testsuite LDADD setting in a single variable

9 years agoSync queue(3) from FreeBSD
Guillem Jover [Fri, 31 Oct 2014 23:22:28 +0000 (00:22 +0100)] 
Sync queue(3) from FreeBSD

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=85147
9 years agoAdd __offsetof, __rangeof and __containerof to sys/cdefs.h
Guillem Jover [Fri, 31 Oct 2014 23:21:30 +0000 (00:21 +0100)] 
Add __offsetof, __rangeof and __containerof to sys/cdefs.h

Import and adapt from FreeBSD.

9 years agoAdd __DECONST, __DEVOLATILE and __DEQUALIFY macros to sys/cdefs.h
Guillem Jover [Fri, 31 Oct 2014 23:20:23 +0000 (00:20 +0100)] 
Add __DECONST, __DEVOLATILE and __DEQUALIFY macros to sys/cdefs.h

Import from FreeBSD.

9 years agoAdd new man page for reallocarray(3)
Guillem Jover [Fri, 31 Oct 2014 16:29:54 +0000 (17:29 +0100)] 
Add new man page for reallocarray(3)

Import man page from OpenBSD.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=85622
9 years agoUse stdint integer types instead of BSD legacy ones
Guillem Jover [Tue, 12 Aug 2014 10:32:34 +0000 (12:32 +0200)] 
Use stdint integer types instead of BSD legacy ones

10 years agoFix arc4random() and arc4random_stir() prototypes
Callum Davies [Sun, 10 Aug 2014 11:34:44 +0000 (12:34 +0100)] 
Fix arc4random() and arc4random_stir() prototypes

These two functions accept no arguments.  The prototypes should reflect
this.  This change lets the compiler warn about certain (admittedly
silly) mistakes.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
11 years agoRelease libbsd 0.7.0 0.7.0
Guillem Jover [Tue, 29 Jul 2014 01:00:08 +0000 (03:00 +0200)] 
Release libbsd 0.7.0

11 years agobuild: Remove hard requirement for GNU .init_array section support
Guillem Jover [Sat, 19 Jul 2014 23:48:20 +0000 (01:48 +0200)] 
build: Remove hard requirement for GNU .init_array section support

In case the support is not available, just stop building the
libbsd-ctor.a library, which is a nice to have thing, but should not
have been a hard requirement from the start. This should allow to
build libbsd on non-glibc based systems using another libc.

11 years agoAdd reallocarray() function from OpenBSD
Benjamin Baier [Fri, 27 Jun 2014 00:05:11 +0000 (02:05 +0200)] 
Add reallocarray() function from OpenBSD

Signed-off-by: Guillem Jover <guillem@hadrons.org>
11 years agoAdd stringlist module from NetBSD
Guillem Jover [Thu, 26 Jun 2014 19:43:55 +0000 (21:43 +0200)] 
Add stringlist module from NetBSD

11 years agoAdd getbsize() function
Guillem Jover [Thu, 26 Jun 2014 19:32:11 +0000 (21:32 +0200)] 
Add getbsize() function

Import code from DragonFlyBSD and man page from FreeBSD.

11 years agoAdd OpenRISC support to nlist()
Christian Svensson [Thu, 6 Mar 2014 21:10:36 +0000 (22:10 +0100)] 
Add OpenRISC support to nlist()

Signed-off-by: Guillem Jover <guillem@hadrons.org>
11 years agoAdd timeconv module from FreeBSD
Guillem Jover [Fri, 11 Oct 2013 03:43:42 +0000 (05:43 +0200)] 
Add timeconv module from FreeBSD

Inline license information from FreeBSD root dir COPYRIGHT file.

11 years agoAdd funopen() function
Guillem Jover [Mon, 21 Oct 2013 03:07:56 +0000 (05:07 +0200)] 
Add funopen() function

This is a wrapper over the glibc fopencookie() function.

We diverge from the FreeBSD, OpenBSD and DragonFlyBSD declarations,
because seekfn() there wrongly uses fpos_t, assuming it's an integral
type, and any code using that on a system where fpos_t is a struct
(such as GNU-based systems or NetBSD) will fail to build. In which case,
as the code has to be modified anyway, we might just as well use the
correct declaration.

11 years agoHandle glibc partial header inclusions
Guillem Jover [Fri, 11 Oct 2013 03:11:42 +0000 (05:11 +0200)] 
Handle glibc partial header inclusions

The glibc headers use selective inclusions through the __need_NAME
mechanism to avoid circular dependencies.

The problem is that if we are being overlaid, and have been requested
a partial inclusion, when we pass control to the system header, then
we might miss definitions needed by our own header, resulting in build
failures.

Workaround that by catching current partial requests, and skip the
current inclusion.

11 years agobuild: Set subdir-objects automake option
Guillem Jover [Thu, 10 Oct 2013 07:49:04 +0000 (09:49 +0200)] 
build: Set subdir-objects automake option

Bump automake minimal version to 1.9.

11 years agoFix dehumanize_number() to correctly detect overflows
Guillem Jover [Sun, 14 Jul 2013 23:44:30 +0000 (01:44 +0200)] 
Fix dehumanize_number() to correctly detect overflows

Do not allow numbers greated than INT64_MAX and smaller than INT64_MIN.
Clarify the positive sign value by prefixing it with an explicit +.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=66909
12 years agoRelease libbsd 0.6.0 0.6.0
Guillem Jover [Sun, 14 Jul 2013 08:58:20 +0000 (10:58 +0200)] 
Release libbsd 0.6.0

12 years agoWarn when setproctitle() gets called before initialization
Guillem Jover [Sat, 13 Jul 2013 00:11:20 +0000 (02:11 +0200)] 
Warn when setproctitle() gets called before initialization

Try to give a helpful message in case the program is not initializing
the setproctitle() machinery.

12 years agoMove setproctitle() automatic initialization to its own library
Guillem Jover [Thu, 11 Jul 2013 10:25:54 +0000 (12:25 +0200)] 
Move setproctitle() automatic initialization to its own library

The automatic initialization cannot be part of the main shared library,
because there is no thread-safe way to change the environ global
variable. This is not a problem if the initializaion happens just at
program load time, but becomes one if the shared library is directly or
indirectly dlopen()ed during the execution of the program, which could
have either kept references to the old environ or could change it in
some other thread. This has been observed for example on systems using
Samba NSS modules.

To avoid any other possible fallout, the constructor is split into a
new static library that needs to be linked explicitly into programs
using setproctitle(). As an additional safety measure the pkg-config
linker flags will mark the program as not allowing to be dlopen()ed
so that we avoid the problem described above.

Reported-by: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=66679
12 years agobuild: Move version ABI from Makefile to configure.ac
Guillem Jover [Fri, 12 Jul 2013 20:15:58 +0000 (22:15 +0200)] 
build: Move version ABI from Makefile to configure.ac

It's easier to find there, and the value can be reused in case we have
to provide another shared library.

12 years agoRelease libbsd 0.5.2 0.5.2
Guillem Jover [Sat, 8 Jun 2013 15:43:42 +0000 (17:43 +0200)] 
Release libbsd 0.5.2

12 years agoCreate a shallow copy of environ before replacing it in setproctitle()
Guillem Jover [Fri, 7 Jun 2013 05:11:50 +0000 (07:11 +0200)] 
Create a shallow copy of environ before replacing it in setproctitle()

Because clearenv() or setenv() might free the environ array of pointers,
we should make sure to copy it so that we can access it later on when
doing the deep copy via setenv().

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=65470
12 years agoSpecify setproctitle_stub() signature manually if typeof is missing
Guillem Jover [Fri, 7 Jun 2013 02:46:29 +0000 (04:46 +0200)] 
Specify setproctitle_stub() signature manually if typeof is missing

Do not stop exporting the function in the version node even if typeof
is not available, as that would break ABI.

12 years agoTry to check if setproctitle() constructor got passed arguments
Guillem Jover [Sat, 8 Jun 2013 15:55:19 +0000 (17:55 +0200)] 
Try to check if setproctitle() constructor got passed arguments

12 years agoForce setproctitle() into .init_array section
Guillem Jover [Wed, 29 May 2013 00:23:56 +0000 (02:23 +0200)] 
Force setproctitle() into .init_array section

The GNU .init_array support is an extension over the standard System V
ABI .init_array support, which passes the main() arguments to the init
function.

This support comes in three parts. First the dynamic linker (from glibc)
needs to support it. Then function pointers need to be placed in the
section, for example by using __attribute__((constructor)), that the
compiler (gcc or clang for example) might place in section .ctors and
the linker (from binutils) will move to .init_array on the output
object, or by placing them directly into .init_array by the compiler
when compiling. If this does not happen and the function pointers end
up in .ctors, then they will not get passed the main() arguments, which
we do really need in this case.

But this relies on recent binutils or gcc having native .init_array
support, and not having it disabled through --disable-initfini-array.

To guarantee we get the correct behaviour, let's just place the function
pointer in the .init_array section directly, so we only require a recent
enough glibc.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=65029
12 years agotest: Try setting and getting an environment variable after setproctitle()
Guillem Jover [Sat, 8 Jun 2013 06:15:21 +0000 (08:15 +0200)] 
test: Try setting and getting an environment variable after setproctitle()

12 years agobuild: Ignore automake 1.13+ test suite generated files
Guillem Jover [Thu, 30 May 2013 02:09:25 +0000 (04:09 +0200)] 
build: Ignore automake 1.13+ test suite generated files

12 years agoRelease libbsd 0.5.1 0.5.1
Guillem Jover [Mon, 27 May 2013 04:52:05 +0000 (06:52 +0200)] 
Release libbsd 0.5.1

12 years agotest: Mark a literal integer as long long
Guillem Jover [Mon, 27 May 2013 04:49:57 +0000 (06:49 +0200)] 
test: Mark a literal integer as long long

This fixes build failures on 32-bit architectures.

12 years agoRelease libbsd 0.5.0 0.5.0
Guillem Jover [Tue, 21 May 2013 02:34:34 +0000 (04:34 +0200)] 
Release libbsd 0.5.0

12 years agobuild: Handle the ChangeLog as a distributed-only file
Guillem Jover [Mon, 27 May 2013 02:41:58 +0000 (04:41 +0200)] 
build: Handle the ChangeLog as a distributed-only file

The ChangeLog file is distributed, and cannot be regenerated outside
of the git repository, so do not remove it in DISTCLEANFILES, and move
the generation code into dist-hook, which also avoids unnecessary
computation during normal builds.

12 years agobuild: Use AM_V_at for mkdir
Guillem Jover [Sat, 25 May 2013 13:44:57 +0000 (15:44 +0200)] 
build: Use AM_V_at for mkdir

12 years agobuild: Compress the distribution tarball with xz instead of gzip
Guillem Jover [Tue, 21 May 2013 08:31:59 +0000 (10:31 +0200)] 
build: Compress the distribution tarball with xz instead of gzip

12 years agoFix comparison between signed and unsigned integer compiler warnings
Guillem Jover [Sat, 25 May 2013 13:36:11 +0000 (15:36 +0200)] 
Fix comparison between signed and unsigned integer compiler warnings

12 years agoUpdate radixsort module from NetBSD
Guillem Jover [Sat, 25 May 2013 13:35:39 +0000 (15:35 +0200)] 
Update radixsort module from NetBSD

Merge some interesting changes.

12 years agoUpdate setmode module from NetBSD
Guillem Jover [Sat, 25 May 2013 13:31:45 +0000 (15:31 +0200)] 
Update setmode module from NetBSD

Merge some interesting changes.

12 years agoFix getpeereid() compilation on Solaris
Casper Dik [Fri, 15 Mar 2013 00:13:58 +0000 (01:13 +0100)] 
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>
12 years agoSwitch dehumanize_number() to use expand_number()
Guillem Jover [Thu, 27 Dec 2012 10:19:20 +0000 (11:19 +0100)] 
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>
12 years agotest: Add new humanize unit test
Guillem Jover [Sun, 26 May 2013 02:34:57 +0000 (04:34 +0200)] 
test: Add new humanize unit test

12 years agotest: Add setproctitle() unit test
Guillem Jover [Tue, 27 Nov 2012 13:23:26 +0000 (14:23 +0100)] 
test: Add setproctitle() unit test

12 years agoMake setproctitle() available in 0.2 and 0.5 version nodes
Guillem Jover [Sat, 25 May 2013 15:11:53 +0000 (17:11 +0200)] 
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.

12 years agoImplement sendmail semantics for setproctitle()
Guillem Jover [Tue, 27 Nov 2012 13:24:13 +0000 (14:24 +0100)] 
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).

12 years agoModify setproctitle() to conform to project coding style
Guillem Jover [Sun, 25 Nov 2012 20:10:53 +0000 (21:10 +0100)] 
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.

12 years agoAdd a setproctitle() implementation
William Ahern [Wed, 28 Nov 2012 10:09:02 +0000 (11:09 +0100)] 
Add a setproctitle() implementation

Taken from libnostd.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
12 years agoAdd x32 support to nlist()
Guillem Jover [Fri, 23 Nov 2012 17:33:23 +0000 (18:33 +0100)] 
Add x32 support to nlist()

12 years agoAdd arm64 (aka aarch64) to nlist()
Guillem Jover [Fri, 23 Nov 2012 17:32:35 +0000 (18:32 +0100)] 
Add arm64 (aka aarch64) to nlist()

12 years agotest: Add new fgetln() and fgetwln() unit test
Guillem Jover [Thu, 23 May 2013 00:05:19 +0000 (02:05 +0200)] 
test: Add new fgetln() and fgetwln() unit test

12 years agoAdd new fgetwln() function
Guillem Jover [Fri, 23 Nov 2012 20:19:45 +0000 (21:19 +0100)] 
Add new fgetwln() function

Man page taken from FreeBSD.

12 years agoAdd new fparseln() function
Strake [Tue, 7 Aug 2012 13:44:30 +0000 (08:44 -0500)] 
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>
12 years agoAdd file buffer pool support to fgetln()
Guillem Jover [Sun, 25 Nov 2012 21:09:43 +0000 (22:09 +0100)] 
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.

12 years agoAdd new strnstr() function
Guillem Jover [Sun, 25 Nov 2012 20:13:38 +0000 (21:13 +0100)] 
Add new strnstr() function

Taken from FreeBSD.

12 years agoAdd new wcslcat() and wcslcpy() functions
Guillem Jover [Fri, 23 Nov 2012 16:16:43 +0000 (17:16 +0100)] 
Add new wcslcat() and wcslcpy() functions

Taken from FreeBSD.

12 years agoCoalesce identical BSD-2-clause licenses
Guillem Jover [Tue, 21 May 2013 02:13:55 +0000 (04:13 +0200)] 
Coalesce identical BSD-2-clause licenses

13 years agoRelease libbsd 0.4.2 0.4.2
Guillem Jover [Wed, 27 Jun 2012 07:15:15 +0000 (09:15 +0200)] 
Release libbsd 0.4.2