Commit Graph

179 Commits

Author SHA1 Message Date
Guillem Jover
8be40010ce Add new <bsd/sys/endian.h> header 2011-05-28 10:58:26 +02:00
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
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
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
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
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
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
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
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
Guillem Jover
4d17a18db5 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.
2009-12-12 01:11:08 +01:00
Guillem Jover
7da57b293f 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.
2009-12-12 01:11:08 +01:00
Thorsten Glaser
a5dbef45e7 Make RCS macros take arguments
This was breaking code actually using those macros.

Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
2009-12-10 21:05:52 +01:00
Thorsten Glaser
27842d7f77 Track bug IDs for __unused collision
Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
2009-12-10 21:05:33 +01:00
Guillem Jover
c5398adfe2 Add readpassphrase function
Taken from OpenBSD.
2009-12-10 20:54:03 +01:00
Guillem Jover
538bc87998 Add dehumanize_number function
Taken from NetBSD.
2009-12-10 20:54:00 +01:00
Guillem Jover
04250f6a7c Add strnvis and strnunvis functions
Taken from OpenBSD.
2009-10-24 01:47:26 +02:00
Guillem Jover
5c078ce2f5 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>.
2009-10-24 01:47:26 +02:00
Guillem Jover
614eb0402a Add new <bsd/sys/tree.h> header 2009-10-24 01:47:25 +02:00
Guillem Jover
b6e8469059 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>.
2009-10-24 01:47:25 +02:00
Guillem Jover
d3e14ea99e Move <bsd/cdefs.h> to <bsd/sys/cdefs.h>
This maps more closely the location of the real header. For
transitional purposes keep a <bsd/cdefs.h> that warns and includes
<bsd/sys/cdefs.h>.
2009-10-24 01:47:22 +02:00
Guillem Jover
e51be45c40 Update <sys/queue.h>
Taken from FreeBSD.
2009-10-24 01:11:23 +02:00
Guillem Jover
56ddcfe65a Add strtonum function
Taken from FreeBSD.
2009-10-24 01:11:23 +02:00
Guillem Jover
33ef70b9e1 Add __pure2 dummy macro 2009-07-17 13:35:37 +02:00
Guillem Jover
8ef0ecdf44 Add more dummy id macros 2009-07-17 13:34:30 +02:00
Guillem Jover
cb1346e5b3 Export public functions as extern C 2009-05-25 09:25:13 +02:00
Guillem Jover
61fa98ea9e Add missing <stdarg.h> include in <bsd/err.h> 2009-05-25 09:12:45 +02:00
Guillem Jover
931e043430 Add new __RCSID macro
Define it to nothing, so that source imported from BSDs can be easily
compiled w/o needing to modify them.
2009-05-25 08:56:34 +02:00
Guillem Jover
80c3954e3c Use the correct path when including a.out.h
Reported-by: Aurélien Jarno <aurelien@aurel32.net>
2009-05-25 06:23:01 +02:00
Guillem Jover
1f0b016e97 Use UTF-8 copyright symbols for non-imported files 2009-05-20 04:20:21 +02:00
Guillem Jover
dcaec44a6f Add nlist function 2009-05-20 04:14:19 +02:00
Guillem Jover
8dbfb3529b Add strmode function 2009-05-20 04:14:07 +02:00
Guillem Jover
4c9c8ed74c Add a new header file to expose inet_net_pton prototype 2008-07-26 22:35:31 +03:00
Guillem Jover
38829bdc8b Add new setmode and getmode functions from FreeBSD 2008-07-09 09:07:03 +03:00
Guillem Jover
a5f7d1a8f1 Include the rest of the header files 2008-07-09 09:04:51 +03:00
Guillem Jover
8b95dc5865 Disable __bounded__ __attribute__ 2008-07-09 09:04:27 +03:00
Guillem Jover
1512d0d4ab Renumber 4th clause from BSD license to 3rd
Those files have only three clauses.
2008-07-09 07:22:30 +03:00
Guillem Jover
b0f64624bb Add missing license headers
With permission from Robert Millan and Aurelien Jarno.
2008-07-09 07:16:20 +03:00
Guillem Jover
a5709cbc88 Add license header 2008-06-18 08:47:58 +03:00
Guillem Jover
bf4eeb29f0 Add arc4random_stir and arc4random_addrandom functions 2008-06-18 08:44:18 +03:00
Guillem Jover
b37f1039ef Replace current md5 code with one from MirBSD and OpenBSD
This adds the following public functions:
MD5Transform, MD5End, MD5File, MD5FileChunk, MD5Data
2008-06-18 08:19:41 +03:00
Guillem Jover
20bf55ffa5 Include missing stddef.h 2008-06-18 08:09:51 +03:00
Guillem Jover
d033e58045 Remove cruft macros and includes 2008-06-18 07:59:43 +03:00
Guillem Jover
c14d23b5d7 Add license header 2008-06-18 07:49:59 +03:00
Guillem Jover
f5b8317051 Remove UC Berkeley advertising clause
As per <ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change>.
2008-05-06 08:56:38 +03:00
Petr Salinger
c5793d47d1 bsd/queue.h: Sync with current glibc variant from GNU/kFreeBSD 2008-05-06 08:56:38 +03:00
Petr Salinger
ac32eefec5 bsd/bsd.h: Cleanup 2008-05-06 08:56:37 +03:00
Petr Salinger
30176335f9 humanize_number: New function 2008-05-06 08:56:37 +03:00
Robert Millan
3462d1261f Add heapsort 2008-05-06 08:54:07 +03:00
Robert Millan
40bb012fee Add vis and unvis 2008-05-06 08:52:46 +03:00
Robert Millan
5bd834027d Add getprogname and setprogname 2008-05-06 08:52:15 +03:00
Guillem Jover
1e8b819b45 Disable __unused
It conflicts with a struct member in a Linux header.
2008-05-06 08:51:56 +03:00
Guillem Jover
67e48af044 Remove unused includes and protect header 2008-05-06 08:51:43 +03:00
Guillem Jover
c9e733b215 Remove commented out macros 2008-05-06 08:50:52 +03:00
Guillem Jover
8150473420 Move some macros to cdefs.h 2008-05-06 08:50:47 +03:00
Robert Millan
7aed0593e0 Add bsd_getopt 2008-05-06 08:50:26 +03:00
Robert Millan
7a8c1c8648 Use the same macro (_SYS_QUEUE_H) as <sys/queue.h> for header protection
This prevents collisions.
2008-05-06 08:50:08 +03:00
Robert Millan
19cc95400b bsd/queue.h: Replace with patched copy of glibc's <sys/queue.h>
This doesn't affect freebsd6-buildutils.
2008-05-06 08:48:17 +03:00
Robert Millan
e8d3b08cc6 Add __unused 2008-05-06 08:47:32 +03:00
Robert Millan
33eb3ecc41 Add errc, warnc, verrc and vwarnc 2008-05-06 08:47:26 +03:00
Aurelien Jarno
dedb8169c4 Added manpages and fixed fmtcheck 2008-05-06 08:47:20 +03:00
Aurelien Jarno
91473e2748 fmtcheck: New function 2008-05-06 08:45:48 +03:00
Guillem Jover
657f1b59ce Reorganize header files 2008-05-06 08:45:47 +03:00