Commit Graph

2325 Commits

Author SHA1 Message Date
Alexey Zelkin
fc38c1e548 add additional function parameter: bufsize_min. it's possible
to check two sizes per one function invocation now.

Suggested by: ache
2001-02-13 15:29:39 +00:00
Ruslan Ermilov
95cf33c567 mdoc(7) cleanup. 2001-02-12 15:16:24 +00:00
Ruslan Ermilov
6bf131c665 Sort PROT_* and MAP_* lists, logically and alphabetically respectively.
Suggested by:	bde

General mdoc(7) cleanup.
2001-02-12 10:14:15 +00:00
Alexey Zelkin
b161fb0061 Make comparsions more clear (per style(9)) 2001-02-12 08:56:39 +00:00
Alexey Zelkin
ba4a5c925a Assume that "" passed as parameter also means "no grouping"
Make comparsions more clear (per style(9))
2001-02-12 08:55:12 +00:00
Alexey Zelkin
4e86238071 Rewrite __time_load_locale() using ldpart.c::__part_load_locale()
Reviewed by:	ache
2001-02-12 08:53:33 +00:00
Alexey Zelkin
331cc8974c Use .Rv macro instead of hardcoded message 2001-02-12 08:42:56 +00:00
Ruslan Ermilov
1a0c34f25e "Cross references in the SEE ALSO section should be sorted by section
number, and then placed in alphabetical order and comma separated.",
mdoc.samples(7) said.
2001-02-12 08:30:22 +00:00
Ruslan Ermilov
9a801ec807 mmap(3) -> mmap(2). 2001-02-12 08:27:06 +00:00
Peter Wemm
56f98998e9 It sounded like a good idea at the time. The previous change breaks
FILE *buffer = stdout;
so back it out for now.
2001-02-12 03:31:23 +00:00
Peter Wemm
9b8ff47f40 Take advantage of the current libc sizeof(FILE) breakage (__sF[]) and
try a hopefully more robust stdin/stdout/stderr.  This costs an indirect
pointer fetch, but saves us from changes in 'FILE'.  The __stdin stuff
is there to not pollute application name space if the application does
not use <stdio.h> and also in case something depended on the current
behavior where stdin etc was a #define.

Reviewed by:	eischen, dillon
2001-02-12 02:50:30 +00:00
Robert Watson
4be19dddae o Fix build of libc broken in revision 1.2. offsetof() requires the
inclusion of stddef.h.

Reviewed by:	peter
2001-02-12 02:44:33 +00:00
Daniel Eischen
29ac6bd228 libc MT-safety, part 2.
Add a lock to FILE.  flockfile and friends are now implemented
(for the most part) in libc.  flockfile_debug is implemented in
libc_r; I suppose it's about time to kill it but will do it in
a future commit.

Fix a potential deadlock in _fwalk in a threaded environment.
A file flag (__SIGN) was added to stdio.h that, when set, tells
_fwalk to ignore it in its walk.  This seemed to be needed in
refill.c because each file needs to be locked when flushing.

Add a stub for pthread_self in libc.  This is needed by flockfile
which is allowed by POSIX to be recursive.

Make fgetpos() error return value (-1) match man page.

Remove recursive calls to locked functions (stdio); I think I've
got them all, but I may have missed a couple.

A few K&R -> ANSI conversions along with removal of a few instances
of "register".

$Id$ -> $FreeBSD$ in libc/stdio/rget.c

Not objected to:	-arch, a few months ago
2001-02-11 22:06:43 +00:00
Nik Clayton
6bd7c68cf0 Mention PROT_NONE in the list of possible protections.
Pointed out by:	kris
2001-02-11 19:30:41 +00:00
Nik Clayton
59b58b1622 Include mmap(2) in the list of memory allocation functions.
Reviewed by:	hackers
2001-02-11 19:28:36 +00:00
Nik Clayton
38f2cd4aa4 .Xr to mmap. 2001-02-11 18:53:50 +00:00
Nik Clayton
3db072ec5e Note that mmap(2) can allocate memory, as well as mapping existing files,
in the .Nd.

Reviewed by:	hackers
2001-02-11 18:51:17 +00:00
Nik Clayton
480e9923d5 Add a man page for the dbm_* functions, and update the Makefile to link
it in.

Some review from -hackers (some time ago), and I think the best way to
get this improved (if it needs improving) or updating, is to bring it in.

PR:             docs/12557
Submitted by:   Tim Singletary <tsingle@triana.gsfc.nasa.gov>
2001-02-11 17:24:25 +00:00
Alexey Zelkin
fc19bba6aa Don't use hardcoded struct size, use offsetof() instead (make size calculations
dynamic)
2001-02-11 15:09:31 +00:00
Alexey Zelkin
9040b756dd Don't try to convert grouping strings in case if C or POSIX locale
was explicitly specified.

Submitted by:	ache
2001-02-11 15:07:26 +00:00
Alexey Zelkin
cb03ae3061 make it possible to specify grouping number from range 0..CHAR_MAX,
not only one-digit number
2001-02-10 20:22:45 +00:00
Alexey Zelkin
7d2cc62ba3 Use "namespace.h" and "un-namespace.h"
Requested by:	deischen
2001-02-10 19:57:26 +00:00
Alexey Zelkin
1bd7723d09 . Fix semantics of grouping (LC_MONETARY::mon_grouping,
LC_NUMERIC::grouping) values.
. Always set __XXX_changed flags then loading numeric & monetary locale
  categories to allow localeconv() to use C locale also.
2001-02-10 15:36:46 +00:00
Ruslan Ermilov
c634427cd5 mdoc(7) police: polishing. 2001-02-10 10:51:39 +00:00
Ruslan Ermilov
429d919c70 mdoc(7) police: mark LC_NUMERIC with .Dv. 2001-02-10 10:26:52 +00:00
Nik Clayton
3ad2681f52 Improve language and code examples.
PR:             docs/24961
Submmitted by:  Tony Finch <dot@dotat.at>
2001-02-10 07:48:01 +00:00
Andrey A. Chernov
2b2075b191 Note that decimal point taken from locale 2001-02-10 06:42:32 +00:00
Andrey A. Chernov
1c97c57770 Note that decimal point taken from locale (SUSv2) 2001-02-10 06:32:03 +00:00
Andrey A. Chernov
9ad80ab51f Take decimal point from locale instead of hardcoded '.' (SUSv2) 2001-02-10 06:25:33 +00:00
Andrey A. Chernov
36db56802d Note that decimal point character taken from locale (SUSv2) 2001-02-10 05:52:59 +00:00
Andrey A. Chernov
a2a135c94f Use decimal point from localeconv() instead of hardcoded '.' (SUSv2) 2001-02-10 05:46:05 +00:00
Andrey A. Chernov
05a6e1e59b Note the fact that decimal point taken from locale (according to SUSv2) 2001-02-10 05:16:41 +00:00
Andrey A. Chernov
b0e3ccc057 Use decimap_point from localeconv() instead of hardcoded '.'
Obtained from:	inspired by NetBSD strtod
2001-02-10 05:05:09 +00:00
Andrey A. Chernov
ab9577f234 As temporary workaround for missing *grouping fields parser always return "no
grouping" (CHAR_MAX, '\0').
Fixme: grouping parser needs to be implemented.
2001-02-10 04:32:55 +00:00
Andrey A. Chernov
96be743f80 According to Garrett, POSIX widely use -1 to indicate CHAR_MAX, so back out
all my "-1" -> "something" fixes and replace -1 with CHAR_MAX directly in
strtol() in cnv()
2001-02-10 03:31:23 +00:00
Andrey A. Chernov
d2712eafa7 Use __XSTRING(CHAR_MAX) instead of "127" and strtol() base 0 to parse it (0x7f) 2001-02-10 02:00:56 +00:00
Andrey A. Chernov
1506a668dc Correct myself a bit: situation is broken not for _all_ numeric LC_MONETARY,
LC_NUMERIC fields, but only for *grouping fields - other fields are converted
to a chars in localeconv(), so final change is:

"-1" -> "127"

127 here is because CHAR_MAX supposed, which is _positive_ (SUSv2 requirement),
not negative as 255. It is still a bit of hack. To find real CHAR_MAX will be
better to sprintf() it once somewhere in static buffer. *grouping parsing
still broken and missing and needs to be implemented.
2001-02-10 01:38:18 +00:00
Andrey A. Chernov
051f867fe1 NOTE: according to SUSV2 and other implementations, numeric elements in
LC_MONETARY, LC_NUMERIC are byte-arrays, not ASCII strings!

Fix "C" locale, change "-1" to {CHAR_MAX, '\0'} according to standards.

This is only partial fix - locale loading procedure remains broken as before
and load too big values for all locales.  All numeric strings there should be
converted with something like atoi() and placed into bytes.  Maybe I do it
later, if someone will not fix it faster.
2001-02-10 00:43:32 +00:00
Andrey A. Chernov
d0e2083fdd Implement CODESET 2001-02-09 22:43:39 +00:00
Tor Egge
d7e56cc908 Backout previous commit. Use of spinlocks was not approved.
PR:		15070
2001-02-09 20:31:48 +00:00
Nik Clayton
4460a589ec Describe the arguments to gethostbyaddr.
PR:             docs/24225
Submitted by:   Joakim Henriksson <jurduth@ludd.luth.se>
Patch from:     ben
2001-02-09 19:06:25 +00:00
Andrey A. Chernov
634c946524 Back out attempt to implement CRNCYSTR - require additional prefixes according
to SUSV2. Add comment explaining it instead.
2001-02-09 18:39:17 +00:00
Andrey A. Chernov
218bcbcb4d Explicitly mark deprecated entries.
Return currency_symbol for CRNCYSTR
Return "%r" for T_FMT_AMPM
Remove obsoleted comment about c_fmt
Return "" for {YES,NO}STR
2001-02-09 18:16:12 +00:00
Ruslan Ermilov
78b7a6c149 mdoc(7) police: prevent generation of the extra
whitespace after ``i.e.'', use .Rv, update .Dd.
2001-02-09 12:47:23 +00:00
Ruslan Ermilov
3fe5c3c9aa mdoc(7) police: fixed the weird construct. 2001-02-09 09:08:53 +00:00
Andrey A. Chernov
740972dc72 Hardcode c_fmt in a different way since used in nl_langinfo now 2001-02-08 20:55:38 +00:00
Tor Egge
1d538861ff Protect freelists managed by Balloc/Bfree with a spinlock.
Change __dtoa to not free the string it allocated the previous time it was
called.  The caller now frees the string after usage if appropiate.

PR:		15070
2001-02-08 20:22:28 +00:00
Alexey Zelkin
747a8b55e8 add lmonetary.?, lnumeric.?, ldpart.?, lmessages.?, nl_langinfo.c
remove lconv.c
2001-02-08 17:13:24 +00:00
Alexey Zelkin
60e1d74ff8 Add SUSv2 compatible nl_langinfo() function. It still need some work, but
this is already usable one.
2001-02-08 17:12:03 +00:00
Alexey Zelkin
930cd71107 Catch up to latest chanage in timelocal structures exporting. 2001-02-08 17:08:13 +00:00