Commit Graph

112 Commits

Author SHA1 Message Date
christos
f1e6017cdd remove restrict to match with OpenBSD prototype (Kamil Rytarowski) 2015-01-18 17:56:09 +00:00
christos
5bdc27618e Add strtonum protected with _OPENBSD_SOURCE 2015-01-16 18:40:16 +00:00
christos
e00a3615cf add mkostemp{s,} mkstemps from FreeBSD 2014-06-18 17:48:22 +00:00
christos
b27e135433 rename to 60 2014-06-12 18:49:37 +00:00
christos
1eb0dcbb1d fix srandom and initstate signatures (from enh at google) 2014-06-12 18:44:36 +00:00
christos
eabc0dd171 add ptsname_r 2014-01-08 02:15:42 +00:00
christos
c4c409af9e add at_quick_exit and quick_exit 2013-04-26 18:07:43 +00:00
joerg
2e24f90028 Provide the long long routines for C++11 code. 2013-04-26 17:36:24 +00:00
joerg
3c1c8515c7 Add MB_CUR_MAX_L. 2013-04-19 14:35:31 +00:00
joerg
ceb51ddcad Add mblen_l, mbstowcs_l, wctomb_l, mbtowc_l and wcstombs_l. 2013-04-18 22:22:20 +00:00
joerg
c99aac45e5 Add strtof_l, strtod_l and strtold_l. 2013-04-18 21:54:10 +00:00
joerg
a67fde0356 Add strtol_l and friends. Switch _citrus_bcs_strtol to use plain
strtol_l unless in tools mode. Add note to retire the BCS code on the
next libc major bump.
2013-04-16 21:44:06 +00:00
christos
6ddff5efba sprinkle restrict in realpath(3) 2012-06-21 21:13:29 +00:00
joerg
1907ec3a61 Switch device database to cdb(5). Rework ttyname(3) and ttyname_r(3) to
depend on new devname_r(3) as heart. Add /dev/pts magic directly to
devname(3). While it can lead to returning non-existing paths, the
behavior is more consistent that way. Drop caching layer in devname(3),
it doesn't buy anything for the common case of having access to the
database. Teach devname(3) proper fallback behavior of scanning /dev.
Create both old-style and new-style database for now in /etc/rc.d/sysdb.
2012-06-03 21:42:44 +00:00
christos
0bcf0d6f44 PR/46360: YAMAMOTO Takashi: Restore NetBSD-5 compatibility with putenv()
copying the passed string (which is not ToG compliant), instead of using
it directly in the environment arrat as it should. Needs to be pulled up
to NetBSd-6.
2012-04-20 17:31:29 +00:00
christos
a66aa579a5 remove commaize_number. 2011-03-16 00:48:34 +00:00
pooka
bfbab30192 put in a proto for commaize_number()
(nb. doing this purely as the minimum work solution to get a working build)
2011-03-15 12:21:08 +00:00
christos
a52c04784a add arc4random_{buf,uniform}, from OpenBSD. 2011-02-04 22:07:07 +00:00
jruoho
5b557140cd Use __constfunc(3) instead of __attribute__((const)) directly. 2010-12-22 19:47:56 +00:00
christos
7acc3301d8 make putenv POSIX compliant. 2010-10-01 20:11:32 +00:00
plunky
bdbcfb0d2d later versions of pcc may define __GNUC__ for compatibility reasons, so
having a system definition for alloca is counter productive as it seems
fairly common to use

    #ifdef __GNUC__
    #define alloca ..
    #endif

in user-headers (eg see usr.sbin/gspa/gspa/gspa_ass.h)

So, defang this definition as we don't otherwise provide alloca on NetBSD
2010-06-01 08:42:56 +00:00
joerg
8a601553bc Consistently use __printflike and __scanflike. 2010-02-25 18:37:12 +00:00
christos
db576bf322 Don't define wchar_t for c++; it is native in the language. From Alexander
Nasonov
2009-11-15 22:21:03 +00:00
joerg
d6e219476b Add a fast, platform independent hash function to libc.
The algorithm used is the Jenkins hash.  The name (mi_vector_hash)
reflects the nature of the hash function.
Add glue for libc ATF tests and include a test case to make sure that
(mis)alignment and endianess are handled correctly.

Bump libc minor to 169.
2009-07-20 17:03:36 +00:00
drochner
ad965be01b cleanup after devmajor_t:
-since getdevmajor(3) is now binary compatible again with <=5.0
 there is no need to rename, I've just left a __getdevmajor50 symbol
 temporarily for those who track -current
-update manpage
2009-01-20 20:08:12 +00:00
drochner
d767912be3 Change major()/minor() to return 32-bit types again, called
devmajor_t/devminor_t, as proposed on tech-kern.
This avoids 64-bit arithmetics and 64-bit printf formats in parts
of the kernel where it is not really useful, and helps clarity.
2009-01-20 18:20:47 +00:00
christos
50728e7823 merge christos-time_t 2009-01-11 02:57:17 +00:00
gmcgarry
79ae39b7d3 Use __builtin_alloc() with pcc. 2008-06-21 00:58:00 +00:00
yamt
e3372d31c3 RANDOM_MAX: don't rely on integer overflow. 2008-04-07 12:24:52 +00:00
drochner
7cc98087b6 everyone else assumes that defining "_XOPEN_SOURCE" means XPG4.2,
so remove comparisions against the numerical values "3" or "4"
2008-04-01 19:23:28 +00:00
christos
c75e135b85 add RANDOM_MAX define from anon ymous 2008-02-28 16:13:35 +00:00
christos
0d149bc5fe Add csetexpandtc() 2008-02-02 20:56:46 +00:00
perry
fc883a791d change some __attribute__s to __keywords 2007-12-24 17:26:09 +00:00
christos
03dcf031ab humanize_number was the only function in <util.h> that is not in libutil.
Move it to stdlib.h and add dehumanize_number.
2007-12-14 16:36:19 +00:00
ad
95182011ed Enable posix_memalign(). 2007-11-19 14:48:41 +00:00
ragge
98e922db67 The alloca() arg type check is broken (cpp do not do string comparisions)
so make it marginally less broken so that it works with other compilers
than gcc.
Probably the check can be removed, I doubt anyone will try to use gcc1
anymore.
2007-04-22 08:21:50 +00:00
kleink
bc89c06cbf Add strtof(3) and strtold(3); welcome libc 12.137. 2006-03-15 17:35:17 +00:00
perry
5f65228b74 u_intN_t -> uintN_t 2005-12-26 19:01:47 +00:00
perry
971a8b8cc7 __const__ -> const
This is in an __attribute__ so it isn't really necessary, but it gets
it out of the listing of __keyword__s...
2005-12-24 23:04:05 +00:00
kleink
ffff20ba60 Move getenv_r() to the local section. 2005-09-26 12:51:34 +00:00
christos
e86a6cb1b4 Add getenv_r and ttyname_r 2005-09-25 20:08:15 +00:00
christos
66412e7240 compat code reorg 2005-09-13 01:44:32 +00:00
christos
08cd5f47c8 Add a macro __MKTEMP_OK__ that renames mktemp() to _mktemp() for uses that
have been checked, so that the linker does not warn us. There are valid
uses for mktemp() such as for creating filenames that are going to be
targets of the rename system call. Discussed with lukem.
2005-06-11 22:58:42 +00:00
perry
19b7469a00 de-__P -- the hack is long since useless. Discussed with christos,
matt, kleink, others. Approved by christos.
2005-02-03 04:39:32 +00:00
atatat
2803cf768c Add a function called getdevmajor().
It tells you the major device number for whatever character or block
device you ask it.  This is sort of the inverse of devname(3) but not
quite, since it's backed by the kernel (sysctl's kern.drivers
information) and not a database cobbled together from the contents of
the filesystem.
2004-12-16 03:54:56 +00:00
christos
58fadb2d69 Add unix/98 pty function prototypes. 2004-05-27 02:58:14 +00:00
christos
fe069d7c1f more const sprinkling on cget* suggested by kleink. 2004-04-23 14:44:54 +00:00
christos
e1beeda0ae constify the db name vector argument. 2004-04-23 14:37:42 +00:00
agc
039cc95684 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22270, verified by myself.
2003-08-07 09:44:09 +00:00
kristerw
c1f62bbe29 Do not give names to the parameters in function prototypes (those names
reduces the usefulness of the gcc -Wshadow flag).
2003-07-08 01:43:28 +00:00