Commit Graph

102 Commits

Author SHA1 Message Date
Guillem Jover
e50896286c build: Do not require funopen() to be ported
This function cannot be easily and (more importantly) correctly ported
without cooperation from the libc stdio layer. We already document that
users should be prepared to have the function not available on some
platforms and that they should ideally switch their code to other
more portable and better interfaces.

Instead of making the build fail, and requiring porters to add
exceptions for something that most probably cannot be ported correctly
anyway, simply print a warning and let it build. This will not be a
regression because on those systems libbsd would have never been built
before.

Prompted-by: Jens Finkhaeuser <jens@finkhaeuser.de>
2022-11-24 23:23:33 +01:00
Guillem Jover
00b538ffa3 build: Terminate lists in variables with «# EOL»
This means we can add a trailing «\» to every element, so that they
can be removed without requiring modification of other lines, and can
be easily sorted.

Replace the old usage of $(nil) which could possibly end up with junk
added if such variable is ever defined, in the environment.
2022-11-23 23:44:09 +01:00
Guillem Jover
3538d38fe7 man: Discourage using the library in non-overlay mode
This makes code using it non-portable, and requires the namespeced
headers from libbsd, instead of any generic system headers. It also
requires more code changes than the overlay mode.
2022-10-06 03:59:33 +02:00
Guillem Jover
28298ac037 doc: Switch references from pkg-config to pkgconf
The former used to be the reference implementation, but it has been
stagnant to the point of not showing much signs of life. Switch to
the currently active and more complete implementation for references.
2022-10-05 01:36:28 +02:00
Guillem Jover
f4baceb82c man: Rewrite gerprogname(3bsd) from scratch
This gets rid of one of the last man pages with a BSD-4-clause license.
2022-08-03 11:39:31 +02:00
Guillem Jover
f35c545847 man: Lowercase man page title
While using fully uppercase man page titles has been the usual
convention for a very long time, it is rather ugly and something that
some other projects are switching away from.
2022-08-03 11:39:31 +02:00
Guillem Jover
b466b14afb man: Document that some arc4random(3) functions are now in glibc 2.36 2022-08-03 11:39:31 +02:00
Guillem Jover
1f6a48b209 Sync arc4random(3) implementation from OpenBSD
Closes: #12
2022-08-03 11:39:31 +02:00
Guillem Jover
c9c78fdfd0 man: Use -compact also for alternative functions in libbsd(7)
The other function lists use the compact mode, let's be uniform about
this.
2022-06-08 11:50:47 +02:00
Guillem Jover
f7465b93ec man: Document when functions were added to musl in libbsd(7)
The explicit_bzero(3) and reallocarray(3) functions are also present on
musl libc, mention it in the superseded section.
2022-03-30 22:58:47 +02:00
Guillem Jover
7aed0edf73 man: Add missing comma in .Dd for tree(3)
Reported-by: Thorsten Glaser <tg@mirbsd.de>
2021-12-02 00:35:40 +01:00
Guillem Jover
fafcc397ac man: Update tree(3) man page from OpenBSD
This man page has a BSD-3-clause-author license instead of the old
BSD-4-clause license.
2021-12-01 04:17:11 +01:00
Guillem Jover
428be9e030 man: Fix .Nx macro usage
Its arguments are used as version numbers, so we need continue the
content on the next line.
2021-11-27 05:06:14 +01:00
Guillem Jover
731b0a7739 build: Detect sed at configure time
Check whether sed is available and use the implementation matching the
requirements via the SED variable.
2021-11-27 05:06:14 +01:00
Guillem Jover
d563a17430 man: Call the libbsd-ctor library by its name instead of bsd-ctor 2021-02-28 05:28:57 +01:00
Guillem Jover
785cf9d1e9 man: Fix pkg-config(1) references in libbsd(7) man page 2021-02-28 05:28:57 +01:00
Faidon Liambotis
4676026286 Update <sys/queue.h> from FreeBSD
This brings <sys/queue.h> to the most up-to-date version from FreeBSD,
incorporating 18 commits from the past 5 years (2015-02-24 - 2021-01-25):

  $ git log --oneline 9090a24aed70..8d55837dc133 sys/sys/queue.h share/man/man3/queue.3

Only minimal changes compared to the FreeBSD version have been applied
(queue.3 -> queue.3bsd, _LIBBSD_ prefix).

[guillem@hadrons.org: Remove reference to kernel mode in man page. ]

Closes: !12
Signed-off-by: Guillem Jover <guillem@hadrons.org>
2021-02-08 04:02:16 +01:00
Guillem Jover
18ebabf223 man: Update libbsd(7) man page with updates in 0.11.0 2021-02-07 15:17:33 +01:00
Guillem Jover
847e682f8d Use libmd hashing function implementations instead of embedding our own
This splits the implementation responsibilities, and reduces embedded
code copies, which was one of the driving points with this project to
start with, so it's nice to give a good example.
2021-02-07 01:28:27 +01:00
Guillem Jover
37a9b56c05 Import pwcache module from OpenBSD 2021-02-07 01:28:27 +01:00
Guillem Jover
45dd5229ea man: Remove empty line in reallocarray(3bsd)
Warned-by: lintian
Fixes: commit 01f0d1ea1e
2021-02-07 01:28:27 +01:00
Faidon Liambotis
01f0d1ea1e Add recallocarray() and freezero() from OpenBSD
Add recallocarray(), introduced in OpenBSD 6.1, and freezero(),
introduced in OpenBSD 6.2. The former is imported as-is from OpenBSD,
while the latter is the non-malloc-internal branch of the same code (and
also the OpenSSH portable variant).

Both of these originated in OpenBSD, but have also been implemented by
IllumOS, cf. https://www.illumos.org/issues/8546

Documentation for these functions is in malloc(3) upstream, the relevant
parts of which were previously imported in reallocarray(3bsd). Update
reallocarray(3bsd) with the changes that were introduced since, and add
the relevant bits for recallocarray() and freezero(), plus aliases.

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

Closes: !10
Signed-off-by: Guillem Jover <guillem@hadrons.org>
2021-01-01 18:18:51 +01:00
Guillem Jover
eac4ce0c67 man: Add a timespec(3bsd) alias to timeval(3bsd)
Even though man-pages project now includes man pages for system data
types, we still include these for any other system that does not have
them, to provide a self-contained project with code and documentation.
2020-12-21 17:48:46 +01:00
Guillem Jover
5ecff0c903 man: Add missing LIBRARY section 2020-12-21 17:44:26 +01:00
Guillem Jover
59f6a95609 man: Add missing doc-operating-system-NetBSD string variable
Fixes: commit 99320b9168.
2020-12-21 17:19:23 +01:00
Guillem Jover
3aaedb1208 nlist: Check whether the nl argument is not NULL
This prevents programming errors.

Reported-by: Daniel Hodson <daniel@elttam.com.au>
Based-on-patch-by: Daniel Hodson <daniel@elttam.com.au>
Signed-off-by: Guillem Jover <guillem@hadrons.org>
2019-08-08 03:22:09 +02:00
Guillem Jover
2c754f435b man: Add man page sections to function references
Signed-off-by: Guillem Jover <guillem@hadrons.org>
2019-08-08 03:22:09 +02:00
Sebastian
ee4d24970a man: Fix typo
Closes: !5
Signed-off-by: Guillem Jover <guillem@hadrons.org>
2019-08-08 03:22:09 +02:00
Guillem Jover
8d2afa3a9f man: Fix typos
Signed-off-by: Guillem Jover <guillem@hadrons.org>
2019-08-08 03:22:09 +02:00
Guillem Jover
e9f6faf3aa man: Replace references to a.out(5) with elf(5)
The a.out(5) support in nlist(3) got removed some time ago, and
there is now only elf(5) support.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
2019-08-08 03:22:09 +02:00
Guillem Jover
99320b9168 man: Define doc-operating-system-NetBSD string variables
This way we do not depend on the installed groff being new enough.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
2019-08-08 03:22:09 +02:00
Guillem Jover
71c710e9a8 man: Use major.minor version for .Nx macros
The macro only recognizes this version form, and not just major alone.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
2019-08-08 03:22:09 +02:00
Guillem Jover
21f4052c5b man: Add doc-str-Lb-libbsd aliases for str-Lb-libbsd
groff(1) has changed the internal layout for the .Lb doc strings, but to
preserve backwards compatibility we cannot simply rename them, we need
to create new aliases so that these will work with old and new macros.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
2019-08-08 03:22:09 +02:00
Jakub Wilk
a8531ad051 man: Fix comma splice
Signed-off-by: Guillem Jover <guillem@hadrons.org>
2018-05-23 02:58:09 +02:00
Jakub Wilk
c4b0fd2c9f man: Fix name of the function injected by libbsd-ctor
Signed-off-by: Guillem Jover <guillem@hadrons.org>
2018-05-23 02:58:09 +02:00
Guillem Jover
3cabf46bb0 Deprecate fgetwln()
This function has the same problems as fgetln() which is already marked
as deprecated.
2018-05-21 04:48:32 +02:00
Guillem Jover
6f68c93076 Switch strtonum() implementation from strtoll() to strtoi()
Import from NetBSD.
2018-05-21 04:48:32 +02:00
Guillem Jover
e13b1a337a Import strtoi() and strtou() functions from NetBSD 2018-05-21 04:47:28 +02:00
Guillem Jover
2d7de186e9 Update vis/unvis modules from NetBSD 2018-05-21 04:47:28 +02:00
Guillem Jover
3efad64155 Update readpassphrase() from OpenBSD 2018-05-21 04:47:28 +02:00
Guillem Jover
21edbb4f22 Update fmtcheck() from NetBSD 2018-05-21 04:47:28 +02:00
Guillem Jover
facbddb652 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.
2018-05-21 04:47:28 +02:00
Guillem Jover
993828d84e Add flopenat() function from FreeBSD 2018-05-21 03:49:26 +02:00
Guillem Jover
22fbd62368 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.
2017-12-03 16:43:28 +01:00
Guillem Jover
b4f7c065ba man: Document on what other BSDs arc4random(3) is present 2017-12-03 16:41:55 +01:00
Guillem Jover
9532cb39f4 man: Update man page sections in titles and references
We have moved all man pages to section 3bsd, let's do the same for the
page title, and in all the references for uniformity and to avoid
confusions.

Fixes: https://bugs.freedesktop.org/101545
2017-06-24 16:08:27 +02:00
Guillem Jover
a4dd754c8d man: Ship and install libbsd(7)
Fixes: https://bugs.freedesktop.org/101543
2017-06-24 16:08:27 +02:00
Guillem Jover
0071b97958 Import <sys/time.h> for some of its macros
Fixes: https://bugs.freedesktop.org/94320
2017-06-19 03:17:21 +02:00
Guillem Jover
ab5db68bae build: Add missing \ at end of line
Fixes: commit 934b7a0ccb
2017-06-19 03:03:23 +02:00
Guillem Jover
c74ca09916 man: Use .In intead of .Fd macros for includes 2017-06-09 05:46:34 +02:00