13 Commits

Author SHA1 Message Date
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
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
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
1f0b016e97 Use UTF-8 copyright symbols for non-imported files 2009-05-20 04:20:21 +02: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
Robert Millan
326d210f17 Revert 1d87476250217a87319df48a8f473415c0515106 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
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