Commit Graph

77 Commits

Author SHA1 Message Date
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
Guillem Jover
ba9e2a5a9c man: Add new libbsd(7) library overview man page 2017-06-09 05:46:29 +02:00
Guillem Jover
6a5a515820 man: Add missing man pages
This adds man pages for byteorder(3), errc(3) and fpurge(3), including
all their aliases.
2017-06-09 05:40:28 +02:00
Guillem Jover
934b7a0ccb man: Add missing aliases 2017-06-07 05:07:55 +02:00
Guillem Jover
f20e6972b3 man: Move all man pages to section 3bsd
This should guarantee that even if the system provides or will provide
native implementations of these functions, we will not have file
conflicts.
2017-06-06 04:37:56 +02:00
Guillem Jover
e86c1b5f43 man: Fix ungrammatical construct
Warned-by: lintian
2016-02-14 09:01:24 +01:00
Guillem Jover
874a0e51d3 Update arc4random module from OpenBSD and LibreSSL
Rework arc4random_stir() and arc4random_addrandom() code over the new
internal API, and documentation in the man page. Adapt the code to the
local build system.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=85827
2015-11-30 23:48:50 +01:00
Guillem Jover
f3b115540c man: Rename funopen.3 to funopen.3bsd to avoid clash with funtools
The funtools project ships a man page with the same, name. And although
it mith probably make more sense to rename the man page there, as BSD
systems will certainly not do so, this is the easiest and fastest way
to avoid a file conflict.
2015-11-30 23:48:50 +01:00
Guillem Jover
45443583df Add explicit_bzero() function from OpenBSD 2015-09-24 05:47:58 +02:00
Guillem Jover
53d989a223 Switch fparseln() implementation from fgetln() to getline() 2015-09-23 07:59:34 +02:00
Guillem Jover
c7e01e9884 Sync queue(3) from FreeBSD
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=85147
2015-09-23 07:59:34 +02:00
Guillem Jover
a6fe103c1b Add new man page for reallocarray(3)
Import man page from OpenBSD.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=85622
2015-09-23 07:14:24 +02:00
Guillem Jover
02b55488c5 Use stdint integer types instead of BSD legacy ones 2015-09-23 07:14:21 +02:00
Guillem Jover
36aca8c06e Add stringlist module from NetBSD 2014-07-17 05:11:00 +02:00
Guillem Jover
e8f9300355 Add getbsize() function
Import code from DragonFlyBSD and man page from FreeBSD.
2014-07-15 10:57:42 +02:00
Guillem Jover
f41fdcf186 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.
2013-10-21 05:35:44 +02:00
Guillem Jover
c5b9590287 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
2013-07-14 13:32:11 +02:00
Guillem Jover
30349f8922 Update radixsort module from NetBSD
Merge some interesting changes.
2013-05-27 04:05:17 +02:00
Guillem Jover
96a2dae352 Update setmode module from NetBSD
Merge some interesting changes.
2013-05-27 04:05:17 +02:00
Guillem Jover
a97ce513e0 Add new fgetwln() function
Man page taken from FreeBSD.
2013-05-27 02:49:28 +02:00
Strake
ee0489eb2b 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>
2013-05-27 02:47:32 +02:00
Guillem Jover
1be0bdb2c9 Add new strnstr() function
Taken from FreeBSD.
2013-05-27 02:12:43 +02:00
Guillem Jover
ff0d700df0 Add new wcslcat() and wcslcpy() functions
Taken from FreeBSD.
2013-05-27 02:11:59 +02:00
Guillem Jover
444bd1fbb8 man: Use minus signs and hyphens consistently
Any string that can be copy & pasted into a terminal, for example,
needs to correctly use minus signs (escaped dashes), instead of the
default hyphen.
2012-06-27 09:13:39 +02:00
Guillem Jover
1d69ae1cd5 man: Recode flopen(3) to UTF-8
Spotted-by: Eric Smith <eric@brouhaha.com>
2012-06-04 05:47:26 +02:00
Guillem Jover
1b5b1cd52a Move mdX.3 man page to section 3bsd
This makes sure there will be no collisions on systems where a mdX.3
provided by a third party is already present.
2012-05-29 04:51:45 +02:00