summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio
Commit message (Collapse)AuthorAgeFilesLines
* Commit a libc fix going by the current state of the version numberingpeter2001-02-141-9/+10
| | | | | | | | | | | | | | | | bikeshed in -arch. It isn't quite over, but it has been well established that this can be adjusted or refined. But we do seem to have consensis on a major bump of some sort. After this, it should reasonably safe to build world again. This change is to get rid of __sF[] and use seperate __stdin/out/err handles. This means we can pad on extra bits onto the end of FILE at will without going through this all over again. __sF[] was evil because it compiled the sizeof(FILE) into every stdio using program. Asbestos suit on: check! Peril sensitive sunglasses on: check! *gulp!*
* It sounded like a good idea at the time. The previous change breakspeter2001-02-121-4/+0
| | | | | FILE *buffer = stdout; so back it out for now.
* Take advantage of the current libc sizeof(FILE) breakage (__sF[]) andpeter2001-02-121-0/+4
| | | | | | | | | | 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
* libc MT-safety, part 2.deischen2001-02-1119-102/+247
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* mdoc(7) police: mark LC_NUMERIC with .Dv.ru2001-02-102-2/+4
|
* Note that decimal point taken from locale (SUSv2)ache2001-02-101-0/+3
|
* Take decimal point from locale instead of hardcoded '.' (SUSv2)ache2001-02-101-9/+10
|
* Note that decimal point character taken from locale (SUSv2)ache2001-02-101-0/+3
|
* Use decimal point from localeconv() instead of hardcoded '.' (SUSv2)ache2001-02-101-6/+14
|
* Backout previous commit. Use of spinlocks was not approved.tegge2001-02-091-18/+5
| | | | PR: 15070
* Protect freelists managed by Balloc/Bfree with a spinlock.tegge2001-02-081-5/+18
| | | | | | | 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
* Fix a f^Hdamn typo, which prevented to fopen() more that 17 files at once.sobomax2001-02-071-1/+1
| | | | Tested by: knu, sobomax and other #bsdcode'rs
* mdoc(7) police: split punctuation characters + misc fixes.ru2001-02-012-6/+6
|
* Remove _THREAD_SAFE and make libc thread-safe by default bydeischen2001-01-2448-190/+351
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix bugs in the handling of > 8 positional arguments:archie2001-01-061-14/+18
| | | | | | | | - 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
* Make it a bit clearer that asprintf doesn't actually "return" a pointer inben2001-01-011-4/+3
| | | | | | | | 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
* Prepare for mdoc(7)NG.ru2000-12-292-67/+67
|
* mdoc(7) police: use canonical form of .Dd macro.ru2000-12-111-1/+1
|
* mdoc(7) police: use the new features of the Nm macro.ru2000-11-201-2/+2
|
* Update the documentation to describe the new mktemp() family behaviour.kris2000-11-191-8/+33
| | | | | | | Also notes that mkstemp() first appeared in 4.4BSD (change obtained from OpenBSD) Reviewed by: sheldonh
* Use Fx macro wherever possible.ru2000-11-141-1/+3
|
* Increase the size of the mktemp() filename space by dropping the PID fromkris2000-11-101-25/+17
| | | | | | | | | | | | | 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>
* Avoid use of direct troff requests in mdoc(7) manual pages.ru2000-11-101-1/+0
|
* Better documentation of append mode. This should have gone in -currenteivind2000-09-221-0/+8
| | | | | | directly. Now also .Xr fseek reference. Prodded by: sheldonh
* According to the susv2 man pages I have, remove(3) should act asdwmalone2000-08-282-7/+26
| | | | | | | | | 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
* Use `Er' variable to define first column width in ERRORS section.phantom2000-05-068-8/+8
|
* Introduce ".Lb" macro to libc manpages.phantom2000-04-2120-0/+40
| | | | More libraries manpages updates following.
* Fix typo, reported by George Cox.asmodai2000-04-121-8/+8
| | | | | | Fix hard sentence breaks. Submitted by: George Cox <gjvc@sophos.com>
* Remove more single-space hard sentence breaks.sheldonh2000-03-021-1/+2
|
* Remove single-space hard sentence breaks. These degrade the qualitysheldonh2000-03-024-7/+14
| | | | | of the typeset output, tend to make diffs harder to read and provide bad examples for new-comers to mdoc.
* Simplify sytem call renaming. Instead of _foo() <-- _libc_foo <-- foo(),jasone2000-01-277-11/+11
| | | | | | | | | | | | | | | | | 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
* Improve the explanation on the (in)security of mktemp(3).sheldonh2000-01-251-3/+6
|
* We no longer care about the VAX and Tahoe compilers :-)kris2000-01-171-6/+1
|
* Add three-tier symbol naming in support of POSIX thread cancellationjasone2000-01-127-11/+17
| | | | | | 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().
* Correct discrepancy between definition of argument to tempnam() andkris2000-01-091-2/+2
| | | | the name by which it is referenced in the text.
* While comparing this with OpenBSD (ie: trying to figure out what mkstemps()peter1999-12-111-2/+2
| | | | | | | | 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.
* Make __sfp() even more thread-safe.dt1999-11-211-1/+1
|
* Add (FILE *) locking.dt1999-11-201-0/+9
|
* Make __sfp() (FILE allocator) thread-safe: added locking like in malloc().dt1999-11-201-0/+11
|
* Fix HISTORY - the copyright header on the file of the GCC version wasobrien1999-11-201-4/+4
| | | | | | misleading. Submitted by: Theo de Raadt <deraadt@cvs.openbsd.org>
* Add to the HISTORY.obrien1999-11-191-1/+9
|
* Add unsigned char cast to isdigitache1999-11-041-1/+1
|
* Remove UNSAFE_WARN ifdef for mktemp warning (never defined)ache1999-10-243-6/+6
| | | | Use _mktemp internally
* $Id$ -> $FreeBSD$peter1999-08-2879-79/+79
|
* Add warnings, ala mktemp, to tempnam and tmpnam as a reminder thatimp1999-08-212-3/+13
| | | | | | these are inherently unsafe interfaces. Do not allow TMPDIR to override path for setuid/setgid programs.
* Treat an attempt to read from a write-only stream more consistently.rnordier1999-08-101-1/+2
| | | | | Submitted by: Anton Berezin <tobez@plab.ku.dk> PR : 12852
* Fixed missing "G" in the list item for the main description of %g andbde1999-08-081-2/+2
| | | | %G formats.
* asprintf() does use realloc() internally, but saying so in the manpage can behoek1999-07-251-4/+2
| | | | | 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).
* Add $Id$, to make it simpler for members of the translation teams tonik1999-07-1219-0/+19
| | | | | | | | | | | | | | | | | 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
* Add a note that when a stream opened via fdopen() is closed via fclose(),archie1999-05-171-0/+4
| | | | | the underlying file descriptor is also closed. To me at least this wasn't immediately obvious.
OpenPOWER on IntegriCloud