Guillem Jover
b5cc17d664
Use getexecname() if available for getprogname()
...
This function is present on Solaris.
2012-05-29 04:36:23 +02:00
Guillem Jover
980f04f77b
build: Do not define already defined _GNU_SOURCE
...
The macro is defined by configure on config.h which is now implicitly
included by all source files.
2012-05-29 04:36:22 +02:00
Guillem Jover
8d2f12d7f0
build: Include <config.h> through -include for all source files
2012-05-29 04:36:22 +02:00
Guillem Jover
88004b30ff
build: Set -Wno-unused-parameter to default CFLAGS
2012-05-29 04:36:22 +02:00
Guillem Jover
dcaa93d984
build: Switch to autotools
2012-05-29 04:35:55 +02:00
Guillem Jover
0aa777f47e
Move .pc and .map files to src/
2012-01-03 07:02:37 +01:00
Guillem Jover
540ab03b18
Move man pages to man/
2012-01-03 07:02:34 +01:00
Guillem Jover
2fb7200d45
Fix typos in source comments
...
Found by codespell.
2011-10-23 19:28:14 +02:00
Guillem Jover
4a6303ba3b
Constify bsd_getopt(3) arguments
...
This matches the standard declaration for getopt(3).
2011-06-08 02:10:38 +02:00
Guillem Jover
b891772ad6
Remove blank lines at EOF
2011-05-29 02:49:37 +02:00
Guillem Jover
9d04217174
Map getopt to bsd_getopt if we are using the overlay
...
This will ensure the code can safely and correctly use optreset
transparently.
2011-05-28 10:31:06 +02:00
Guillem Jover
94fe901eda
Abort compilation if fgetln cannot be wrapped
2011-05-16 13:23:18 +02:00
Guillem Jover
28585a58bd
Add fpurge function
2011-05-16 13:23:17 +02:00
Guillem Jover
8b6a74775b
Conditionalize temporary compatibility inclusions
...
These inclusions were in place for backward compatibility purposes,
when the headers were split so that code using them would not break.
Make it possible for applications to disable them by defining
LIBBSD_CLEAN_INCLUDES so that buildability can be tested and fixed
before they get removed in a subsequent release.
2011-05-14 14:18:22 +02:00
Guillem Jover
c594192bac
Correct library name in man pages
2011-05-14 14:18:06 +02:00
Guillem Jover
8478e57463
Update libbsd header references in man pages
...
Point to the namespaced path for libbsd specific headers.
2011-05-14 14:16:29 +02:00
Guillem Jover
520682e596
Add support for transparent compilation
...
This means that software being ported should not need to be modified in
the usual case, as the libbsd headers will take over the standard
namespace and fill the missing gaps, and include the system headers.
To use this the new libbsd-transparent.pc file can be used through
pkg-config, which should end up doing the right thing.
2011-05-14 13:43:49 +02:00
Guillem Jover
1497d34760
Initialize __progname to program_invocation_short_name
...
As we do not have cooperation from the crt0 code to set __progname, we
have to set it ourselves from getprogname() in case it's NULL. On GNU
systems we can use program_invocation_short_name which is actually set
on crt0.
2011-05-14 13:43:49 +02:00
Guillem Jover
4b95e82a32
Add new radixsort and sradixsort functions
...
Taken from FreeBSD.
2011-05-14 13:43:48 +02:00
Guillem Jover
c766e58acf
Add man pages for heapsort and mergesort
...
Taken from FreeBSD, originally as qsort.3 but qsort references stripped.
2011-05-14 13:43:48 +02:00
Guillem Jover
be6ab54986
Add new mergesort function
...
Taken from FreeBSD.
2011-05-14 13:43:48 +02:00
Guillem Jover
5b19adfa82
Add getpeereid function
2011-05-14 13:43:41 +02:00
Aurelien Jarno
acb7c42d7c
Add reallocf function
2011-02-23 14:44:37 +01:00
Guillem Jover
11f2c32df2
Fix setprogname to strip leading paths from progname
2010-01-30 22:00:18 +01:00
Guillem Jover
30c794083f
Make setprogname and getprogname arguments and return value const
...
This is more correct as the strings are not going to be changed, and it
matches the function signatures on other BSDs.
Suggested-by: Aurelien Jarno <aurel32@debian.org>
2010-01-21 14:34:55 +01:00
Guillem Jover
abe0a4a7e6
Reformat code to KNF
2010-01-10 15:29:51 +01:00
Guillem Jover
2872bfa151
Add vis and unvis man pages
...
Taken from OpenBSD.
2010-01-10 15:29:51 +01:00
Guillem Jover
e544a41f62
Add dehumanize_number man page link
2010-01-10 15:29:51 +01:00
Guillem Jover
7b3873bc1e
Update vis and unvis modules from OpenBSD
2010-01-10 15:29:51 +01:00
Guillem Jover
8103fe1486
Update strlcat and strlcpy from OpenBSD
2010-01-10 15:29:51 +01:00
Guillem Jover
d63e081303
Add arc4random_buf and arc4random_uniform functions
...
Update arc4random module from FreeBSD.
2010-01-10 15:29:50 +01:00
Guillem Jover
3fed78e5b0
Replace setproctitle dummy macro with a function stub
...
This way we can replace it later on with a real implementation so that
applications can immediately benefit from it w/o the need to recompile
them.
2010-01-10 15:29:50 +01:00
Guillem Jover
2a81893cc0
Add pidfile functions
...
Taken from FreeBSD.
Remove MAXPATHLEN from ‘struct pidfh’ and allocate pf_path dynamically,
as some systems do not have such limits. Use dev_t instead of __dev_t.
Replace EDOOFUS with EINVAL.
2010-01-10 15:29:46 +01:00
Guillem Jover
98a2479f0b
Add flopen function
...
Taken from FreeBSD.
2010-01-10 13:36:38 +01:00
Guillem Jover
57cc5326cf
Move man pages to the same directory as the source code
...
This matches BSD style source tree, and makes it easier to see what's
missing.
2010-01-10 13:36:38 +01:00
Thorsten Glaser
c17c7e13c3
Expand on API guarantee for fgetln
...
OpenBSD has begun using the API guarantee that *len is not 0 if
the fgetln(3) return value is not NULL; document this explicitly
in the manpage and add a comment to the function implementation
that this doesn’t need to be checked because getdelim/getline have
similar guarantees.
Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
2009-12-10 21:07:02 +01:00
Guillem Jover
c5398adfe2
Add readpassphrase function
...
Taken from OpenBSD.
2009-12-10 20:54:03 +01:00
Guillem Jover
538bc87998
Add dehumanize_number function
...
Taken from NetBSD.
2009-12-10 20:54:00 +01:00
Guillem Jover
04250f6a7c
Add strnvis and strnunvis functions
...
Taken from OpenBSD.
2009-10-24 01:47:26 +02:00
Guillem Jover
56ddcfe65a
Add strtonum function
...
Taken from FreeBSD.
2009-10-24 01:11:23 +02:00
Hirokazu Takata
5ac14531b5
Fix typos in M32R local-elf.h endian definitions
2009-08-30 12:16:01 +02:00
Nobuhiro Iwamatsu
6660397589
Fix typos in AVR32 and SH local-elf.h endian definitions
2009-07-17 12:50:07 +02:00
Guillem Jover
45783ae4ca
Define N_SYMSIZE in case the system does not do it
...
Fixes build failures on some non-Linux ports.
Based-on-patch-by: Petr Salinger <Petr.Salinger@seznam.cz>
2009-05-29 02:45:54 +02:00
Guillem Jover
e4aff3d9fc
Use N_SYMSIZE instead of directly accessing ‘struct exec’
...
On Linux alpha ‘struct exec’ does not have an a_syms member, and the
N_SYMSIZE is mapped to 0.
2009-05-25 06:41:42 +02:00
Guillem Jover
9b30dae909
Fix typos (‘ELFDATA2MSG’ → ‘ELFDATA2MSB’)
2009-05-21 05:04:09 +02:00
Guillem Jover
1f0b016e97
Use UTF-8 copyright symbols for non-imported files
2009-05-20 04:20:21 +02:00
Guillem Jover
dcaec44a6f
Add nlist function
2009-05-20 04:14:19 +02:00
Guillem Jover
8dbfb3529b
Add strmode function
2009-05-20 04:14:07 +02:00
Guillem Jover
74ae34e792
Fix buffer leaks in fgetln
...
Cache the size and the buffer allocated by getline as static variables.
2009-05-15 21:26:09 +02:00
Guillem Jover
deb9f56ceb
Change fgetln to return the correct length value
...
Set len to 0 on error conditions to mimmic FreeBSD behaviour, and return
the amount of read characters on success, instead of the allocated size
by getline.
Reported-by: Jief L. <jief1.l@gmail.com>
2009-05-15 21:23:03 +02:00
Guillem Jover
ad52f2eb4c
Use sigprocmask instead of _sigprocmask
2008-07-12 08:09:09 +03:00
Guillem Jover
38829bdc8b
Add new setmode and getmode functions from FreeBSD
2008-07-09 09:07:03 +03:00
Guillem Jover
fafffd1f7e
fgetln: Fix coding style
2008-07-09 08:26:07 +03:00
Guillem Jover
47109e39d5
fgetln: Fix function to make it actually work
...
Reported by Thorsten Glaser.
2008-07-09 08:22:30 +03:00
Guillem Jover
da92787d48
Ansify function arguments
2008-07-09 07:46:23 +03:00
Guillem Jover
1512d0d4ab
Renumber 4th clause from BSD license to 3rd
...
Those files have only three clauses.
2008-07-09 07:22:30 +03:00
Guillem Jover
efa9658ba6
Remove link_addr and link_ntoa functions
...
The address familiy used is kernel dependent, so the application will
have to be ported regardless.
2008-06-18 08:51:53 +03:00
Guillem Jover
bf4eeb29f0
Add arc4random_stir and arc4random_addrandom functions
2008-06-18 08:44:18 +03:00
Guillem Jover
b37f1039ef
Replace current md5 code with one from MirBSD and OpenBSD
...
This adds the following public functions:
MD5Transform, MD5End, MD5File, MD5FileChunk, MD5Data
2008-06-18 08:19:41 +03:00
Guillem Jover
d699e4bc0e
Add license header
...
With Hector's agreement.
2008-06-18 08:05:54 +03:00
Guillem Jover
acb577d6c1
Sync humanize_number from NetBSD
...
Add the missing man page.
2008-06-13 05:25:57 +03:00
Guillem Jover
0be77c90b5
Convert TNF licenses to new 2 clause variant
...
This follows NetBSD upstream:
<http://mail-index.netbsd.org/source-changes/2008/04/30/msg005553.html >
2008-06-13 05:23:39 +03:00
Robert Millan
8ca3d66d47
Add license header
2008-05-06 08:56:54 +03:00
Robert Millan
532aec99b6
Relicense err.c and progname.c to avoid trouble with 4-clause BSD code
2008-05-06 08:56:50 +03:00
Guillem Jover
f5b8317051
Remove UC Berkeley advertising clause
...
As per <ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change>.
2008-05-06 08:56:38 +03:00
Aurelien Jarno
2ef27385c5
link_addr: New function
2008-05-06 08:56:37 +03:00
Petr Salinger
30176335f9
humanize_number: New function
2008-05-06 08:56:37 +03:00
Robert Millan
326d210f17
Revert 1d87476250
2008-05-06 08:56:34 +03:00
Robert Millan
1d87476250
Duplicate setprogname argument
...
For some reason, accessing the argv vector directly may cause SIGSEV.
2008-05-06 08:55:56 +03:00
Robert Millan
3462d1261f
Add heapsort
2008-05-06 08:54:07 +03:00
Aurelien Jarno
daccb6a850
Fix some c++isms
2008-05-06 08:54:03 +03:00
Aurelien Jarno
1e28f34807
Directly call the function fmtcheck instead of using __weak_reference
2008-05-06 08:54:03 +03:00
Robert Millan
40bb012fee
Add vis and unvis
2008-05-06 08:52:46 +03:00
Robert Millan
a84fcb45ef
Fix syntax error
2008-05-06 08:52:31 +03:00
Robert Millan
31461c563a
Initialize __progname as NULL
2008-05-06 08:52:26 +03:00
Robert Millan
5bd834027d
Add getprogname and setprogname
2008-05-06 08:52:15 +03:00
Guillem Jover
5372b73685
Move sources to src/
2008-05-06 08:50:42 +03:00