Log

Author Commit Date CI Message
Guillem Jover 3b8416ac 2024-03-10T18:01:02 man: Add links for errc module functions Reported-by: Alejandro Colomar <alx@kernel.org>
Guillem Jover 94d0fb3c 2024-03-08T03:05:24 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.
Duncan Overbruck ee63bca5 2024-03-05T17:01:29 closefrom: Ignore files starting with dot when scanning /proc/self/fd Signed-off-by: Guillem Jover <guillem@hadrons.org>
Duncan Overbruck e848f5aa 2024-03-05T17:02:32 strtonum: Do not abort on EINVAL from strtoi() With musl libc strtoimax(".", ...) returns EINVAL. Closes: !28 Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover 9cbd935d 2024-03-06T02:12:56 build: Match also gnu* for GNU/Hurd on the glibc ABI selection The GNU/Hurd system does not specify a kernel part, so we need to match on both *-gnu* and gnu* (to avoid overmatching with just *gnu*).
Guillem Jover 70f49a70 2024-02-28T04:50:34 Release libbsd 0.12.1
Guillem Jover b6ccd032 2024-02-28T04:44:02 build: Add a comment to libbsd-overlay.pc about -isystem usage Add the reasoning for why we use -isystem instead of -I, to avoid confusing unsuspecting readers of the file. Prompted-by: Alejandro Colomar <alx@kernel.org>
Guillem Jover 08188f3c 2024-02-28T04:37:44 build: Install err.h if either of the err or errc modules are built Both modules expose their functions in err.h, so we need to install it whenever any of them is being built. Reported-by: Alejandro Colomar <alx@kernel.org>
Guillem Jover 644062da 2024-02-27T05:52:53 Release libbsd 0.12.0
Guillem Jover 32d18dcf 2024-02-09T04:32:12 Add explicit time32 and time64 support Handle the three potential system scenarios: - system time_t is time64 - system time_t is time32 and supports time64 - system time_t is time32 and does not support time64 Add the explicit time32 and time64 functions when necessary and map them accordingly for each of these cases.
Guillem Jover 605614d6 2024-02-12T03:00:06 build: Add support for AIX
Guillem Jover ec7f5ee9 2024-02-12T01:04:37 Add vasprintf() and asprintf() functions missing on AIX These functions are used by code in the library, even though these functions started as GNU extensions, they are present in all BSDs, so we expose them as part of our interface on AIX.
Guillem Jover 5392f0c1 2024-02-12T02:55:08 build: Add support for Solaris
Guillem Jover be4aced4 2024-02-11T23:55:40 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.
Guillem Jover 27503a10 2024-02-14T04:59:44 build: Rework ABI selection logic Add a new LIBBSD_SELECT_ABI m4 macro, and use it to setup the ABI interfaces to expose and the various variables and conditionals to be used by the build system. Switch to set the initial values to unknown and then set every one of the selections explicitly by supported target. Update comments for rationale for things to DROP, or for why some selections are enabled.
Guillem Jover 99739877 2024-02-14T04:59:44 build: Rename ABI selection variables from need_ to abi_ This should make the purpose of these variables more clear.
Guillem Jover 0bdbc078 2024-02-21T02:29:15 build: Revert accidental testing aid change This was accidentally included in the commit, but should have only been used during development. Fixes: commit de124dcafac678351366b0572938398ea7ae93e4 Changelog: silent
Guillem Jover de124dca 2024-02-20T04:28:01 build: Make digest function checks conditional on their use The digest function checks where unconditionally requiring the functions to exist or they would error out. But these functions are not required on all systems, they depend on the ABI to be exposed.
Guillem Jover 1d287295 2024-02-20T04:13:59 build: Move ABI selection at the top of configure.ac Merge the existing host_os block for the OS detection with the ABI selection one, as these are related. This way we will be able to make some of the latter checks conditional on the selected ABI.
Guillem Jover a81d0b71 2024-02-11T23:55:40 build: Sort variables and their contents in automake files This should make it easier to add new entries, and find them afterwards.
Guillem Jover c8e5338a 2024-02-21T02:05:57 build: Rename LIBBSD_ABI to SOVERSION This matches the semantics of the variable, and makes it independent of the project, just as the package variables.
Guillem Jover b6d6da4c 2024-02-20T04:40:32 build: Refactor function checks into a new libbsd-funcs.m4 file These are complex enough to clutter the main configure.ac. Move them into their own file.
Guillem Jover f8cb9d8b 2024-02-20T03:57:37 build: Remove space before shell redirection This makes it more clear what the redirection applies to.
Guillem Jover 154624ab 2024-02-18T20:40:24 build: Add support for silent rules for the libbsd.map generation The new rule was introduced w/o silent rule support. Fixes: commit 19e06407eb365a2bedc9bdd29a83c1e1803e3f92
Guillem Jover 9fab225f 2024-02-17T05:25:01 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.
Guillem Jover 461f10ac 2024-02-17T03:07:58 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>
Guillem Jover f0501609 2024-02-14T03:39:16 build: Swap symbol and alias arguments order in macros creating aliases The current order is rather confusing, pass the real symbol first and the alias we want to create next.
Guillem Jover 19e06407 2024-02-11T19:35:05 build: Generate the map file from the configured ABI Some linkers require the map file definitions to contain only symbols that are present on the linked object, either in the map file or in the sym file we generate from the map file. This is preparatory work to be able to conditionally include symbols in the man and sym files depending on the ABI definitions.
Guillem Jover 10920c30 2024-02-12T00:06:56 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.
Guillem Jover 97b0fe84 2024-01-08T23:57:45 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.
Guillem Jover e87ae3be 2024-01-08T23:40:31 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.
Guillem Jover 9275d134 2024-01-08T23:39:19 man: Add closefrom(), strlcpy() and strlcat() as superseded functions These were missing from the list of functions provided by some libc implementation.
Guillem Jover 304a1f83 2024-01-08T23:37:43 doc: Use macOS to refer to the operating system This is the correct spelling, instead of capitalizing it.
Guillem Jover edddd806 2024-01-08T02:16:12 Release libbsd 0.11.8
Guillem Jover dd0bdb58 2024-01-08T01:58:54 test: Close all descriptors before initializing them for closefrom() On macOS, closefrom() only sets the close-on-exec flag, so we cannot check whether all file descriptors were closed, which means that if on entry our file descriptor table was filled after the 4th file descriptor, then we might fail the assertions for the flags for odd file descriptors which we expect to be closed. This can easily happen when running the test suite in parallel mode with «make -j8 check» for example. Closes: #23
Guillem Jover 0813f378 2023-10-28T00:52:31 build: Check out-of-tree builds in CI Make sure the out-of-tree builds do not regress.
Guillem Jover df116b55 2024-01-07T17:43:12 Adjust strlcpy() and strlcat() per glibc adoption These functions were added in glibc 2.38, in anticipation of POSIX adopting them too. Closes: #26
Guillem Jover ecb44e16 2023-11-14T19:15:11 Do not add a pointer to the NULL constant Warned-by: cppcheck (nullPointerArithmetic)
Guillem Jover 459b7f7d 2023-11-14T19:09:25 Do not confuse code analyzers with out-of-bounds array access look alike The code is only getting the address, but we might be performing an addressing that is out-of-bounds. Avoid it and use the address form instead. Warned-by: cppcheck (objectIndex)
Guillem Jover a44f885c 2023-11-14T19:08:15 test: Fix short-lived memory leak Warned-by: cppcheck
Guillem Jover 3f5ca0aa 2023-10-28T00:47:26 build: Add a coverage regex to the CI job This is needed so that gitlab can know where to extract the coverage percentage from in the output, to be able to track and report it.
Guillem Jover 9d3e59a0 2023-10-10T01:53:32 man: Use VARIANTS instead of ALTERNATIVES in libbsd(7) Using alternatives seems confusing in this context.
Guillem Jover f02562d6 2023-10-10T01:52:37 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.
Guillem Jover b7367c9c 2023-09-05T03:02:44 build: Add missing dash to macro title bar
Guillem Jover 6777eb62 2023-07-27T13:57:51 pwcache: Do not declare uidtb and gidtb when not used When the system provides implementations for user_from_uid() or group_from_gid() we are not using these variables, so better not declare them. Fixes: commit 21d12b02112097f0c195dceb1892c95b7b957b36
Guillem Jover d4e0cdc9 2023-07-27T13:39:00 fgetln: Include <stdio.h> after <sys/*> The <sys/*> headers tend to define things that might be used by other headers, so while they should be self-contained, it is better to simply include them first.
Guillem Jover f41d6c12 2023-05-26T23:55:40 build: Refactor GNU .init_array support check into a new m4 function
Guillem Jover 30b48ed9 2023-05-26T23:50:10 build: Refactor linker script detection into a new m4 function
Guillem Jover d0d8d019 2023-07-27T13:51:36 build: Do not provide prototypes for arc4random() on Solaris These functions are provided by the system.
Guillem Jover cf61ebb8 2023-04-22T20:47:20 build: Do not build the progname module if it is not needed This was made conditional, but the code part was accidentally left untouched due to having ported it locally to use __progname, which caused build failures on the stock repo. Fixes: commit 046621d7967e7a0f08ae988bcf7e4cd1b6cf204c
Guillem Jover 73b25a8f 2023-04-23T02:04:47 build: Sort entries alphabetically
Guillem Jover 5434ba16 2023-04-23T02:05:04 build: Conditionalize wcslcpy() and wcslcat() functions on macOS These functions are provided by the system libc.
Guillem Jover dc1bd1a2 2023-04-23T02:00:10 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.
Guillem Jover edc746ea 2023-04-22T22:47:10 build: Conditionalize getprogname()/setprogname on macOS These functions are provided by the system libc, so there is no need for us to provide them.
Guillem Jover 8f998d1d 2023-04-22T20:23:08 progname: Include <procinfo.h> if available We need this header on AIX. Missed transplanting the code from the AIX porting system. Fixes: commit 9fa06763a1afe0946a3a20e5bbdba72885cbade5
Guillem Jover d08163b4 2023-04-18T03:56:16 build: Check whether we need libperfstat on AIX The getentropy() implementation makes use of this library on AIX.
Guillem Jover 1186cf88 2023-04-18T03:59:17 build: Annotate droppable functions for musl on next SOVERSION bump These are already provided by the musl libc, and can thus be dropped on the next SOVERSION bump.
Guillem Jover 6385ccc9 2023-04-18T03:58:24 build: Conditionalize bsd_getopt() on macOS The system library provides a getopt() with BSD semantics.
Guillem Jover c1206817 2023-04-18T00:47:12 Move the version script comments before the symbols When generating the .sym export file from the .map file, we are not stripping these comments that are part of the same line as the symbol, which causes ld(1) implementations to error out. Moving them before the symbols avoids the need to strip them, as we are only keeping actual symbol lines.
Guillem Jover 9fa06763 2023-04-18T00:44:49 Port getprogname() to AIX Get the program name from the COMM field from the proc filesystem. We could use instead the information from the psinfo binary file under /proc, but that seems to have a shorter string limit.
Guillem Jover 92337b15 2023-04-17T23:59:03 Make getprogname() porting mandatory Although the function is documented as possibly returning NULL if it cannot find a known source of information, we should still at least attempt to port it to any supported system, and otherwise explicitly mark it as not implementable for such systems if that was to be the case.
Guillem Jover 90b7f3ae 2023-04-17T23:59:19 test: Do not use /dev/null as compiler output file Some ld(1) implementations, such as the one on AIX, do not support using /dev/null as the output filename for the compiled object. Use an actual filename that we will then clean up.
Guillem Jover 426bf452 2023-04-18T00:49:09 build: Add generated *.sym files to .gitignore
Guillem Jover 21d12b02 2023-04-04T23:59:05 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
Guillem Jover bc65806c 2023-04-06T23:05:27 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.
Guillem Jover 8b7a4d9d 2023-04-07T23:43:55 build: Move Windows OS detection to the OS features section This was placed here to make use of the same AS_CASE, but it does not really fit with the section. Move it to the more appropriate place, and detangle the AS_CASE.
Guillem Jover ccbfd1c2 2023-04-07T23:40:22 build: Remove __MUSL__ definition from configure We stopped relying on this macro when we turned the funopen() cpp error into a warning in commit e50896286cc5718898194edb73fa7262ad9a22db.
Guillem Jover e0976d7e 2023-04-02T22:33:25 build: Add a new libbsd_strong_alias() macro and switch users to it We had several cases of code needing a strong alias, so we switch those to use the new macro. This covers systems that support the alias attribute and others such as macOS where we need to use assembler directives to add the alias as the attribute is not supported.
Guillem Jover 49c7dd1c 2023-04-02T22:32:11 build: Only emit link warnings for ELF objects
Guillem Jover 8622767a 2023-04-11T00:24:13 build: Use an export symbols file if there is no version script support We generate the symbol list from the version script to avoid repeating ourselves and potentially getting the lists out-of-sync.
Guillem Jover 8f610364 2023-04-11T03:03:54 build: Add -no-undefined libtool flag We have no need for undefined symbols, so we can let the shared library build even on systems without support for undefined symbols.
Guillem Jover ae7942ba 2023-04-11T03:02:30 build: Do not override the default DEPENDENCIES for libbsd Extend it instead via EXTRA_*_DEPENDENCIES, to make sure that we preserve the builtin library dependencies generated from LIBADD.
Guillem Jover a5faf170 2023-04-01T12:46:49 Only use <stdio_ext.h> if present
Guillem Jover 06e8a1b2 2023-04-01T12:45:04 Define _NSIG if it is not defined by the system At least on macOS this macro is not defined.
Guillem Jover 44824aca 2023-04-01T12:41:42 Declare environ if the system does not do so The environ variable is supposed to be defined by the code using it, but on glibc-based systems it will get defined if we request it, by including <unistd.h> and defining _GNU_SOURCE.
Guillem Jover 1fb6c3f4 2023-04-10T23:10:40 Use lockf() when flock() is not available On Solaris flock() is not available, and we should use instead lockf() or fcntl().
Guillem Jover fe16f386 2023-04-10T23:11:33 test: Use open_memstream() only if available On Solaris this function is not yet available.
Guillem Jover 7c652a94 2023-04-10T20:57:14 test: Do not hardcode root:root user and group names On some systems the root group is named wheel, and there is no root group.
Guillem Jover ed2eb31d 2023-04-01T02:46:22 test: Fix closefrom() test on macOS On macOS we do not close the file descriptors, and instead mark them all as close-on-exec. So checking whether they are not valid does not work.
Guillem Jover 0f8bcdfd 2023-04-01T02:48:47 test: Fix closefrom() test to handle open file descriptor limits If the system has configured a lower limit (either soft or hard) on the number of open file descriptors, the test will fail. Make sure to check whether we have exceeded that limit and adapt the max number of file descriptors appropriately.
Guillem Jover 07192b31 2023-04-05T00:01:42 test: Disable blank_stack_side_effects() on non-Hurd systems This code was added to cope with Hurd specific behavior, but it is causing flakiness on containers on some Linux systems. Only enable it where it is currently needed to try to get stability back on CI systems. Closes: #14
Guillem Jover ca3db5e1 2023-03-29T09:35:27 build: Do not enable ASAN for musl CI pipelines musl-libc does not currently support ASAN, so enabling it makes configure fail to detect libmd as it cannot link to it anymore.
Guillem Jover ff46386f 2023-03-29T02:32:37 man: Add HISTORY section to arc4random(3bsd)
Guillem Jover 4c6da577 2023-03-29T02:28:52 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
Guillem Jover 830dd88a 2023-03-14T01:58:40 doc: Remove written-by attribution While attribution is important, it is not relevant when tracking the copyright holders for the work. And in any case it still stays in the relevant source file.
Guillem Jover 257800a0 2021-02-20T22:23:40 build: Add support for sanitizer compiler flags
Guillem Jover 536a7d42 2023-03-21T04:11:03 test: Exempt blank_stack_side_effects() from sanitizer checks This will mean we cannot use sanitizer support on the Hurd, for which this function was added to fix the test. But the sanitizer suppression function attribute is not having any effect, so this is better than nothing.
Guillem Jover 7ed5de01 2023-03-21T04:10:33 test: Import explicit_bzero() sanitizer support changes from OpenBSD
Guillem Jover 05a802a2 2023-03-14T03:05:58 test: Fix memory leaks in fpurge test Warned-by: gcc -fsanitize=leak
Guillem Jover 5962e03c 2023-03-03T01:27:31 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.
Guillem Jover 59a21c7f 2023-02-20T00:11:10 man: Update STANDARDS and HISTORY sections Include BSD versions when functions were introduced. Add mention whether these are BSD extensions.
Callum Farmer 7b4ebd65 2023-02-16T21:26:05 include: Adjust closefrom() per glibc adoption Added in glibc 2.34 https://sourceware.org/git/?p=glibc.git;a=commit;h=607449506f197cc9514408908f41f22537a47a8c Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover 0dfbe769 2023-02-17T22:28:45 build: Switch to debian:latest Docker image This should always point to the latest Debian stable images.
Guillem Jover dec783dc 2023-02-12T23:55:09 build: Fix version script linker support detection When the linker uses --no-undefined-version either specified by the user or as the default behavior (such as with newer clang >= 16 releases), a missing symbol definition will cause a linker error if that symbol is listed in the version script.
Guillem Jover fe21244b 2022-12-20T22:47:02 include: Use __has_builtin to detect __builtin_offsetof support The __has_builtin operator is more specific and is supported by GCC and Clang, while __is_identifier() is less specific and only supported by Clang, so we should prefer the former whenever it is available, and only fallback to use the latter when the former is missing and the latter.
Khem Raj ec88b7bb 2022-12-15T09:02:22 funopen: Replace off64_t with off_t in funopen_seek() AC_SYS_LARGEFILE in configure.ac is setting needed defines to make 64bit off_t on relevant platforms. Fixes build on musl: | src/funopen.c:68:28: error: unknown type name 'off64_t'; did you mean 'off_t'? | funopen_seek(void *cookie, off64_t *offset, int whence) | ^~~~~~~ | off_t Closes: !24 Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guilherme Janczak 23377191 2022-12-07T04:06:37 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 3fed78e5b08f78256e533788b4bcd6502b0949d7 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>
Florian Weimer 5dea9da3 2022-12-13T03:37:06 build: Improve C99 compatibility of __progname configure check The check uses printf, so it needs to include <stdio.h> for compilers which do not support implicit function declarations. (They were removed from C99.) Closes: !23 Signed-off-by: Guillem Jover <guillem@hadrons.org>
Guillem Jover b9bf42dd 2022-12-13T03:35:05 build: Enable -Wall for automake This will make sure to warn about bogus or deprecated constructs.
Guillem Jover e57c0787 2022-12-13T03:34:37 build: Add missing AM_PROG_AR macro call to configure.ac Warned-by: autoreconf