Commit Graph

293 Commits

Author SHA1 Message Date
Mark Murray
4cd0119367 Do not use __progname directly (except in [gs]etprogname(3)).
Also, make an internal _getprogname() that is used only inside
libc. For libc, getprogname(3) is a weak symbol in case a
function of the same name is defined in userland.
2002-03-29 22:43:43 +00:00
David E. O'Brien
1114a754ed Fix the style of the SCM ID's.
I believe have made all of libc .h's as consistent as possible.
2002-03-22 23:42:05 +00:00
David E. O'Brien
333fc21e3c Fix the style of the SCM ID's.
I believe have made all of libc .c's as consistent as possible.
2002-03-22 21:53:29 +00:00
David E. O'Brien
1372519b15 Remove multi-line __P() usage. 2002-03-22 09:22:15 +00:00
David E. O'Brien
c05ac53b8b Remove __P() usage. 2002-03-21 22:49:10 +00:00
David E. O'Brien
8fb3f3f682 Remove 'register' keyword. 2002-03-21 18:49:23 +00:00
Tor Egge
df140f7277 When multiple threads call atexit at the same time, some operations must
be serialized.  A mutex is used to protect the critical regions.

sbrk() and brk() are not thread safe.  Replace use of sbrk() with
a call to malloc to avoid race when one thread calls atexit
while another thread calls malloc.

Reviewed by:	deischen
2002-03-05 17:34:37 +00:00
Jake Burkholder
dfca860bfc Add ifdefs for sparc64. 2002-02-23 19:05:26 +00:00
Yaroslav Tykhiy
b454be098e Minor typo fix: uquad_t -> u_quad_t. 2002-01-20 16:50:29 +00:00
Ruslan Ermilov
58c0fdd850 mdoc(7) police: add missing markup bits for ``errno''. 2002-01-09 14:03:54 +00:00
Andrey A. Chernov
f7388e0d38 Back out errno preserving 2001-12-30 03:34:46 +00:00
Andrey A. Chernov
98b870fa7b Add "except the handling of errors" into "equivalent to" paragraph.
Pointed by:	bde
Inspired by:	POSIX
2001-12-25 08:43:35 +00:00
Andrey A. Chernov
b12990ca58 Preserve errno.
According to C99:
"The  functions  atof,  atoi,  atol, and atoll need not
affect the value of  the  integer  expression  errno  on  an
error.   If  the  value of the result cannot be represented,
the behavior is undefined."
2001-12-25 04:10:50 +00:00
Alexey Zelkin
e578c6f17c * cleanup comments and defines
Reviewed by:	bde
2001-12-14 11:36:37 +00:00
Ruslan Ermilov
f7475de715 mdoc(7) police: fix markup, bump document date. 2001-12-12 14:53:51 +00:00
Ruslan Ermilov
f0cc88ffed mdoc(7) police: kill HSBs, add missing comma. 2001-12-12 14:41:53 +00:00
Ruslan Ermilov
9a05e59078 mdoc(7) police: fix markup. 2001-12-12 14:40:09 +00:00
Alexey Zelkin
52d6b43026 Add my e-mail to copyrights 2001-12-11 16:00:47 +00:00
Alexey Zelkin
a94da0a9f3 Get rid of unused anymore file! Alpha works fine with our strtod() now. 2001-12-07 17:19:09 +00:00
Andrey A. Chernov
f34b139cda Return 'c' back to signed due to potential comparison problems
Use simpler test for valid ranges

Submitted by:	bde
2001-12-07 16:33:47 +00:00
Peter Wemm
6464bbfa03 Use the merged strtod.c everywhere. This has been tested on alpha and
ia64.
2001-12-02 18:27:40 +00:00
Andrey A. Chernov
4bd71a3c89 Make it works for non ASCII compatible encodings too.
The only assumption left is that 'A'..'Z' 'a'..'z' both are contiguous
2001-12-02 09:15:54 +00:00
Alexey Zelkin
4a57e677c7 Merge NetBSD's changes from netbsd_strtod.c in preparation of
removing it from our source tree in order to have one version
of strtod() for all arches. netbsd_strtod.c still left in source
tree until alpha folks make sure that our native strtod() works
as well as NetBSD's one.

Reviewed by: peter, bde (some time ago)
2001-11-30 12:48:30 +00:00
Andrey A. Chernov
2209d8a27c Back out national digits support, POSIX explicetely disallows it:
The definition of character class digit requires that only ten characters
-the ones defining digits- can be specified; alternate digits (for
example, Hindi or Kanji) cannot be specified here. However, the encoding
may vary if an implementation supports more than one encoding.

The definition of character class xdigit requires that the characters
included in character class digit are included here also and allows for
different symbols for the hexadecimal digits 10 through 15.
2001-11-29 03:03:55 +00:00
Andrey A. Chernov
87c25490c8 Don't ever assume that isdigit() is always subset of isxdigit() 2001-11-28 06:06:27 +00:00
Andrey A. Chernov
7bbd0c8b5b Fix typo 2001-11-28 05:43:24 +00:00
Andrey A. Chernov
76604b47c1 Use stricter tests to disallow national digits > 9
Optimize national digits code a bit
2001-11-28 05:39:21 +00:00
Andrey A. Chernov
01a0db1367 Allow national (non-ASCII) digits 2001-11-28 03:57:12 +00:00
Bill Fenner
9c5cbc30e7 Implement strtoimax() and strtoumax() 2001-11-28 03:37:06 +00:00
Bill Fenner
3b175d881c Also mention "long long" in synopsis. 2001-11-28 03:36:05 +00:00
Bill Fenner
b9004c1158 Base 36 is allowed. 2001-11-28 02:35:35 +00:00
Andrey A. Chernov
649ffc6d4b Put back base > 35 check. If someone dislike it, plese discuss it with
standards group first.
2001-11-28 02:17:22 +00:00
Andrey A. Chernov
59d01330c4 Add atoll(3) to conform POSIX and C99 2001-11-28 01:22:08 +00:00
Andrey A. Chernov
7e302fc7a2 Understand national (non-ASCII) digits now
Allow bases >=36 again
Misc cleanup
2001-11-28 00:48:11 +00:00
Giorgos Keramidas
fe1b3cedf9 Be more explicit about the fact that realloc() might return a
different pointer than the one passed to it.

PR:		docs/31925
Submitted by:	Andrew <andrew@ugh.net.au>
2001-11-24 03:05:40 +00:00
Ruslan Ermilov
b18f229930 mdoc(7) police: fixed typos and minor markup nits. 2001-11-21 16:19:50 +00:00
Poul-Henning Kamp
7224d02a0d If 'VX' is given, realloc(foo,0) will bail, it shouldn't.
PR:		29376
Submitted by:	Farooq Mela <fmela0@sm.socccd.cc.ca.us>
2001-11-17 10:57:04 +00:00
Poul-Henning Kamp
4b9a9ef10b Correctly call THREAD_UNLOCK() if the recursive call trap is sprung.
Pointed out by:		knu
2001-11-16 18:15:33 +00:00
Mike Barcroft
7a4a63270f o Implement imaxabs(), imaxdiv(), llabs(), lldiv().
o Update abs(3), div(3), labs(3), ldiv(3) to reflect standards
  conformance and add additional references.

Reviewed by:	bde, wollman
2001-11-15 02:05:03 +00:00
Dima Dorfman
8b642e3004 malloc and calloc do not free memory.
PR:		31365
Submitted by:	SUZUKI Koichi <koich@cac.co.jp>
2001-11-05 00:39:27 +00:00
Peter Wemm
b1f214cf5f Make strtod.c work on Alpha as well. strtod.c has got locale support,
the netbsd_strtod.c file we have does not.  More still should be done
here, but this works happily on my Alpha.  I have not (yet?) changed
the Makefile.inc to use this.
2001-11-04 21:30:12 +00:00
Peter Wemm
f29f85e083 Slightly closer to netbsd_strtod.c:
s/IEEE_8087/IEEE_LITTLE_ENDIAN/
s/IEEE_MC68k/IEEE_BIG_ENDIAN/
2001-11-04 18:04:00 +00:00
Poul-Henning Kamp
0f400b2861 phkmalloc->evilchecks++;
If zero bytes are allocated, return pointer to the middle of page-zero
(which is protected) so that the program will crash if it dereferences
this illgotten pointer.

Inspired & Urged by:	Theo de Raadt <deraadt@cvs.openbsd.org>
2001-11-02 11:32:28 +00:00
Mark Murray
724641c6f4 Add a long-overdue nail to the deprecated /dev/urandom interface
by asking some things that need unpredictable numbers to read
/dev/random instead.
2001-10-30 21:26:50 +00:00
Doug Rabson
a4ddd40c34 Make this work on ia64. I have no idea why it works on alpha - it
shouldn't.
2001-10-06 15:58:54 +00:00
Alfred Perlstein
9c2ccf2741 Avoid getting stuck in system(3) when the internal call to wait4()
is interrupted by saving the pid.

The old code would assign the return value to pid which would trash
it, to fix the problem save a copy of the pid to be used as the
paramter to wait4().

Submitted by: Toshihiko ARAI <toshi@jp.FreeBSD.org>
2001-10-03 11:01:39 +00:00
Ruslan Ermilov
2677aa4b68 mdoc(7) police: don't split author names in the AUTHORS section. 2001-10-01 13:50:03 +00:00
Ruslan Ermilov
ae0d2bed3e mdoc(7) police: s/atof/atoi/ 2001-10-01 12:44:24 +00:00
Jeroen Ruigrok van der Werven
54045486e0 Add ERRORS section.
Mention thread safety and async-cancel safety status [not].
Add standards compliancy references.
Note strtol() is preferred over atoi().

MFC after:	2 weeks
2001-09-26 20:22:44 +00:00
Jeroen Ruigrok van der Werven
5578cfa2fa Be explicit about the POSIX version it conforms to [in this case 1990].
Put the error comment under the more appropriate ERRORS section.
2001-09-26 20:10:10 +00:00