Guillem Jover [Wed, 25 May 2011 19:02:40 +0000 (21:02 +0200)]
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.
Guillem Jover [Wed, 23 Feb 2011 11:39:58 +0000 (12:39 +0100)]
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.
Guillem Jover [Wed, 23 Feb 2011 11:38:42 +0000 (12:38 +0100)]
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.
Guillem Jover [Wed, 23 Feb 2011 10:07:30 +0000 (11:07 +0100)]
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.
Guillem Jover [Wed, 23 Feb 2011 13:04:57 +0000 (14:04 +0100)]
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.
Guillem Jover [Fri, 25 Feb 2011 12:52:59 +0000 (13:52 +0100)]
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.
Guillem Jover [Sun, 31 Jan 2010 13:13:24 +0000 (14:13 +0100)]
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.
Eric Smith [Sat, 30 Jan 2010 21:13:18 +0000 (22:13 +0100)]
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.
Guillem Jover [Sat, 9 Jan 2010 23:10:21 +0000 (00:10 +0100)]
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.
Guillem Jover [Sat, 12 Dec 2009 00:46:25 +0000 (01:46 +0100)]
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.
Thorsten Glaser [Thu, 10 Dec 2009 17:07:25 +0000 (18:07 +0100)]
Expand on API guarantee for fgetln
OpenBSD has begun using the API guarantee that *len is not 0 if
the fgetln(3) return value is not NULL; document this explicitly
in the manpage and add a comment to the function implementation
that this doesn’t need to be checked because getdelim/getline have
similar guarantees.
Guillem Jover [Fri, 23 Oct 2009 21:31:07 +0000 (23:31 +0200)]
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>.