Commit Graph

21 Commits

Author SHA1 Message Date
dd
0db2bdb4c5 Introduce getprogname(3) and setprogname(3) library calls. These get
and set __progname, respectively.

Discussed on:	-arch (Feb 2001), -audit
Reviewed by:	-audit
Approved by:	kris
Obtained from:	(mostly) NetBSD
2001-05-15 23:41:01 +00:00
ache
68e2a56b8f Move sranddev() to !ANSI_SOURCE !POSIX_SOURCE section
Pointed out by: bde
2001-04-23 09:32:06 +00:00
ache
e75964f77d Add sranddev() prototype 2001-04-23 02:29:51 +00:00
obrien
9890a827d4 Impliment the ISO-C99 strto[u]ll()
and rewrite strto[u]q() in terms of it.
2001-02-27 13:33:07 +00:00
phk
8c1799b51f Make it possible to override the function which writes messages to
stderr in case of warnings and errors.

Rename malloc_options to have a leading underscore, I belive I have been
told that is more correct namespace wise.
2000-11-26 10:30:18 +00:00
bde
f76a6dcd72 Fixed missing declaration of rand_r(3). 1999-12-23 15:58:20 +00:00
dt
0d8aac5510 Little reorganization:
- created internal names for fixed-size integral types, like __int32_t. They
  will be used to make several headers self-sufficient.
- <stdlib.h> don't include <machine/types.h> anymore.
- created <sys/inttypes.h>, which can be used as <inttypes.h>.
- declaration of uoff_t and ufs_daddr_t moved to <sys/types.h>.

Reviewed by:	bde
1998-12-19 00:02:34 +00:00
imp
96fb246758 Add reallocf to the library. This function is simliar to realloc, but
when it returns NULL to indicate failure, it will also free the memory
that was passed to it, if that was non-null.

This does not change the semantics of realloc.

A second commit will be done to commit the conversion of those places in
the code that can safely use this to avoid memory leaks when confronted
with low memory situations.

Beaten-to-death-but-finally-approved-in: -current
1998-09-14 20:34:34 +00:00
jb
98a94bbde8 Change the return types for strtoq and strtouq to int64_t and u_int64_t
instead of long long and unsigned long long. Really they should be
quad_t and u_quad_t, but that would require sys/types.h and this
header only includes machine/types.h. The difference here is that
int64_t and u_int64_t on alpha are long and unsigned long, not
long long etc. This is required to pass gcc's type checking where
long != long long even though they are the same size of alpha.
1998-05-11 09:22:21 +00:00
bde
e51b216ce4 Moved include of <sys/cdefs.h> earlier for the same reasons as moving
it in <sys/types.h>.

PR:	5785
1998-02-27 06:12:47 +00:00
ache
fdf0c475fd Move machine/types.h to non-standard section
Change order of arc4* functions
Pointed-by: bde
1997-06-14 10:45:25 +00:00
ache
f407905958 Add arc4random family declaration 1997-06-14 01:33:52 +00:00
ache
4a2f1e93f9 Instead of copying fallback code over and over in each program,
implement (better) falback code inside srandomdev() itself.
Change return type from int to void (binary compatibility surprisely
achieved). Userland code will be changed soon.
1997-06-14 00:14:29 +00:00
ache
124ff081c1 Add srandomdev() prototype 1997-03-23 22:44:27 +00:00
peter
c5ebecdfa9 Merge Lite2 changes -
move getopt etc declarations from stdlib.h to unistd.h
1997-03-11 11:18:25 +00:00
bde
071f2afd3e Don't use __dead or __pure in user code. They were obfuscations
for gcc >= 2.5 and no-ops for gcc >= 2.6.  Converted to use __dead2
or __pure2 where it wasn't already done, except in math.h where use
of __pure was mostly wrong.
1996-09-14 03:00:32 +00:00
bde
3554b1c286 Fixed longstanding namespace convolution involving rune_t vs wchar_t.
If _ANSI_SOURCE or _POSIX_SOURCE is defined, then <ctype.h> had to
be included before <stddef.h> or <stdlib.h> to get rune_t declared.
Now rune_t is declared perfectly bogusly in all cases when <ctype.h>
is included.

This change breaks similar (but more convoluted) convolutions in the
stddef.h in gcc distributions.  Ports of gcc should avoid using the
gcc headers.
1996-05-01 00:40:10 +00:00
bde
efd95cb28d Don't declare rune_t, putenv() or setenv() if _POSIX_SOURCE is declared.
Previously they were only guarded by `#ifndef _ANSI_SOURCE'.  They are
neither ANSI nor POSIX nor std and should never have been declared here.

Declare functions like abs() as having attribute `__pure2'.  Declaring them
as having type `__pure' has been a no-op for some time.

Delete obsolete comment about stub locale functions.

Use consistent formatting for the rand48 functions.  These and about 30
other functions should never have been declared here either.
1995-04-15 23:48:16 +00:00
ats
7bba78b783 Reviewed by: Bruce Evans
Add prototypes for the *rand48 family here in the moment to get them
running again.
1994-11-21 09:25:58 +00:00
bde
f3b5e96cbb Declare functions that don't return as having attribute __dead2. 1994-09-08 10:29:15 +00:00
rgrimes
a6ce65d368 BSD 4.4 Lite Include Sources 1994-05-24 09:57:34 +00:00