Commit Graph

696 Commits

Author SHA1 Message Date
Guillem Jover
e1f2a6f869 Add new __packed, __aligned and __nonnull attributes 2011-05-28 10:56:03 +02:00
Guillem Jover
87dd203c26 Define __dead2 and __pure2 to actual gcc attributes if possible 2011-05-28 10:31:07 +02:00
Guillem Jover
de2062873f Define <sys/cdefs.h> attributes conditional to the supported gcc version 2011-05-28 10:31:06 +02:00
Guillem Jover
71e5db4cde 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.
2011-05-28 10:31:06 +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
17a9a8472e 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.
2011-05-27 22:45:26 +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
b36c59c0ed 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.
2011-05-14 14:18:22 +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
f7caf2b30d 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.
2011-05-14 13:52:52 +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
4c01261f39 Move each version symbol declaration into its own line 2011-05-14 13:43:49 +02:00
Guillem Jover
8a99226f16 Generalize pkg-config file handling
Use a make pattern for the .pc rule to allow using more than one .pc
file. And generalize the .gitignore entry.
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
Kevin McCarthy
741eb58763 Add missing prototypes for arc4random_buf and arc4random_uniform
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=34511
2011-05-14 13:43:49 +02:00
Guillem Jover
9baf9640b9 Add new <bsd/sys/bitstring.h> header
Taken from FreeBSD.
2011-05-14 13:43:49 +02:00
Guillem Jover
4b95e82a32 Add new radixsort and sradixsort functions
Taken from FreeBSD.
2011-05-14 13:43:48 +02:00
Guillem Jover
c766e58acf Add man pages for heapsort and mergesort
Taken from FreeBSD, originally as qsort.3 but qsort references stripped.
2011-05-14 13:43:48 +02:00
Guillem Jover
be6ab54986 Add new mergesort function
Taken from FreeBSD.
2011-05-14 13:43:48 +02:00
Guillem Jover
5b19adfa82 Add getpeereid function 2011-05-14 13:43:41 +02:00
Aurelien Jarno
acb7c42d7c Add reallocf function 2011-02-23 14:44:37 +01:00
Guillem Jover
06a60a166a build: Use proper user variables during build
To compile we need to use CPPFLAGS and CFLAGS, to link CFLAGS and
LDFLAGS. Rename MK_CFLAGS to MK_CPPFLAGS as those are only relevant
at compilation time.

Reported-by: Eric Smith <eric@brouhaha.com>
2010-01-31 14:13:24 +01:00
Guillem Jover
51863b6cf9 build: Use new AR variable instead of hardcoded command 2010-01-30 22:43:56 +01:00
Guillem Jover
08afd5d4c9 build: Refactor COMPILER and LINK commands into new variables 2010-01-30 22:42:00 +01:00
Guillem Jover
1f0b0b23cd build: Use CCLD instead of hardcoded gcc for linking 2010-01-30 22:40:01 +01:00
Guillem Jover
32d79b0310 build: By default set CC to gcc 2010-01-30 22:39:18 +01:00
Eric Smith
cd730a02c3 build: Install shared library with 755 permission
The Makefile should install the shared library with 755 permission
rather than 644. That's standard practice, and required when building
RPMs on Fedora to get a debuginfo package.
2010-01-30 22:13:18 +01:00
Guillem Jover
11f2c32df2 Fix setprogname to strip leading paths from progname 2010-01-30 22:00:18 +01:00
Guillem Jover
30c794083f 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>
2010-01-21 14:34:55 +01:00
Guillem Jover
ddebbd6792 Release libbsd 0.2.0 2010-01-10 15:29:51 +01:00
Guillem Jover
abe0a4a7e6 Reformat code to KNF 2010-01-10 15:29:51 +01:00
Guillem Jover
2872bfa151 Add vis and unvis man pages
Taken from OpenBSD.
2010-01-10 15:29:51 +01:00
Guillem Jover
e544a41f62 Add dehumanize_number man page link 2010-01-10 15:29:51 +01:00
Guillem Jover
7b3873bc1e Update vis and unvis modules from OpenBSD 2010-01-10 15:29:51 +01:00
Guillem Jover
8103fe1486 Update strlcat and strlcpy from OpenBSD 2010-01-10 15:29:51 +01:00
Guillem Jover
d63e081303 Add arc4random_buf and arc4random_uniform functions
Update arc4random module from FreeBSD.
2010-01-10 15:29:50 +01:00
Guillem Jover
3fed78e5b0 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.
2010-01-10 15:29:50 +01:00
Guillem Jover
2a81893cc0 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.
2010-01-10 15:29:46 +01:00
Guillem Jover
98a2479f0b Add flopen function
Taken from FreeBSD.
2010-01-10 13:36:38 +01:00
Guillem Jover
57cc5326cf Move man pages to the same directory as the source code
This matches BSD style source tree, and makes it easier to see what's
missing.
2010-01-10 13:36:38 +01:00
Guillem Jover
9e4adc4633 build: Untangle the package version from the soversion
Add a new script to generate the package version from git. Use that for
the pkg-config file and the tarball name.
2010-01-10 13:36:38 +01:00
Guillem Jover
db406fe24c build: Make dist use files from git plus few autogenerated ones
To avoid forgetting to include files, we'll use “git ls-files” and will
include few precious autogenerated files that cannot be generated later
on w/o git. This includes mainly the ChangeLog.
2010-01-10 13:36:35 +01:00
Guillem Jover
9396cc62cf build: Do not duplicate generated filenames in several variables 2010-01-09 19:56:45 +01:00
Guillem Jover
7a70f1b019 Move fmtcheck and fgetln declarations to <bsd/stdio.h>
This is were they are located on the BSDs.
2009-12-12 01:13:29 +01:00
Guillem Jover
ca28f28046 Move setmode and getmode declarations to <bsd/unistd.h>
This is were they are located on the BSDs.
2009-12-12 01:11:56 +01:00
Guillem Jover
dd2756e000 Mark inclusion of <time.h> from <bsd/bsd.h> deprecated
This will be removed at some point in the future.
2009-12-12 01:11:08 +01:00
Guillem Jover
3c9182b85e Move arc4random declarations to <bsd/stdlib.h>
This is were they are located on the BSDs.
2009-12-12 01:11:08 +01:00