Commit Graph

293 Commits

Author SHA1 Message Date
Jeroen Ruigrok van der Werven
99e8131545 Change standards compliancy order so that C and POSIX are grouped. 2001-09-26 19:42:39 +00:00
Mike Barcroft
a5aecc7707 style(9)
Silence from:	phantom
2001-09-17 00:23:19 +00:00
Ruslan Ermilov
8fc5ce4d99 mdoc(7) police: changed pure POSIX text; added missing markup bits. 2001-09-11 09:39:23 +00:00
Jeroen Ruigrok van der Werven
49c65386a5 Add more standards which we conform to.
Note our implementation is not thread nor async-cancel safe.
Explicitely note atof() does not check nor report errors.
Note that strtod() should be used instead.
2001-09-09 21:09:53 +00:00
Jeroen Ruigrok van der Werven
e348b8ea25 Detail thread-safe and async-cancel-safe status.
Also add C99 conformity status plus clarification that C99 leaves the
flushing of unwritten data, closure of open streams, and removal of
temporary files to the implementation.
2001-09-09 18:52:00 +00:00
Jeroen Ruigrok van der Werven
8aefde0607 Move to using .In instead of .Fd #include <> for include mark-up.
Inspired by comment from:	dd
2001-09-07 14:46:36 +00:00
Alexey Zelkin
84b4fdf912 reconnect strfmon.c to build list 2001-09-07 13:03:16 +00:00
Jeroen Ruigrok van der Werven
fbded4984e Fix some mdoc nits caused by my knowledge not being too up-to-date on
mdocNG.

Submitted by:	dd
2001-09-07 12:38:10 +00:00
Doug Rabson
8e37b82334 Port to ia64, taking into account the fact that pagesizes may be variable. 2001-09-07 12:32:43 +00:00
Jeroen Ruigrok van der Werven
8c9893a371 Add strfmon.3 to the fray.
This is a first cut, but enough to help people interested in using it
further than before.
More text coming to illustrate use and provide more details.

Based on standards' text.
2001-09-07 09:55:28 +00:00
Alexey Zelkin
f6a9e03fe5 correctly wrap macros with { } 2001-09-06 09:26:28 +00:00
David E. O'Brien
19372e6db7 strfmon(3) is not ready to go live. 2001-09-06 08:58:42 +00:00
Alexey Zelkin
9d430a5991 Add strfmon(3) implementation. It still contains few XXX's because I lost
my last version of this work due to HDD crash, but this version cleanly
passed all POSIX and SuSv2 tests. I am working on testing scripts which
should test this implementation against all locales and surely more fixes
will come soon.

Reviewed by:	ache, silence at -audit & -developers
2001-09-05 18:50:02 +00:00
Andrey A. Chernov
2505b3ed25 Portability fix: use unsigned cast to guaranteed positive part of expression
in case {L}LONG_MAX > abs({L}LONG_MIN).  Non-functional change - we don't
have any such platforms.
2001-09-04 21:28:01 +00:00
Andrey A. Chernov
f8ade0e68e Remove rcsids and unneded include 2001-09-04 17:41:20 +00:00
Andrey A. Chernov
f4fc08f367 'acc' is not initialized in one hypotetical case, fix it 2001-09-04 17:12:15 +00:00
Andrey A. Chernov
4e6b157062 Locale *is* used in strto*l*(), at least for isspace(), so remove
'locale not used' statement from comments and BUGS section of manpage.

strtol(): fix non-portable 'cutoff' calculation using the same method as
in strtoll().

Cleanup 'cutoff' calculation, remove unneded casts. Misc. cleanup to
make all functions looks the same.

Implement EINVAL reaction per POSIX, document it in manpage, corresponding
POSIX example quotes here:

------------------------------------------------
If the subject sequence is empty or does not have the expected form, no
conversion is performed; the value of str is stored in the object pointed
to by endptr, provided that endptr is not a null pointer.

If no conversion could be performed, 0 shall be returned and errno may be
set to [EINVAL].

[EINVAL] The value of base is not supported.

Since 0, {LONG_MIN} or {LLONG_MIN}, and {LONG_MAX} or {LLONG_MAX} are
returned on error and are also valid returns on success, an application
wishing to check for error situations should set errno to 0, then call
strtol( ) or strtoll ( ), then check errno.
-----------------------------------------------------
2001-09-04 16:39:11 +00:00
Ruslan Ermilov
d6002fef6f Use ``.Rv -std'' wherever possible.
Submitted by:	yar
2001-08-31 09:57:38 +00:00
Joseph Koshy
2f46ebcdb7 If the string specifying the allowed options starts with a leading `:',
`getopt(3)' should not print a warning for missing argument values.

PR:		bin/29625
Reviewed by:	mikeh
MFC after:	1 week
2001-08-16 03:27:03 +00:00
Ruslan Ermilov
b3ebbab8d3 Fixed style bugs (dot `.' at the end of error and warning messages).
Noticed by:	bde
2001-08-10 11:46:37 +00:00
Ruslan Ermilov
a9bef12a45 Markup nits: use diagnostic type lists for error and warning messages.
Backout previous revision.  We should not expand plain text xrefs if
they appear in the literal text, e.g. in the error or warning message
of the library function.  (Submitted by: bde)

Moved "out of memory" from warning to errors section.
2001-08-10 11:41:55 +00:00
Yaroslav Tykhiy
b1250632c5 Use the ``.Rv -std'' mdoc(7) macro in appropriate cases.
Reviewed by:	ru
2001-08-09 13:32:13 +00:00
Ruslan Ermilov
6575e6daae mdoc(7) police: expand plain text xrefs. 2001-08-08 11:48:28 +00:00
Mark Peek
545d32087b Only pull in the MD files if they exist. This allows for progressive
implementation and compilation when bringing up a new architecture.
2001-07-31 16:34:52 +00:00
Dima Dorfman
7ebcc426ef Remove whitespace at EOL. 2001-07-15 07:53:42 +00:00
Ruslan Ermilov
a307d59838 mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 13:41:46 +00:00
Ruslan Ermilov
e25e8ab41c mdoc(7) police: eliminate -ww warnings. 2001-07-09 15:54:36 +00:00
Dima Dorfman
70d51341bf mdoc(7) police: remove extraneous .Pp before and/or after .Sh. 2001-07-09 09:54:33 +00:00
Ruslan Ermilov
62205fee40 mdoc(7) police: mark NULL with .Dv. 2001-07-04 12:04:25 +00:00
Dima Dorfman
44fe68c421 mdoc(7) police: the BUGS section should go after HISTORY and AUTHORS. 2001-06-24 20:58:20 +00:00
Dima Dorfman
17011fc056 The fact that phk wrote this is not a bug! 2001-06-24 20:56:39 +00:00
Dima Dorfman
acaa9950a4 Reword a sentence to make it proper English. 2001-06-24 18:11:42 +00:00
Dima Dorfman
a7d81577d6 urandom(4) -> random(4) in comments.
PR:		27858
Submitted by:	Yoshihiro Koya <Yoshihiro.Koya@math.yokohama-cu.ac.jp>
Reviewed by:	md5(1)
Approved by:	markm
2001-06-07 02:32:18 +00:00
Dima Dorfman
df49b8e2ab urandom(4) -> random(4)
PR:		27858
Submitted by:	Yoshihiro Koya <Yoshihiro.Koya@math.yokohama-cu.ac.jp>
Approved by:	markm
2001-06-07 02:31:03 +00:00
Ruslan Ermilov
ec7d12549c Add new, from scratch implementation of hsearch() et al that actually works.
Obtained from:	NetBSD
MFC after:	1 month
2001-05-15 07:08:20 +00:00
Ruslan Ermilov
7ab50d97ea Grammar nit. 2001-04-27 08:16:57 +00:00
Andrey A. Chernov
74825256ef Add sranddev.3 to MLINKS 2001-04-23 11:11:00 +00:00
Andrey A. Chernov
4890ae810e Add #include "un-namespace.h" 2001-04-23 10:38:26 +00:00
Andrey A. Chernov
848422bb7d srand*dev() fallback code: change ^getpid() to ^(getpid() << 16) to allow
change of high word part too to produce more interesting seed distribution.
2001-04-23 10:14:28 +00:00
Andrey A. Chernov
7708205cb7 Add sranddev() since srand() is not vary much with seed, typical time 2001-04-23 02:29:10 +00:00
Ruslan Ermilov
4a558355e5 MAN[1-9] -> MAN. 2001-03-27 17:27:19 +00:00
Dima Dorfman
681b009b93 Make tdelete(3), tfind(3), and twalk(3) links to tsearch(3).
Approved by:	nik
2001-03-15 01:53:17 +00:00
David E. O'Brien
083745b549 Merge in strtoul.3 rev 1.11 mdoc(7) police changes:
.Nd line broken in rev 1.10
	use .Bx for ``BSD''
2001-02-28 17:46:56 +00:00
Ruslan Ermilov
0b01af0991 mdoc(7) police: fix the .Nd line broken in previous revision.
Noticed by:	bde

Use .Bx for ``BSD''.
2001-02-28 12:54:16 +00:00
Andrey A. Chernov
cbcf73f998 Use formula with better random distribution for rand()
Even better formula from random() could not be intetgrated because rand_r()
supposed to store its state in the single variable (but table needed for
random() algorithm integration).
2001-02-27 14:42:19 +00:00
David E. O'Brien
3bdced7c3c I accidently deleted an include when I added the $FreeBSD$ so I could
check in my changes.
2001-02-27 14:30:42 +00:00
David E. O'Brien
4c0440cb86 Impliment the ISO-C99 strto[u]ll()
and rewrite strto[u]q() in terms of it.
2001-02-27 13:33:07 +00:00
Ruslan Ermilov
588a200ce1 .St -ansiC -> .St -isoC 2001-02-26 13:23:47 +00:00
Tor Egge
3275de7ca5 Update unused __dtoa prototypes to match reality. 2001-02-25 08:51:41 +00:00
Tor Egge
2ffc61ba9c Remove freelists managed by Balloc/Bfree.
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
Reviewed by:	deischen
2001-02-15 22:12:50 +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
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
Ruslan Ermilov
429d919c70 mdoc(7) police: mark LC_NUMERIC with .Dv. 2001-02-10 10:26:52 +00:00
Andrey A. Chernov
2b2075b191 Note that decimal point taken from locale 2001-02-10 06:42:32 +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
Tor Egge
d7e56cc908 Backout previous commit. Use of spinlocks was not approved.
PR:		15070
2001-02-09 20:31:48 +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
Ruslan Ermilov
46eea498da mdoc(7) police: Change -filled displays (which just happen
to be the same as -ragged in the current implementation) to
-ragged.  With mdocNG, -filled displays produce the correct
output, formatted and justified to both margins.
2001-02-07 13:45:30 +00:00
Bruce Evans
75d5d29ef0 Fixed C error(s) in synopsis. Many were hiding under mdoc errors. 2001-02-05 15:19:56 +00:00
Poul-Henning Kamp
95ba77bff8 Remove a sizeof(void *) == sizeof(int) assumption.
Submitted by:	Loren James Rittle <rittle@latour.rsch.comm.mot.com>
2001-02-04 10:06:24 +00:00
Ruslan Ermilov
d0353b836e mdoc(7) police: split punctuation characters + misc fixes. 2001-02-01 16:38:02 +00:00
Daniel Eischen
d201fe46e3 Remove _THREAD_SAFE and make libc thread-safe by default by
adding (weak definitions to) stubs for some of the pthread
functions.  If the threads library is linked in, the real
pthread functions will pulled in.

Use the following convention for system calls wrapped by the
threads library:
	__sys_foo - actual system call
	_foo - weak definition to __sys_foo
	foo - weak definition to __sys_foo

Change all libc uses of system calls wrapped by the threads
library from foo to _foo.  In order to define the prototypes
for _foo(), we introduce namespace.h and un-namespace.h
(suggested by bde).  All files that need to reference these
system calls, should include namespace.h before any standard
includes, then include un-namespace.h after the standard
includes and before any local includes.  <db.h> is an exception
and shouldn't be included in between namespace.h and
un-namespace.h  namespace.h will define foo to _foo, and
un-namespace.h will undefine foo.

Try to eliminate some of the recursive calls to MT-safe
functions in libc/stdio in preparation for adding a mutex
to FILE.  We have recursive mutexes, but would like to avoid
using them if possible.

Remove uneeded includes of <errno.h> from a few files.

Add $FreeBSD$ to a few files in order to pass commitprep.

Approved by:	-arch
2001-01-24 13:01:12 +00:00
Ruslan Ermilov
32f6256a49 Prepare for mdoc(7)NG. 2001-01-16 09:08:22 +00:00
Ruslan Ermilov
b77b3c00be mdoc(7) police: Ft/Vt now accept punctuation-type arguments. 2001-01-12 15:46:56 +00:00
Ruslan Ermilov
672062062d Fixed typo not fixed in previous revision. 2000-12-29 14:36:05 +00:00
Ruslan Ermilov
4263595653 Prepare for mdoc(7)NG. 2000-12-29 14:08:20 +00:00
Ruslan Ermilov
ed40311694 mdoc(7) police: removed history info from the .Os FreeBSD call. 2000-12-14 11:52:05 +00:00
David E. O'Brien
1a37aa566b Add `_PATH_DEVZERO'.
Use _PATH_* where where possible.
2000-12-09 09:35:55 +00:00
Matthew Hunt
fecae3493c The parameter that contains valid options is "optstring", not "optarg". 2000-11-28 22:06:17 +00:00
Poul-Henning Kamp
798c1fd885 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
Ruslan Ermilov
c23155a43a mdoc(7) police: Er macro usage cleanup. 2000-11-22 16:02:00 +00:00
Ruslan Ermilov
251c176f41 mdoc(7) police: use certified section headers wherever possible. 2000-11-17 11:44:16 +00:00
Ruslan Ermilov
b5c508fba3 Use Fx macro wherever possible. 2000-11-14 11:20:58 +00:00
Ruslan Ermilov
a72b09f0aa Fixed typos. 2000-11-06 15:46:57 +00:00
Eivind Eklund
e68aef6429 Back out previous commit (MLINK malloc.conf.5 -> malloc.3).
This did not work correctly with whatis(1).

Issue brought up by:	mpp
2000-10-29 13:20:24 +00:00
Eivind Eklund
8b746a4d67 Add link malloc.conf.5 -> malloc.3 2000-10-29 09:59:35 +00:00
Brian Somers
f241969910 Oops, un-spam this file - the last commit was an accident.
Pointed out by: phk
2000-09-20 06:16:23 +00:00
Brian Somers
b1daa1b9db Only realloc() environ if we're sure that we know where it came from.
The recent problems with sshd were due to sshd reassigning
`environ' when setenv() thinks it owns it.  setenv() subsequently
realloc()s the new version of environ and *boom*
2000-09-20 03:05:37 +00:00
Warner Losh
e9d918edb6 Don't print an error message if the bad option is '?'. This has been
in my tree for a long time.  bde reviewed this once upon a time and
said it was OK, iirc.  This also obviates the need to put ? in the
optstring argument to preclude the extra warning message which some
people think confuses users.  When I made my getopt cleanups of a long
time ago, this was the compromise reached.  I just neglected to commit
it until now.
2000-09-04 03:49:22 +00:00
Poul-Henning Kamp
832505d0c9 Turn malloc options "AJ" on by default.
These will be turned off again as we approach 5.0-RELEASE.

If you benchmark things, make sure to
	ln -sf j /etc/malloc.conf
to see "true" performance.
2000-07-09 13:10:18 +00:00
Alfred Perlstein
64566a3e2a bring in binary search tree code.
Obtained from: NetBSD
2000-07-01 06:55:11 +00:00
Sheldon Hearn
f167d7fb3e Fix miscellaneous mdoc macro argument limit infringements.
PR:		18465
Reported by:	Kazu TAKAMUNE <takamune@avrl.mei.co.jp>
2000-05-09 14:02:06 +00:00
Alexey Zelkin
274b6244d3 Use `Er' variable to define first column width in ERRORS section. 2000-05-06 12:00:11 +00:00
Mike Pritchard
751f44657e Minor mdoc cleanup.
PR:		docs/13218
2000-05-05 02:21:45 +00:00
Alexey Zelkin
25bb73e063 Introduce ".Lb" macro to libc manpages.
More libraries manpages updates following.
2000-04-21 09:42:15 +00:00
Poul-Henning Kamp
aad4b9d1e8 Add a missing THREAD_UNLOCK() found missing by Valentin Nechayev
<netch@segfault.kiev.ua>

Remove allocation failure check from 'A' option, the 'X' option does
this as a standalone check now.
2000-04-10 09:24:44 +00:00
Philippe Charnier
f25c63af03 Spelling, fprintf -> err, remove unneeded variable declaration 2000-03-26 15:18:12 +00:00
Jason Evans
b479399f73 Take care to avoid having "strong" and "weak" symbols of the same name in
libc_r.
2000-03-16 02:14:41 +00:00
Chris Costello
cfc2d91b25 Merge from RELENG_3 (oops):
resolved_name	-> resolved_path
    resolvedname	-> resolved_path
2000-01-29 19:43:25 +00:00
Jason Evans
9233c4d942 Simplify sytem call renaming. Instead of _foo() <-- _libc_foo <-- foo(),
just use _foo() <-- foo().  In the case of a libpthread that doesn't do
call conversion (such as linuxthreads and our upcoming libpthread), this
is adequate.  In the case of libc_r, we still need three names, which are
now _thread_sys_foo() <-- _foo() <-- foo().

Convert all internal libc usage of: aio_suspend(), close(), fsync(), msync(),
nanosleep(), open(), fcntl(), read(), and write() to _foo() instead of foo().

Remove all internal libc usage of: creat(), pause(), sleep(), system(),
tcdrain(), wait(), and waitpid().

Make thread cancellation fully POSIX-compliant.

Suggested by:	deischen
2000-01-27 23:07:25 +00:00
Ruslan Ermilov
7e20508477 o Back out rev 1.4 - reallocf() failure clobbers existing `environ'.
o Do not override `environ' if realloc() fails, leave it intact.
o Set `alloced' only when memory is actually allocated.

PR:		bin/5604 (2nd part)
Reviewed by:	bde
2000-01-27 16:12:03 +00:00
Archie Cobbs
5059d6a601 Document the memory leak that is inherent in FreeBSD's semantics
for getenv()/putenv().

PR:	10341 5604
2000-01-26 22:10:56 +00:00
Jason Evans
929273386f Add three-tier symbol naming in support of POSIX thread cancellation
points.  For library functions, the pattern is __sleep() <--
_libc_sleep() <-- sleep().  The arrows represent weak aliases.  For
system calls, the pattern is _read() <-- _libc_read() <-- read().
2000-01-12 09:23:48 +00:00
Tim Vanderhoek
838fb327f2 Make example for handling "-##" work and comply with style(9). Still
doesn't handle nastier corner cases such as "-j3 -33" correctly.  <shrug>

PR:		docs/12994 (James Howard <howardjp@wam.umd.edu>)
2000-01-06 01:25:15 +00:00
Tim Vanderhoek
e99fd39264 Add history: The reallocf() function first appeared in FreeBSD-3.0.
See imp's 199808201619.KAA20970@harmony.village.org in freebsd-hackers (the
reallocf.c cvs history mistakenly refers to freebsd-current).
1999-12-28 15:14:59 +00:00
Bruce Evans
fb59427e5c Fixed missing installation of a link to rand_r.3. 1999-12-23 16:00:50 +00:00
Sheldon Hearn
b3c5295256 Document the current behaviour with respect to the handling of errno.
Approved by:	phk
1999-12-22 17:04:46 +00:00