Commit Graph

27 Commits

Author SHA1 Message Date
Guillem Jover
32d18dcf47 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.
2024-02-27 05:47:50 +01:00
Guillem Jover
c9ff83687c 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.
2022-01-29 14:54:24 +01:00
Guillem Jover
62e67bb49e build: Sort test programs in .gitignore 2022-01-29 14:52:39 +01:00
Guillem Jover
37a9b56c05 Import pwcache module from OpenBSD 2021-02-07 01:28:27 +01:00
Guillem Jover
e4e15ed286 Fix strnvis() and strnunvis() NetBSD ABI break
The NetBSD implementations have different prototypes to the ones coming
from OpenBSD, which will break builds, and have caused segfaults at
run-time. We provide now both interfaces with different prototypes as
different version nodes allow selecting them at compile-time, defaulting
for now to the OpenBSD one to avoid build-time breakage, while emitting
a compile-time warning. Later on, in 0.10.0, we will be switching the
compile-time default to the NetBSD version.

Ref: http://gnats.netbsd.org/44977
Fixes: https://bugs.debian.org/899282
2018-05-22 16:07:42 +02:00
Guillem Jover
cdbb9d0555 test: Add new strnstr() unit test 2017-06-19 03:17:21 +02:00
Guillem Jover
0365d0efda test: Add new setprogname() and getprogname() unit test 2017-06-19 03:17:21 +02:00
Guillem Jover
10b1328570 test: Add new setmode() and getmode() unit test 2017-06-19 03:17:21 +02:00
Guillem Jover
922eff5c5e test: Add new nlist() unit test 2017-06-19 03:17:21 +02:00
Guillem Jover
7938619254 Update .gitignore for headers generator 2017-06-19 03:17:21 +02:00
Guillem Jover
f1dd5f2e71 test: Add unit test for strlcpy() and strlcat() 2017-06-09 05:47:07 +02:00
Guillem Jover
f3b566bd7c test: Add a unit test for md5 2016-03-27 12:31:58 +02:00
Guillem Jover
f84004baf2 test: Add new unit tests for individual headers usage 2015-12-14 03:34:40 +01:00
Guillem Jover
02bccb0a01 test: Add unit test for strmode() 2015-11-30 23:02:23 +01:00
Guillem Jover
58bef83f41 test: Add unit test for arc4random() 2015-11-30 23:02:23 +01:00
Guillem Jover
45443583df Add explicit_bzero() function from OpenBSD 2015-09-24 05:47:58 +02:00
Guillem Jover
f50b197ea5 test: Add fparseln() unit test 2015-09-23 07:59:34 +02:00
Guillem Jover
3a3d87d730 test: Add closefrom() unit test 2015-09-23 07:59:34 +02:00
Guillem Jover
cfb4d462a9 test: Move and activate fpurge() test case from module to a dedicated file 2015-09-23 07:59:34 +02:00
Guillem Jover
e8d3d04177 build: Remove hard requirement for GNU .init_array section support
In case the support is not available, just stop building the
libbsd-ctor.a library, which is a nice to have thing, but should not
have been a hard requirement from the start. This should allow to
build libbsd on non-glibc based systems using another libc.
2014-07-20 02:09:20 +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
330b569fe3 test: Add new humanize unit test 2013-05-27 03:41:48 +02:00
Guillem Jover
8c26c40ad2 test: Add setproctitle() unit test 2013-05-27 03:24:23 +02:00
Guillem Jover
7196b4dcca test: Add new fgetln() and fgetwln() unit test 2013-05-27 02:49:28 +02:00
Guillem Jover
34bf1068a2 test: Add a unit test for endian encoder/decoder 2012-05-29 04:51:16 +02:00
Guillem Jover
786d143920 test: Add new overlay unit test 2012-05-29 04:51:04 +02:00
Guillem Jover
abf14c3940 test: Add new headers unit test 2012-05-29 04:36:23 +02:00