|
3d9c6c08
|
2018-06-14T11:38:32
|
|
Only define S_ISTXT if S_ISVTX is defined
Windows doesn't provide S_ISVTX. Prefer not defining it rather than
defining it to something invalid.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
e4e15ed2
|
2018-05-22T13:50:44
|
|
Fix strnvis() and strnunvis() NetBSD ABI break
The NetBSD implementations have different prototypes to the ones coming
from OpenBSD, which will break builds, and have caused segfaults at
run-time. We provide now both interfaces with different prototypes as
different version nodes allow selecting them at compile-time, defaulting
for now to the OpenBSD one to avoid build-time breakage, while emitting
a compile-time warning. Later on, in 0.10.0, we will be switching the
compile-time default to the NetBSD version.
Ref: http://gnats.netbsd.org/44977
Fixes: https://bugs.debian.org/899282
|
|
bf697b90
|
2018-05-22T15:43:48
|
|
Add symbol redirection support
We need this to be able to select different version symbols at
compile-time.
|
|
e13b1a33
|
2018-05-21T00:20:49
|
|
Import strtoi() and strtou() functions from NetBSD
|
|
2d7de186
|
2018-05-21T03:09:05
|
|
Update vis/unvis modules from NetBSD
|
|
e3979d1a
|
2018-05-20T19:22:16
|
|
Update humanize_number() from FreeBSD
Implements HN_IEC_PREFIXES.
|
|
facbddb6
|
2018-05-20T19:18:18
|
|
Update pidfile module from FreeBSD
Use EINVAL instead of EDOOFUS. Add a missing synopsis for
pidfile_fileno() in the man page. Move the definition of struct pidfh
from libutil.h into pidfile.c following upstream change.
|
|
993828d8
|
2018-05-21T01:11:46
|
|
Add flopenat() function from FreeBSD
|
|
30b4d507
|
2018-05-21T03:00:47
|
|
Add __arraycount() macro from NetBSD
|
|
1f8a3f7b
|
2018-03-06T01:39:45
|
|
Fix function declaration protection for glibc already providing them
On non-glibc based systems we cannot unconditionally use the
__GLIBC_PREREQ macro as it gets expanded before evaluation. Instead,
if it is undefined, define it to 0.
We should also always declare these functions on non-glibc based
systems. And on systems with a new enough glibc, which provides these
functions, we should still provide the declarations if _GNU_SOURCE
is *not* defined.
Reported-by: Jörg Krause <joerg.krause@embedded.rocks>
|
|
b20272f5
|
2018-03-06T01:42:52
|
|
Remove <features.h> inclusion from <bsd/libutil.h>
This is a non-portable header, and we should not assume it is present.
Let the first system header pull it in if needed.
|
|
11ec8f1e
|
2018-03-06T01:41:35
|
|
Handle systems missing <sys/cdefs.h>
This is a non-portable header, and we cannot expect it to be provided by
the system libc (e.g. musl). We just need and rely on declaration that
we have defined ourselves in our own <bsd/sys/cdefs.h>. So we switch to
only ever assume that.
Fixes: https://bugs.freedesktop.org/105281
|
|
9afc7100
|
2017-12-03T16:46:19
|
|
Fix <sys/cdefs.h> for gcc with no __has_include or __has_include_next support
Fixes: https://bugs.freedesktop.org/103396
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
22fbd623
|
2017-09-02T19:55:50
|
|
Handle several functions now being provided by glibc
We mention that these are now superseded by the glibc implementations,
make the headers cope with already declared functions on glibc-based
systems, and document this in the man pages.
|
|
ec5d9a68
|
2017-06-14T02:44:37
|
|
Namespace header inclusion protection macros
Use LIBBSD_, and remove trailing underscores.
|
|
e8d340de
|
2017-06-05T05:30:27
|
|
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.
|
|
0071b979
|
2017-06-05T05:43:26
|
|
Import <sys/time.h> for some of its macros
Fixes: https://bugs.freedesktop.org/94320
|
|
07c76b66
|
2017-06-05T06:17:27
|
|
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
|
|
e4475738
|
2017-01-20T02:20:12
|
|
Try <linux/a.out.h> if <a.out.h> is not present
At least musl ships the former but not the latter.
|
|
db7470b0
|
2017-01-10T04:27:25
|
|
Gracefully handle lack of system <sys/cdefs.h>
This is the case on musl.
Fixes: https://bugs.debian.org/810589
|
|
337e6202
|
2017-01-10T04:24:35
|
|
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>
|
|
cdf998a0
|
2015-12-14T00:44:47
|
|
Turn <bsd/bsd.h> inert when using LIBBSD_OVERLAY
Also print a warning stating this fact.
|
|
2c77ad59
|
2015-12-14T00:37:34
|
|
Add missing include to <md5.h>
The header was not self-contained, it was missing definitions for some
types included in <sys/types.h>.
|
|
48ac79b1
|
2015-12-12T14:27:12
|
|
Use the non-overlayed libbsd headers when we need our own definitions
|
|
6bcb1312
|
2015-12-07T02:45:52
|
|
Relicense my contribution to BSD-2-clause
This avoids having two licenses on the same file.
|
|
45443583
|
2015-09-23T19:37:37
|
|
Add explicit_bzero() function from OpenBSD
|
|
ee26e59e
|
2015-09-23T05:50:52
|
|
Mark functions handling format strings with __printflike
|
|
151bc71d
|
2015-09-22T16:22:56
|
|
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.
|
|
c7e01e98
|
2014-11-01T00:22:28
|
|
Sync queue(3) from FreeBSD
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=85147
|
|
32671144
|
2014-11-01T00:21:30
|
|
Add __offsetof, __rangeof and __containerof to sys/cdefs.h
Import and adapt from FreeBSD.
|
|
0e4e3ab2
|
2014-11-01T00:20:23
|
|
Add __DECONST, __DEVOLATILE and __DEQUALIFY macros to sys/cdefs.h
Import from FreeBSD.
|
|
02b55488
|
2014-08-12T12:32:34
|
|
Use stdint integer types instead of BSD legacy ones
|
|
63783511
|
2014-08-10T12:34:44
|
|
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>
|
|
faa005cb
|
2014-06-27T02:05:11
|
|
Add reallocarray() function from OpenBSD
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
36aca8c0
|
2014-06-26T21:43:55
|
|
Add stringlist module from NetBSD
|
|
e8f93003
|
2014-06-26T21:32:11
|
|
Add getbsize() function
Import code from DragonFlyBSD and man page from FreeBSD.
|
|
8d16c3df
|
2013-10-11T05:43:42
|
|
Add timeconv module from FreeBSD
Inline license information from FreeBSD root dir COPYRIGHT file.
|
|
f41fdcf1
|
2013-10-21T05:07:56
|
|
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.
|
|
86cbff38
|
2013-10-11T05:11:42
|
|
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.
|
|
c5b95902
|
2013-07-11T12:25:54
|
|
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
|
|
a97ce513
|
2012-11-23T21:19:45
|
|
Add new fgetwln() function
Man page taken from FreeBSD.
|
|
ee0489eb
|
2012-08-07T08:44:30
|
|
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>
|
|
1be0bdb2
|
2012-11-25T21:13:38
|
|
Add new strnstr() function
Taken from FreeBSD.
|
|
ff0d700d
|
2012-11-23T17:16:43
|
|
Add new wcslcat() and wcslcpy() functions
Taken from FreeBSD.
|
|
e7f39760
|
2012-03-23T10:31:42
|
|
Add email address to my name
|
|
e37293a1
|
2012-01-12T18:16:55
|
|
Add <bitstring.h> for compatibility with NetBSD and OpenBSD
|
|
4eab0cc3
|
2012-01-03T05:29:36
|
|
Add inline endian encoding/decoding functions
Taken from FreeBSD.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
866f73af
|
2012-01-03T05:39:22
|
|
Move overlay inclusions outside of header protection
Glibc tends to include standard headers with special definitions
that make few declarations or macros visible, this stomps over the
overlay #include_next <> logic.
Based-on-patch-by: Robert Millan <rmh@debian.org>
|
|
f71d8e05
|
2012-03-21T04:10:37
|
|
Remove bogus deprecation warning from <getopt.h>
|
|
0b96e1a2
|
2012-01-03T07:32:53
|
|
Remove deprecated compatibility includes in headers
|
|
109cafb3
|
2012-01-03T07:32:37
|
|
Remove deprecated headers
|
|
64348583
|
2011-12-31T04:30:48
|
|
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>
|
|
943939d0
|
2011-12-31T08:39:44
|
|
Add new closefrom() function
Code taken from sudo, man page from FreeBSD.
|
|
dcaa93d9
|
2010-12-17T11:13:04
|
|
build: Switch to autotools
|
|
059f89ca
|
2011-07-05T20:59:04
|
|
Add missing semicolon to bsd_getopt() declaration
Accidentally lost in commit 4a6303ba3b64504ab0077b9cfebd2a4b918d531d.
|
|
4a6303ba
|
2011-06-08T02:10:38
|
|
Constify bsd_getopt(3) arguments
This matches the standard declaration for getopt(3).
|
|
b891772a
|
2011-05-29T02:49:14
|
|
Remove blank lines at EOF
|
|
b0eb1997
|
2011-05-28T11:40:36
|
|
Move bsd_getopt() from <bsd/getopt.h> to <bsd/unistd.h>
Deprecate <bsd/getopt.h>.
|
|
0bf3d391
|
2011-05-28T10:39:54
|
|
Include the correct deprecated headeres when using the overlay
|
|
913cdd91
|
2011-05-28T06:35:18
|
|
Do not use the same header inclusion protector for <nlist.h> and <bsd/nlist.h>
Regression introduced in commit f7caf2b30da93d46528ec706dffaf5cbde5266d9.
|
|
200eeb12
|
2011-05-27T21:58:20
|
|
Add LIBBSD_DISABLE_DEPRECATED to deprecated headers
When enabled this will make the inclusion of deprecated headers a
fatal error so that it's easier to spot.
|
|
fbd62297
|
2011-05-27T22:11:28
|
|
Condense and clarify header deprecation warnings
Mention the possibility of using libbsd-overlay.pc.
|
|
755d86be
|
2011-05-27T21:39:14
|
|
Rename LIBBSD_CLEAN_INCLUDES to LIBBSD_DISABLE_DEPRECATED
|
|
cd4996ce
|
2011-05-27T21:23:18
|
|
Namespace header protector in <bsd/sys/cdefs.h> with LIBBSD_SYS_
|
|
8be40010
|
2011-05-27T20:37:10
|
|
Add new <bsd/sys/endian.h> header
|
|
a7dd4457
|
2011-05-27T21:13:18
|
|
Add new <bsd/sys/poll.h> header
|
|
e1f2a6f8
|
2011-05-25T21:27:58
|
|
Add new __packed, __aligned and __nonnull attributes
|
|
87dd203c
|
2011-05-25T21:27:12
|
|
Define __dead2 and __pure2 to actual gcc attributes if possible
|
|
71e5db4c
|
2011-05-25T21:02:40
|
|
Define _SYS_CDEFS_H and _SYS_CDEFS_H after including <sys/cdefs.h>
This makes sure the “standard” inclusion protectors are in place, as at
least some FreeBSD kernel headers expect these to be defined to do some
sanity checks.
|
|
9d042171
|
2011-05-25T07:38:36
|
|
Map getopt to bsd_getopt if we are using the overlay
This will ensure the code can safely and correctly use optreset
transparently.
|
|
de206287
|
2011-05-25T21:25:54
|
|
Define <sys/cdefs.h> attributes conditional to the supported gcc version
|
|
17a9a847
|
2011-05-25T07:36:19
|
|
Rename transparent support to overlay
This affects the pkg-config file now named libbsd-overlay.pc, and the
macro to use the overlay LIBBSD_OVERLAY.
|
|
28585a58
|
2011-05-14T17:58:08
|
|
Add fpurge function
|
|
b36c59c0
|
2011-02-23T12:39:58
|
|
Conditionalize <time.h> inclusion from <bsd/bsd.h>
This was added long time ago to fix some software which was implicitly
depending on the header through some other header, and to avoid having
to modify such software. Conditionalize it on LIBBSD_CLEAN_INCLUDES,
so that buildability can be tested for its future removal.
|
|
8b6a7477
|
2011-02-23T12:38:42
|
|
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.
|
|
f7caf2b3
|
2011-02-23T11:07:30
|
|
Move all header files to /usr/include/bsd/ and deprecate /usr/include/
First stage of the transition to avoid possible clashes with other
software by moving out of the way the remaining headers from
/usr/include/.
At least nlist.h is known to cause file conflicts with some libelf
implementations. libutil.h is not really complete and might cause
confusion if software detects its availability w/o someone actually
checking. And lastly vis.h is not known to cause any problem and it's
complete, but better be safe than sorry.
The compatibility headers will be removed in a later release.
|
|
520682e5
|
2011-02-23T14:04:57
|
|
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.
|
|
741eb587
|
2011-02-22T20:44:21
|
|
Add missing prototypes for arc4random_buf and arc4random_uniform
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=34511
|
|
9baf9640
|
2011-02-22T20:19:37
|
|
Add new <bsd/sys/bitstring.h> header
Taken from FreeBSD.
|
|
4b95e82a
|
2011-02-25T18:48:10
|
|
Add new radixsort and sradixsort functions
Taken from FreeBSD.
|
|
be6ab549
|
2011-02-25T18:17:16
|
|
Add new mergesort function
Taken from FreeBSD.
|
|
5b19adfa
|
2010-12-17T10:50:56
|
|
Add getpeereid function
|
|
acb7c42d
|
2010-07-30T08:00:41
|
|
Add reallocf function
|
|
30c79408
|
2010-01-21T14:34:55
|
|
Make setprogname and getprogname arguments and return value const
This is more correct as the strings are not going to be changed, and it
matches the function signatures on other BSDs.
Suggested-by: Aurelien Jarno <aurel32@debian.org>
|
|
3fed78e5
|
2010-01-10T00:37:03
|
|
Replace setproctitle dummy macro with a function stub
This way we can replace it later on with a real implementation so that
applications can immediately benefit from it w/o the need to recompile
them.
|
|
2a81893c
|
2010-01-10T00:10:21
|
|
Add pidfile functions
Taken from FreeBSD.
Remove MAXPATHLEN from ‘struct pidfh’ and allocate pf_path dynamically,
as some systems do not have such limits. Use dev_t instead of __dev_t.
Replace EDOOFUS with EINVAL.
|
|
98a2479f
|
2010-01-09T23:49:32
|
|
Add flopen function
Taken from FreeBSD.
|
|
7a70f1b0
|
2009-12-11T23:24:31
|
|
Move fmtcheck and fgetln declarations to <bsd/stdio.h>
This is were they are located on the BSDs.
|
|
ca28f280
|
2009-12-11T23:21:14
|
|
Move setmode and getmode declarations to <bsd/unistd.h>
This is were they are located on the BSDs.
|
|
4d17a18d
|
2009-12-11T23:06:27
|
|
Deprecate <bsd/inet.h>
The only function declared in that header file was inet_net_pton, which
is already provided by glibc. Will be removed on the next SONAME bump.
|
|
3c9182b8
|
2009-12-11T23:12:26
|
|
Move arc4random declarations to <bsd/stdlib.h>
This is were they are located on the BSDs.
|
|
dd2756e0
|
2009-12-11T23:13:42
|
|
Mark inclusion of <time.h> from <bsd/bsd.h> deprecated
This will be removed at some point in the future.
|
|
7da57b29
|
2009-12-11T23:01:02
|
|
Remove traces of fgetwln, it was never included
This function was exposed in the header file and the versioning symbol
file, but the actual code was never here.
|
|
a5dbef45
|
2009-12-10T21:02:30
|
|
Make RCS macros take arguments
This was breaking code actually using those macros.
Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
|
|
27842d7f
|
2009-12-10T21:00:45
|
|
Track bug IDs for __unused collision
Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
|
|
c5398adf
|
2009-10-24T00:19:47
|
|
Add readpassphrase function
Taken from OpenBSD.
|
|
538bc879
|
2009-10-24T00:17:57
|
|
Add dehumanize_number function
Taken from NetBSD.
|
|
5c078ce2
|
2009-10-23T23:31:07
|
|
Move <bsd/ip_icmp.h> to <bsd/netinet/ip_icmp.h>
This maps more closely the location of the real header. For
transitional purposes keep a <bsd/ip_icmp.h> that warns and includes
<bsd/netinet/ip_icmp.h>.
|
|
04250f6a
|
2009-10-24T00:15:57
|
|
Add strnvis and strnunvis functions
Taken from OpenBSD.
|
|
b6e84690
|
2009-10-12T01:47:54
|
|
Move <bsd/queue.h> to <bsd/sys/queue.h>
This maps more closely the location of the real header. For
transitional purposes keep a <bsd/queue.h> that warns and includes
<bsd/sys/queue.h>.
|