Commit Graph

130 Commits

Author SHA1 Message Date
Guillem Jover
31e9396bf2 build: Only install time struct conversion macros where missing
These macros are available in several systems, and we should not install
the man pages for them, otherwise we might end up shadowing the system
man pages if present.
2024-03-13 00:56:07 +01:00
Guillem Jover
3b8416acab man: Add links for errc module functions
Reported-by: Alejandro Colomar <alx@kernel.org>
2024-03-11 03:40:39 +01:00
Guillem Jover
94d0fb3c53 man: Do not install timeval(3bsd) nor timespec(3bsd)
These are system types, which we should not be documenting. Rewrite the
man pages around the TIMEVAL_TO_TIMESPEC and TIMESPEC_TO_TIMEVAL macros.
2024-03-11 03:40:26 +01:00
Guillem Jover
be4aced4c5 build: Make almost all exposed interfaces use the new ABI selection
Explicitly select what to include as part of the target ABI, instead of
letting autoconfiguration potentially break ABI if the system grows
functionality provided by the library.

Make almost all the library selectable per target. Do not install manual
pages for interfaces not included in the library. Control inclusion of
symbols in map file via pre-processor macros, and move the comments
describing the ABI selection to configure.ac.

For now the header files are included as is and filtered through
pre-processor conditionals. Eventually they might get switched to be
autogenerated at build time.
2024-02-25 03:50:40 +01:00
Guillem Jover
99739877be build: Rename ABI selection variables from need_ to abi_
This should make the purpose of these variables more clear.
2024-02-25 03:47:54 +01:00
Guillem Jover
a81d0b7113 build: Sort variables and their contents in automake files
This should make it easier to add new entries, and find them afterwards.
2024-02-21 02:09:48 +01:00
Guillem Jover
f8cb9d8b28 build: Remove space before shell redirection
This makes it more clear what the redirection applies to.
2024-02-21 02:09:17 +01:00
Guillem Jover
9fab225f26 Split errc family of functions from err ones
On most systems the err family of functions is already present, but are
missing the errc family of functions, which are also present on some
other systems. Splitting them into separate files will make it easer to
conditionally include one or the other.
2024-02-18 14:02:32 +01:00
Guillem Jover
461f10ac57 Sync strtoi()/strtou() implementations from NetBSD
These contain the fixes to the error handling logic.

In NetBSD the manual page for strtou.3 is generated from the strtoi.3
manual page applying some substitutions, the problem is that the
cross-references are then lost. We will still keep them separate.

Reported-by: Alejandro Colomar <alx@kernel.org>
2024-02-18 13:57:04 +01:00
Guillem Jover
10920c3084 build: Make name_from_id man pages conditional instead of id_from_name
The code is only making the name_from_id function conditional, and
assumes id_from_name are always to be included, so we need to match
the logic for the man page inclusion.
2024-02-17 05:00:58 +01:00
Guillem Jover
97b0fe84b8 man: Mention that funopen() can be made available on musl
As musl got fopencookie() implemented in 1.1.19, the funopen() function
can also be provided there. Note this in the documentation.
2024-01-09 00:00:06 +01:00
Guillem Jover
e87ae3be19 man: Fix manual page references
When referring to another manual page and their section number, we need
to use Xr instead of Fn, otherwise the section number is interpreted as
a function argument. For functions provided by libbsd itself we should
be using the 3bsd section instead of 3.
2024-01-08 23:47:26 +01:00
Guillem Jover
9275d134e5 man: Add closefrom(), strlcpy() and strlcat() as superseded functions
These were missing from the list of functions provided by some libc
implementation.
2024-01-08 23:39:19 +01:00
Guillem Jover
304a1f831c doc: Use macOS to refer to the operating system
This is the correct spelling, instead of capitalizing it.
2024-01-08 23:37:43 +01:00
Guillem Jover
df116b5597 Adjust strlcpy() and strlcat() per glibc adoption
These functions were added in glibc 2.38, in anticipation of POSIX
adopting them too.

Closes: #26
2024-01-07 17:55:40 +01:00
Guillem Jover
9d3e59a01d man: Use VARIANTS instead of ALTERNATIVES in libbsd(7)
Using alternatives seems confusing in this context.
2023-10-10 01:53:32 +02:00
Guillem Jover
f02562d64a man: Markup function references with Xr instead of Fn
These references had man page sections in them, so using Fn meant that
these appeared as function arguments.
2023-10-10 01:52:37 +02:00
Guillem Jover
73b25a8f87 build: Sort entries alphabetically 2023-04-29 03:53:52 +02:00
Guillem Jover
5434ba169b build: Conditionalize wcslcpy() and wcslcat() functions on macOS
These functions are provided by the system libc.
2023-04-29 03:52:49 +02:00
Guillem Jover
dc1bd1a2cb build: Conditionalize only id-from-name functions not the entire pwcache
On macOS the name-from-id functions are present, but not the
id-from-name ones, so we want to provide those instead of suppressing
the entire file.
2023-04-29 03:52:42 +02:00
Guillem Jover
edc746ea7b build: Conditionalize getprogname()/setprogname on macOS
These functions are provided by the system libc, so there is no need for
us to provide them.
2023-04-22 22:47:33 +02:00
Guillem Jover
21d12b0211 build: On macOS do not build functions provided by the system
We have never built before on macOS, so we can exclude all the functions
that are currently provided in the system.

Closes: #1
Closes: !3
2023-04-17 04:12:42 +02:00
Guillem Jover
bc65806ce2 build: Select whether to include funopen() in the build system
This makes sure we include it when expected, alongside the man pages,
and the test cases, and do not accidentally break the ABI if the system
starts providing such interface.
2023-04-17 04:12:42 +02:00
Guillem Jover
ff46386fcb man: Add HISTORY section to arc4random(3bsd) 2023-03-29 02:49:28 +02:00
Guillem Jover
4c6da577a1 man: Switch arc4random(3bsd) man page from OpenBSD to NetBSD
This gets rid of the last BSD-4-clause licensed file in the project.

The man page will probably need to be adapted to the current
implementation, but that can be done piecemeal afterwards.

Closes: #7
2023-03-29 02:48:53 +02:00
Guillem Jover
5962e03c2d man: Fix BSD and glibc versions
The versions used in the BSD macros are unknown, so they emit warnings,
extend or reduce them to use the two digit form. Correct the glibc
version when closefrom(3) got introduced.
2023-03-03 01:35:31 +01:00
Guillem Jover
59a21c7fb8 man: Update STANDARDS and HISTORY sections
Include BSD versions when functions were introduced. Add mention
whether these are BSD extensions.
2023-02-20 00:29:01 +01:00
Guilherme Janczak
23377191e8 man: Prune unneeded <sys/types.h> include in setproctitle(3)
FreeBSD first declared the function in unistd.h in 2000:
https://cgit.freebsd.org/src/commit/include/unistd.h?id=9feac5c21886
No other #include line was needed to use the function, but the man page
unnecessarily instructed users to include sys/types.h until 2022-11-29:
https://cgit.freebsd.org/src/commit/?id=5b6f0a5012e9bc37dcb32b57b41e2443a46da620

libbsd first declared the function in unistd.h in 2010 with commit
3fed78e5b0 and inherited the bug from
FreeBSD's man page.

No need to do anything for backwards compat.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
2022-12-13 03:49:29 +01:00
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