]> git.ipfire.org Git - thirdparty/libbsd.git/log
thirdparty/libbsd.git
8 years agoRemove a.out support from nlist()
Guillem Jover [Mon, 5 Jun 2017 03:30:27 +0000 (05:30 +0200)] 
Remove a.out support from nlist()

Some libc libraries do not have an <a.out.h> header. And a.out as an
executable format is very much obsolete on pretty much all currently
supported systems, even if they might still support loading such
objects.

Remove the a.out support to increase portability.

8 years agoMake strlcpy()/strlcat() slightly easier to read
Igor Gnatenko [Mon, 27 Jun 2016 07:21:43 +0000 (09:21 +0200)] 
Make strlcpy()/strlcat() slightly easier to read

Backport new changes from OpenBSD.

[guillem@hadrons.org:
 - Update copyright years in COPYING. ]

References: https://svnweb.freebsd.org/base?view=revision&revision=281135
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Signed-off-by: Guillem Jover <guillem@hadrons.org>
8 years agobuild: Add missing \ at end of line
Guillem Jover [Mon, 19 Jun 2017 01:02:32 +0000 (03:02 +0200)] 
build: Add missing \ at end of line

Fixes: commit 934b7a0ccbdc60313102f153eadc2f46853a505b
8 years agoUpdate TODO
Guillem Jover [Sun, 18 Jun 2017 18:30:51 +0000 (20:30 +0200)] 
Update TODO

8 years agoUpdate TODO
Guillem Jover [Tue, 6 Jun 2017 02:56:49 +0000 (04:56 +0200)] 
Update TODO

8 years agotest: Add unit test for strlcpy() and strlcat()
Guillem Jover [Fri, 9 Jun 2017 03:13:32 +0000 (05:13 +0200)] 
test: Add unit test for strlcpy() and strlcat()

8 years agobuild: Match any glibc and musl ABIs on the host_os AS_CASE
Guillem Jover [Fri, 9 Jun 2017 03:14:24 +0000 (05:14 +0200)] 
build: Match any glibc and musl ABIs on the host_os AS_CASE

Reported-by: Helmut Grohne <helmut@subdivi.de>
8 years agobuild: Quote the arguments to AC_CONDITIONAL
Guillem Jover [Fri, 9 Jun 2017 02:52:45 +0000 (04:52 +0200)] 
build: Quote the arguments to AC_CONDITIONAL

8 years agobuild: Move AC_TYPE_UID_T close to the other AC_TYPE_* checks
Guillem Jover [Fri, 9 Jun 2017 02:52:45 +0000 (04:52 +0200)] 
build: Move AC_TYPE_UID_T close to the other AC_TYPE_* checks

8 years agobuild: Move configure.ac comment into actual AC_CASE
Guillem Jover [Fri, 9 Jun 2017 02:52:45 +0000 (04:52 +0200)] 
build: Move configure.ac comment into actual AC_CASE

8 years agobuild: Use src/strlcpy.c in AC_CONFIG_SRCDIR
Guillem Jover [Wed, 7 Jun 2017 21:09:40 +0000 (23:09 +0200)] 
build: Use src/strlcpy.c in AC_CONFIG_SRCDIR

The src/fgetln.c file contains a function considered obsolete, use one
that is not.

8 years agoman: Use .In intead of .Fd macros for includes
Guillem Jover [Wed, 7 Jun 2017 20:46:07 +0000 (22:46 +0200)] 
man: Use .In intead of .Fd macros for includes

8 years agoman: Add new libbsd(7) library overview man page
Guillem Jover [Mon, 5 Jun 2017 04:33:47 +0000 (06:33 +0200)] 
man: Add new libbsd(7) library overview man page

8 years agoman: Add missing man pages
Guillem Jover [Wed, 7 Jun 2017 03:00:34 +0000 (05:00 +0200)] 
man: Add missing man pages

This adds man pages for byteorder(3), errc(3) and fpurge(3), including
all their aliases.

8 years agoman: Add missing aliases
Guillem Jover [Mon, 5 Jun 2017 04:32:36 +0000 (06:32 +0200)] 
man: Add missing aliases

8 years agoman: Move all man pages to section 3bsd
Guillem Jover [Mon, 5 Jun 2017 04:43:22 +0000 (06:43 +0200)] 
man: Move all man pages to section 3bsd

This should guarantee that even if the system provides or will provide
native implementations of these functions, we will not have file
conflicts.

8 years agoDo not use legacy BSD u_* types
Guillem Jover [Mon, 5 Jun 2017 04:17:27 +0000 (06:17 +0200)] 
Do not use legacy BSD u_* types

Some systems do not have these types available, and they are simply
convenience aliases. Instead use the expanded versions which are more
portable.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=101192
8 years agoTry <linux/a.out.h> if <a.out.h> is not present
Guillem Jover [Fri, 20 Jan 2017 01:20:12 +0000 (02:20 +0100)] 
Try <linux/a.out.h> if <a.out.h> is not present

At least musl ships the former but not the latter.

8 years agoDo not provide funopen() on musl
Guillem Jover [Tue, 10 Jan 2017 03:33:15 +0000 (04:33 +0100)] 
Do not provide funopen() on musl

Fixes: https://bugs.debian.org/818246
8 years agoGracefully handle lack of system <sys/cdefs.h>
Guillem Jover [Tue, 10 Jan 2017 03:27:25 +0000 (04:27 +0100)] 
Gracefully handle lack of system <sys/cdefs.h>

This is the case on musl.

Fixes: https://bugs.debian.org/810589
8 years agoFix the __progname check to avoid the optimizer discarding the symbol
Guillem Jover [Sun, 28 Aug 2016 15:13:20 +0000 (17:13 +0200)] 
Fix the __progname check to avoid the optimizer discarding the symbol

Because we were assigning to another unused variable, when building the
check with optimizations enabled, which is the default when using gcc
as the compiler, the variable was being discarded. Instead pass it to
printf() so that it cannot do so.

8 years agoSupport GCC deprecated attribute for GCC older than 4.5
Guillem Jover [Tue, 10 Jan 2017 03:24:35 +0000 (04:24 +0100)] 
Support GCC deprecated attribute for GCC older than 4.5

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=99190
Based-on-patch-by: Eric Smith <brouhaha@fedoraproject.org>
8 years agoAdd support for RISC-V
Guillem Jover [Wed, 8 Feb 2017 00:49:48 +0000 (01:49 +0100)] 
Add support for RISC-V

8 years agoAdd support for TileGX
Helmut Grohne [Tue, 10 Jan 2017 02:47:52 +0000 (03:47 +0100)] 
Add support for TileGX

Fixes: https://bugs.debian.org/847560
Signed-off-by: Guillem Jover <guillem@hadrons.org>
9 years agoRelease libbsd 0.8.3 0.8.3
Guillem Jover [Sat, 23 Apr 2016 08:13:23 +0000 (10:13 +0200)] 
Release libbsd 0.8.3

9 years agoAdd missing <fcntl.h> includes
Szabolcs Nagy [Sun, 27 Mar 2016 10:37:09 +0000 (12:37 +0200)] 
Add missing <fcntl.h> includes

These are required due to the O_* macro usage, but have passed
undetected on glibc-based systems due to implicit inclusions.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
9 years agotest: Add a unit test for md5
Guillem Jover [Sun, 27 Mar 2016 10:31:58 +0000 (12:31 +0200)] 
test: Add a unit test for md5

9 years agoman: Fix ungrammatical construct
Guillem Jover [Sun, 14 Feb 2016 08:00:57 +0000 (09:00 +0100)] 
man: Fix ungrammatical construct

Warned-by: lintian
9 years agobuild: Support clock_gettime() provided in librt
Guillem Jover [Fri, 12 Feb 2016 21:56:09 +0000 (22:56 +0100)] 
build: Support clock_gettime() provided in librt

In older glibc versions (< 2.17) clock_gettime() is in librt. Add a
check for this to avoid build breakage for programs/libraries that
use libbsd on such systems.

Based-on-patch-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Guillem Jover <guillem@hadrons.org>
9 years agoSwitch URLs from http or git to https
Guillem Jover [Wed, 10 Feb 2016 09:38:51 +0000 (10:38 +0100)] 
Switch URLs from http or git to https

9 years agoFix file descriptor leak in HASHFileChunk helper
Guillem Jover [Sun, 7 Feb 2016 01:53:28 +0000 (02:53 +0100)] 
Fix file descriptor leak in HASHFileChunk helper

This leak only happens on error conditions, so it's not too bad.

Warned-by: coverity
9 years agoFix unportable sizeof() usage
Guillem Jover [Sun, 7 Feb 2016 01:47:22 +0000 (02:47 +0100)] 
Fix unportable sizeof() usage

We are calculating the size of the array, and need to pass the size of
each element, not the size of a pointer to an element. Although this
happens to be the same in many cases, this is not a portable assumption.

Warned-by: coverity
9 years agoRelease libbsd 0.8.2 0.8.2
Guillem Jover [Wed, 27 Jan 2016 14:25:23 +0000 (15:25 +0100)] 
Release libbsd 0.8.2

9 years agoFix heap buffer overflow in fgetwln()
Hanno Boeck [Wed, 27 Jan 2016 14:10:11 +0000 (15:10 +0100)] 
Fix heap buffer overflow in fgetwln()

In the function fgetwln() there's a 4 byte heap overflow.

There is a while loop that has this check to see whether there's still
enough space in the buffer:

if (!fb->len || wused > fb->len) {

If this is true more memory gets allocated. However this test won't be
true if wused == fb->len, but at that point wused already points out
of the buffer. Some lines later there's a write to the buffer:

fb->wbuf[wused++] = wc;

This bug was found with the help of address sanitizer.

Warned-by: ASAN
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=93881
Signed-off-by: Guillem Jover <guillem@hadrons.org>
9 years agotest: Add missing <sys/stat.h> include
Hanno Boeck [Wed, 27 Jan 2016 14:06:50 +0000 (15:06 +0100)] 
test: Add missing <sys/stat.h> include

The test in test/strmode.c can fail to compile depending on the
optimization flags used.

The constants that are used in this file (S_IFREG etc.) come from the
<sys/stat.h> include file. It seems gcc ignores this error if one
compiles with "-O2" (default), but if one uses no optimization it fails.

Add the missing include and it works all the time.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=93880
Signed-off-by: Guillem Jover <guillem@hadrons.org>
9 years agotest: Fix success return code for arc4random unit test
Guillem Jover [Mon, 11 Jan 2016 01:21:15 +0000 (02:21 +0100)] 
test: Fix success return code for arc4random unit test

9 years agotest: Fix race condition in headers-*.sh
Lukas Fleischer [Thu, 7 Jan 2016 16:26:12 +0000 (17:26 +0100)] 
test: Fix race condition in headers-*.sh

When running tests in parallel (e.g. using `make -j4 check`), the header
tests currently fail due to headers-overlay.sh and headers-system.sh
both generating headers-gen.c simultaneously, resulting in garbled
output. Fix this by using separate C files for the tests.

Signed-off-by: Lukas Fleischer <lfleischer@lfos.de>
Signed-off-by: Guillem Jover <guillem@hadrons.org>
9 years agoRelease libbsd 0.8.1 0.8.1
Guillem Jover [Mon, 14 Dec 2015 02:39:48 +0000 (03:39 +0100)] 
Release libbsd 0.8.1

9 years agoAdd support for GNU/Hurd to getentropy()
Guillem Jover [Mon, 14 Dec 2015 02:03:57 +0000 (03:03 +0100)] 
Add support for GNU/Hurd to getentropy()

Reuse the getentropy code for Linux on the Hurd, which has fallbacks
for when the better interfaces are not present. And remove all the code
that is not supported currently on the Hurd. Ideally the Hurd should
get an equivalent interfaces that does not suffer from the same
problems as /dev/urandom.

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>
10 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

10 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.

10 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>
10 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.