|
a5faf170
|
2023-04-01T12:46:49
|
|
Only use <stdio_ext.h> if present
|
|
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.
|
|
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().
|
|
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.
|
|
fe16f386
|
2023-04-10T23:11:33
|
|
test: Use open_memstream() only if available
On Solaris this function is not yet available.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
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.
|
|
ff46386f
|
2023-03-29T02:32:37
|
|
man: Add HISTORY section to arc4random(3bsd)
|
|
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
|
|
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.
|
|
257800a0
|
2021-02-20T22:23:40
|
|
build: Add support for sanitizer compiler flags
|
|
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.
|
|
7ed5de01
|
2023-03-21T04:10:33
|
|
test: Import explicit_bzero() sanitizer support changes from OpenBSD
|
|
05a802a2
|
2023-03-14T03:05:58
|
|
test: Fix memory leaks in fpurge test
Warned-by: gcc -fsanitize=leak
|
|
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.
|
|
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.
|
|
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>
|
|
0dfbe769
|
2023-02-17T22:28:45
|
|
build: Switch to debian:latest Docker image
This should always point to the latest Debian stable images.
|
|
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.
|
|
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.
|
|
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>
|
|
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>
|
|
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>
|
|
b9bf42dd
|
2022-12-13T03:35:05
|
|
build: Enable -Wall for automake
This will make sure to warn about bogus or deprecated constructs.
|
|
e57c0787
|
2022-12-13T03:34:37
|
|
build: Add missing AM_PROG_AR macro call to configure.ac
Warned-by: autoreconf
|
|
80f1927d
|
2022-12-13T03:31:38
|
|
build: Fix configure.ac indentation
Use the same style as the newly added code, which should make the code
more readable, and produce more conforming C output.
|
|
b7a8bc22
|
2022-12-13T03:10:28
|
|
build: Require automake 1.11
This is a rather old release (from 2009), that provides AM_SILENT_RULES.
|
|
e5089628
|
2022-11-23T23:31:54
|
|
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>
|
|
00b538ff
|
2022-11-23T23:28:34
|
|
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.
|
|
5cfa39e5
|
2022-11-23T23:42:49
|
|
build: Use «yes» instead of «true» for AC_CHECK_FUNCS cache value
This autoconf macro sets the ac_cv_func_ cached variable to «yes» not
«true» so we were checking for an impossible condition.
|
|
084911ce
|
2022-10-06T04:07:52
|
|
Release libbsd 0.11.7
|
|
3538d38f
|
2022-10-06T03:59:33
|
|
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.
|
|
03fccd15
|
2022-10-05T12:08:31
|
|
include: Adjust reallocarray() per glibc adoption
On glibc 2.29 reallocarray() was moved to _DEFAULT_SOURCE.
Closes: !20
Based-on-patch-by: Callum Farmer <gmbr3@opensuse.org>
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
6b6e686b
|
2022-10-05T12:08:31
|
|
include: Adjust arc4random() per glibc adoption
Some arc4random functions were added in glibc 2.36.
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
da1f45ac
|
2022-10-03T16:09:18
|
|
include: explicit_bzero() requires _DEFAULT_SOURCE
Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
2f9eddc2
|
2022-10-05T02:05:46
|
|
include: Simplify glibc version dependent macro handling
We test once whether __GLIBC__ is not defined, so we do not need to test
whether it is on the OR branch afterwards. We decouple the glibc version
restriction check from the _*_SOURCE variable, as that contains an
implicit opposite version check.
|
|
28298ac0
|
2022-10-05T01:35:08
|
|
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.
|
|
ef981f93
|
2022-10-04T04:28:05
|
|
doc: Add missing empty line to separate README sections
|
|
6928d789
|
2022-10-04T04:27:44
|
|
doc: Refer to the main git repository as primary
|
|
d5865759
|
2022-08-25T00:52:43
|
|
test: Fix explicit_bzero() test on the Hurd
On the Hurd a small read(3) might end up (indirectly) copying the data
on the stack, which we will end up finding even when we have cleared
the buffer.
To avoid these side effects, we add a new function, that we force not
to be inlined, so that we can reuse the same stack space, that will
blank any possible stack side effects. This should be portable
regardless of stack growing up or down.
Diagnosis-by: Samuel Thibault <sthibault@debian.org>
|
|
be327c6e
|
2022-08-24T01:58:58
|
|
fgetwln: Add comment about lack of getwline(3) for recommendation
Ideally we'd recommend getwline(3), but unfortunately even though it
was part of the ISO/IEC TR 24731-2:2010 draft, it did not make it into
C11 and is not widely implemented.
|
|
a14612d9
|
2022-08-23T23:49:34
|
|
setmode: Dot not use saveset after free
While we are only doing a pointer difference and not dereferencing it,
it's easier and more correct to do the pointer difference before passing
it to reallocarray().
Warned-by: gcc
|
|
f4baceb8
|
2022-08-03T03:05:52
|
|
man: Rewrite gerprogname(3bsd) from scratch
This gets rid of one of the last man pages with a BSD-4-clause license.
|
|
f35c5458
|
2022-08-03T02:21:16
|
|
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.
|
|
b466b14a
|
2022-08-03T01:23:09
|
|
man: Document that some arc4random(3) functions are now in glibc 2.36
|
|
1f6a48b2
|
2022-08-03T02:03:05
|
|
Sync arc4random(3) implementation from OpenBSD
Closes: #12
|
|
873639eb
|
2022-06-07T19:27:13
|
|
Fix ELF support for big endian SH
Fix the following build failure with big endian SH (e.g. sh4aeb):
,---
In file included from nlist.c:44:
nlist.c: In function '__elf_is_okay__':
local-elf.h:223:25: error: 'ELFDATA2LMSB' undeclared (first use in this function); did you mean 'ELFDATA2LSB'?
223 | #define ELF_TARG_DATA ELFDATA2LMSB
| ^~~~~~~~~~~~
`---
Fixes: http://autobuild.buildroot.org/results/2980fb79c208454195d77383f1ece9afbd7f981b
Closes: !19
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
c9c78fdf
|
2022-04-04T11:49:52
|
|
man: Use -compact also for alternative functions in libbsd(7)
The other function lists use the compact mode, let's be uniform about
this.
|
|
5f213075
|
2022-03-31T20:46:56
|
|
getentropy: Fix function cast for getauxval()
Fix also the Hurd implementation, missed in the original fix.
Extends: commit 72a82ee262795c9162e712885381a111fcf988bc
Warned-by: gcc
|
|
84acf215
|
2022-03-30T23:09:35
|
|
Release libbsd 0.11.6
|
|
15200ec7
|
2021-09-11T12:54:28
|
|
Add LoongArch support to nlist()
Closes: !13
Signed-off-by: WANG Xuerui <git@xen0n.name>
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
f7465b93
|
2022-03-30T22:56:43
|
|
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.
|
|
e5ed5fdd
|
2021-12-31T08:25:08
|
|
Remove arc4random() OpenBSD support
The arc4random() support for OpenBSD does not build. The intention was
to include any portability code so that the library could be easily
ported to such systems, but it makes little sense to build it on OpenBSD
where most of the functionality will be already present, or the software
would have been ported anyway.
[guillem@hadrons.org: Reword commit message to add rationale. ]
Closes: !15
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
abb1a6b1
|
2022-01-24T15:11:38
|
|
build: Add alpine to CI for tests with musl libc
Closes: !18
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
c9ff8368
|
2022-01-29T14:48:22
|
|
test: Import explicit_bzero and strtonum test cases from OpenBSD
- Remove trailing spaces.
- Declare file-scope functions and variables static.
- Declare functions with a proper prototype.
- Do not mix declarations and code for C90 conformance.
- Do not compare size_t and ssize_t variables.
|
|
62e67bb4
|
2022-01-29T14:52:08
|
|
build: Sort test programs in .gitignore
|
|
87b13070
|
2022-01-25T20:34:39
|
|
test: Add fpurge() test case using open_memstream(3) FILE
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
ba3c46b3
|
2022-01-25T20:32:30
|
|
fpurge: Make it work with non fd based FILEs
Streams opened with for example open_memstream(3) will have no associated
file descriptor, and fileno(3) will fail.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
091097e0
|
2022-01-24T16:47:00
|
|
test: Remove static FILE declaration from fpurge test
This does not work with libcs that do not declare the structure
in a header file, like musl. And gets in the way of supporting
non-fd based streams.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
5f9608c7
|
2022-01-25T01:48:29
|
|
Release libbsd 0.11.5
|
|
eef07993
|
2022-01-25T01:41:14
|
|
Revert "build: Add missing proctitle unit test program"
This reverts commit beafad2657c7a57109c28f8bad9cb028c84c7dd5.
This test was already handled later on as part of the BUILD_LIBBSD_CTOR
conditional. Adding it to the unconditional set made the build fail when
the system does not have GNU .init_array section support.
Closes: #9
Analysis-by: Duncan Overbruck <mail@duncano.de>
|
|
c6d589bc
|
2022-01-23T21:07:45
|
|
Document how to build from git and from a tarball release
Closes: #8
|
|
2975d809
|
2022-01-23T18:54:33
|
|
build: Check for objdump explicitly
We should not assume that something will implicitly check for this tool,
as we need it ourselves, and this is an internal implementation detail
of right now libtool.
Fixes: commit f11ab6722367f1cf62704ed3c827b9b68dcb5397
|
|
f11ab672
|
2022-01-23T15:36:55
|
|
build: Respect $(OBJDUMP)
We already search for it in `./configure` so let's respect
the result of that search.
This helps with cross-compilation and any other cases
where one might want to choose a different toolchain.
Closes: !16
Bug: https://bugs.gentoo.org/831863
Signed-off-by: Sam James <sam@gentoo.org>
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
54796231
|
2022-01-22T22:41:51
|
|
Release libbsd 0.11.4
|
|
7aed0edf
|
2021-12-02T00:35:05
|
|
man: Add missing comma in .Dd for tree(3)
Reported-by: Thorsten Glaser <tg@mirbsd.de>
|
|
fafcc397
|
2021-11-30T04:00:54
|
|
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.
|
|
48107fc8
|
2021-11-28T23:19:16
|
|
build: Clarify link-time warnings
Mention the involved function instead of stating an implicit "this
function". Mention libbsd when proposing using an alternative libmd
to make the context clear.
|
|
e7cf8c57
|
2021-11-28T22:44:08
|
|
Switch md5 compatibility logic back to direct linking
When using the recent dlsym() based wrapper, we are not requiring any
symbol from libmd, as we resolve those dynamically at run-time. We were
ending up linking against libmd because in another part of the code we
require (depending on the architecture) the SHA512 functions for the
getentropy() local implementation. But that function might be provided
by the system libc on some systems, which means we end up not linking
against libmd at all.
To solve this we go back to the previous simpler solution of linking
directly, which had the main drawback of then making programs fail to
link when not specifying -lmd (on platforms that need it). And then
switch the .so link point from a symlink to a linker script, so that we
can inject the -lmd library as-needed. This is similar to what glibc is
doing.
Fixes: commit 31f034e3862debda8615a449b1c11c4d6920dcc7
|
|
25d35625
|
2021-11-28T22:40:58
|
|
build: Split libmd dependency due to MD5 functions from SHA requirements
To be able to rework the md5 deprecation logic, we need to detangle when
we depend on libmd due to requiring MD5 functions, which might be
otherwise provided by libc, or when we require SHA functions for the
internal getentropy() implementation.
|
|
500b3080
|
2021-11-28T22:34:59
|
|
build: Add new libbsd_symver_weak() macro
We will use it for the reworked md5 deprecation logic.
|
|
1eba4060
|
2021-11-27T21:09:18
|
|
test: Check that strdup() does not fail
Warned-by: gcc
|
|
8ad7570c
|
2021-11-27T21:07:00
|
|
getentropy: Add missing prototype for BSD variant
Warned-by: gcc
|
|
43a82703
|
2021-11-27T20:26:05
|
|
nlist: Remove condition which is always true
The nlist() function is limited to handle ELF binaries of the same class
as size as the size_t of the architecture built.
In addition the SIZE_T_MAX macro is BSD specific, and was falling back
to the wrong constant on most 64-bit non-BSD systems.
Warned-by: gcc
|
|
6a71b24b
|
2021-11-27T22:52:28
|
|
build: Append __ after __attribute and __typeof keywords
Be consistent with other usages in the code base.
|
|
7389fe8d
|
2021-11-27T06:54:49
|
|
build: Ignore backup files
|
|
2716dfd0
|
2021-11-26T20:24:20
|
|
test: Explicitly mark symbols as used
Because some of the symbols are not otherwise referenced, GCC would like
to remove them.
Closes: !14
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
54f87456
|
2021-11-26T20:01:18
|
|
build: Enable .init_array support when building with LTO
Because these symbols are not otherwise referenced, GCC would like
to remove them.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
428be9e0
|
2021-10-07T23:08:42
|
|
man: Fix .Nx macro usage
Its arguments are used as version numbers, so we need continue the
content on the next line.
|
|
c7a5d780
|
2021-09-30T03:39:57
|
|
build: Allow building with -flto on gcc-10 and newer
Global asm statements (like .symver directives) do not work reliably
in gcc with link time optimization. Use the symver attribute introduced
with gcc-10 to set symbol versions instead, if available.
[guillem@hadrons.org:
- Simplify by using __has_attribute fallback from <sys/cdefs.h>.
- Coding style changes. ]
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
1808d64b
|
2021-03-01T05:14:10
|
|
test: Fix pipe_feed() to allow checking fprintf format strings
Warned-by: gcc -W
|
|
beafad26
|
2021-03-07T00:22:59
|
|
build: Add missing proctitle unit test program
|
|
6145b561
|
2021-08-17T03:14:57
|
|
test: Do not pass NULL as the first funopen() argument
Warned-by: gcc -W
|
|
731b0a77
|
2021-08-17T02:59:59
|
|
build: Detect sed at configure time
Check whether sed is available and use the implementation matching the
requirements via the SED variable.
|
|
50b50a43
|
2021-03-02T05:18:04
|
|
vis: Add prototypes for strnvis() and strnunvis() variants
Warned-by: gcc
|
|
25e88f64
|
2021-03-02T00:48:31
|
|
test: Cast literal strings to (char *) on n_name assignment
The member is declared as n_name so we cannot directly assign a literal
string constant.
Warned-by: gcc
|
|
04a8fb24
|
2021-03-02T00:48:02
|
|
Add missing prototypes to functions
Warned-by: gcc
|
|
4f68a88f
|
2021-02-19T06:55:17
|
|
build: Add compiler warnings support
Detect as many warnings as possible during configure and enable them
if the user did not supply any, so that any such problem can be spotted
and fixed.
|
|
8f59221c
|
2021-02-19T06:51:18
|
|
nlist: Remove repeated shadowing variable declaration
Warned-by: gcc
|
|
72a82ee2
|
2021-02-20T22:22:54
|
|
getentropy: Fix function cast for getauxval()
Warned-by: gcc
|
|
3c305f28
|
2021-02-19T06:49:53
|
|
test: Add proper prototypes for main() function
Warned-by: gcc
|
|
25278891
|
2021-02-19T06:49:24
|
|
Mark local functions as static
Warned-by: gcc
|
|
e35d9141
|
2021-02-11T04:41:46
|
|
Add link-time warnings to MD5 wrapper functions
Let's get the word out that these functions are deprecated and should be
switched away from.
|
|
4feda870
|
2021-02-11T04:40:48
|
|
Require a semicolon for libbsd_link_warning() macro
Remove the semicolon in the macro definition to force adding one on the
call sites, to make the code look like an actual function.
|
|
d563a174
|
2021-02-18T23:38:30
|
|
man: Call the libbsd-ctor library by its name instead of bsd-ctor
|
|
785cf9d1
|
2021-02-18T23:38:30
|
|
man: Fix pkg-config(1) references in libbsd(7) man page
|
|
15bd284b
|
2021-02-28T05:16:01
|
|
build: Add code coverage support in the GitLab CI
|