Commit Graph

148 Commits

Author SHA1 Message Date
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
Maxim Sobolev
a06f15e4b8 Fix a f^Hdamn typo, which prevented to fopen() more that 17 files at once.
Tested by:	knu, sobomax and other #bsdcode'rs
2001-02-07 17:34:48 +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
Archie Cobbs
42cebaa5c0 Fix bugs in the handling of > 8 positional arguments:
- The stack was getting smashed by __grow_type_table()
- reallocf() was being called with the wrong pointer
- The maximum argument number was being incorrectly computed

PR:	misc/23521
2001-01-06 20:48:00 +00:00
Ben Smithurst
7e7a6ec033 Make it a bit clearer that asprintf doesn't actually "return" a pointer in
the normal sense of the word, but does it through one of its arguments which
is a pointer to a pointer.

PR:		23717
Submitted by:	phk
2001-01-01 05:19:52 +00:00
Ruslan Ermilov
4263595653 Prepare for mdoc(7)NG. 2000-12-29 14:08:20 +00:00
Ruslan Ermilov
a2fd3702a3 mdoc(7) police: use canonical form of .Dd macro. 2000-12-11 15:15:20 +00:00
Ruslan Ermilov
3b8ecdbbbe mdoc(7) police: use the new features of the Nm macro. 2000-11-20 14:08:07 +00:00
Kris Kennaway
dc3f2db745 Update the documentation to describe the new mktemp() family behaviour.
Also notes that mkstemp() first appeared in 4.4BSD (change obtained
from OpenBSD)

Reviewed by:	sheldonh
2000-11-19 10:21:32 +00:00
Ruslan Ermilov
b5c508fba3 Use Fx macro wherever possible. 2000-11-14 11:20:58 +00:00
Kris Kennaway
f1303ab4b2 Increase the size of the mktemp() filename space by dropping the PID from
the encoding and using the character set [a-zA-Z0-9]. This gives a total
of 62^6 = 56800235584 possible temporary filenames for the usual default
invocation of 6 X's (compared to as few as 52 possibilities for the
previous algorithm where up to 5 characters were wasted by the PID).

Update some apparently bitrotten comments to reflect reality.

Audited by:	eivind, freebsd-audit
Reviewed by:	freebsd-current (a while ago)
Originally submitted by:	Peter Jeremy <Peter.Jeremy@alcatel.com.au>
2000-11-10 23:27:55 +00:00
Ruslan Ermilov
726b61ab5f Avoid use of direct troff requests in mdoc(7) manual pages. 2000-11-10 17:46:15 +00:00
Eivind Eklund
11ab3fc7cb Better documentation of append mode. This should have gone in -current
directly.   Now also .Xr fseek reference.

Prodded by:	sheldonh
2000-09-22 12:55:36 +00:00
David Malone
ad8c1e6a09 According to the susv2 man pages I have, remove(3) should act as
rmdir(2) on directories and unlink(2) otherwise. This modification,
and most of the man page update has been obtined from OpenBSD. This
was spotted by someone on a mailing lists a few months ago, but
I've lost their mail.

Reviewed by:	sheldonh
2000-08-28 15:45:42 +00:00
Alexey Zelkin
03fc63031e Use `Er' variable to define first column width in ERRORS section. 2000-05-06 12:07:59 +00:00
Alexey Zelkin
25bb73e063 Introduce ".Lb" macro to libc manpages.
More libraries manpages updates following.
2000-04-21 09:42:15 +00:00
Jeroen Ruigrok van der Werven
1c7ac7e759 Fix typo, reported by George Cox.
Fix hard sentence breaks.

Submitted by:	George Cox <gjvc@sophos.com>
2000-04-12 13:38:26 +00:00
Sheldon Hearn
4e86fcacf6 Remove more single-space hard sentence breaks. 2000-03-02 14:54:02 +00:00
Sheldon Hearn
c6ff3a1bf7 Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.
2000-03-02 09:14:21 +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
Sheldon Hearn
71207448cf Improve the explanation on the (in)security of mktemp(3). 2000-01-25 13:58:46 +00:00
Kris Kennaway
466c0416c8 We no longer care about the VAX and Tahoe compilers :-) 2000-01-17 01:28:00 +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
Kris Kennaway
3076db1900 Correct discrepancy between definition of argument to tempnam() and
the name by which it is referenced in the text.
2000-01-09 08:54:03 +00:00
Peter Wemm
5f02be00bc While comparing this with OpenBSD (ie: trying to figure out what mkstemps()
is good for... :-)), I discovered that part of the change when mkstemps()
was brought in was missed - it was missing the termination case to make
sure it doesn't walk into the suffix.  This isn't the same code OpenBSD
has, I think this is a little better as we terminate the loop in a better
spot.
1999-12-11 14:48:24 +00:00
Dmitrij Tejblum
dcd26325e8 Make __sfp() even more thread-safe. 1999-11-21 22:34:57 +00:00
Dmitrij Tejblum
32fc781e06 Add (FILE *) locking. 1999-11-20 14:52:03 +00:00
Dmitrij Tejblum
e33f599134 Make __sfp() (FILE allocator) thread-safe: added locking like in malloc(). 1999-11-20 14:01:48 +00:00
David E. O'Brien
3c0c03cdf1 Fix HISTORY - the copyright header on the file of the GCC version was
misleading.

Submitted by:	Theo de Raadt <deraadt@cvs.openbsd.org>
1999-11-20 00:15:17 +00:00
David E. O'Brien
b6419b666f Add to the HISTORY. 1999-11-19 17:13:31 +00:00
Andrey A. Chernov
bac6a61c15 Add unsigned char cast to isdigit 1999-11-04 04:57:05 +00:00
Andrey A. Chernov
5eb8ccf583 Remove UNSAFE_WARN ifdef for mktemp warning (never defined)
Use _mktemp internally
1999-10-24 11:57:24 +00:00
Peter Wemm
7f3dea244c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
Warner Losh
028aace8e1 Add warnings, ala mktemp, to tempnam and tmpnam as a reminder that
these are inherently unsafe interfaces.

Do not allow TMPDIR to override path for setuid/setgid programs.
1999-08-21 17:56:44 +00:00
Robert Nordier
18e08df153 Treat an attempt to read from a write-only stream more consistently.
Submitted by: Anton Berezin <tobez@plab.ku.dk>
PR          : 12852
1999-08-10 21:36:51 +00:00
Bruce Evans
749a33625d Fixed missing "G" in the list item for the main description of %g and
%G formats.
1999-08-08 11:00:01 +00:00
Tim Vanderhoek
6a8e2895aa asprintf() does use realloc() internally, but saying so in the manpage can be
misinterpreted to mean that the pointer passed to asprintf() must be suitable
for passing to realloc() as-is (ie. either a NULL pointer or a valid pointer).
1999-07-25 17:38:59 +00:00
Nik Clayton
fbc400a67a Add $Id$, to make it simpler for members of the translation teams to
track.

The $Id$ line is normally at the bottom of the main comment block in the
man page, separated from the rest of the manpage by an empty comment,
like so;

     .\"    $Id$
     .\"

If the immediately preceding comment is a @(#) format ID marker than the
the $Id$ will line up underneath it with no intervening blank lines.
Otherwise, an additional blank line is inserted.

Approved by:            bde
1999-07-12 20:50:10 +00:00
Archie Cobbs
f24c2153d5 Add a note that when a stream opened via fdopen() is closed via fclose(),
the underlying file descriptor is also closed. To me at least this wasn't
immediately obvious.
1999-05-17 23:47:27 +00:00
Warner Losh
26ba999e7e Various language and style concerns fixed.
Noted by: bde
1999-04-09 18:26:46 +00:00
Warner Losh
2ee878400e Add mkstemps to the man page, and create a link for it.
Obtained from: OpenBSD
Poked in the eye about committing new functions without a manpage: obrien
1999-04-04 21:15:37 +00:00
Warner Losh
06b6a8ab98 Add mkstemps from OpenBSD. This has been in my tree for months and
hasn't caused any problems until the egcs import.  This fix breaks the
world build, but my very next commit will remove mkstemps from the
egcs build.
1999-04-04 20:28:04 +00:00
Doug Rabson
93263596ac Add support for long long modifier (e.g. %llx, %lld).
Reviewed by: bde
1999-03-11 22:44:02 +00:00
Bruce Evans
dcf01d60ba Fixed disordering and incoinsistent style in previous commit. 1999-03-05 13:01:22 +00:00
Bruce Evans
b300c1d8f9 The pseudocode in the synopsis didn't come close to actually
compiling, since <stdio.h> correctly doesn't declare off_t although
the pseudo-prototypes for the new fseeko() and ftello() functions
use it.  Handle this like the corresponding problem for va_list
versus the vprintf() family.

Fixed some English errors.
1999-03-05 12:56:37 +00:00
Tim Vanderhoek
654b249ced Decapitalize function name by prepending with word "The".
PR:		docs/10247
1999-02-26 01:28:06 +00:00
Dmitrij Tejblum
7307d07db6 Added functions fseeko() and ftello() (from susv2).
Fixed fgetpos() and fsetpos() for offsets > 2GB.

PR:		8637
Submitted by:	 Dan Nelson <dnelson@emsphone.com> (adjusted by me a little)
1999-02-08 21:32:38 +00:00
Eivind Eklund
70efdda93d Note that dying on NULL is an implementation detail. 1998-12-17 17:13:47 +00:00
Robert Nordier
e524a581b1 Check for a zero-length as well as a NULL string argument. 1998-10-29 14:40:20 +00:00