summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio
Commit message (Collapse)AuthorAgeFilesLines
* MAN[1-9] -> MAN.ru2001-03-271-1/+1
|
* Fix style nit.obrien2001-03-051-1/+1
|
* Fix style breakage.obrien2001-03-051-0/+1
|
* Hide the definition of struct __sFILEX and add the neededdeischen2001-03-012-81/+33
| | | | | | | lock definitions to it. flockfile state is now allocated along with the rest of FILE. This eliminates the need for a separate allocation of flockfile state as well as eliminating the mutex/lock used to serialize its allocation.
* .St -ansiC -> .St -isoCru2001-02-2618-22/+22
|
* Correctly handle the race itself, too (don't leave it locked).green2001-02-231-0/+1
| | | | | | This is about to be replaced anyway by initialization explicitly instead of lazily, and reducing the complexity of it. As it is now, this will work fine, however.
* Use the right names to call pthread_mutex_{,un}lock so that thingsgreen2001-02-231-2/+2
| | | | work in both the libc only and libc/libc_r case.
* Fix the problems I (and others, undoubtedly) have been having for agreen2001-02-231-3/+12
| | | | | | | | | | | | | | | | | | | | | | while with threaded software in -CURRENT acting very "weird". It has seemed, for example, in Mozilla that threads attempting to do host lookups have been locking up. That's exactly the case. There was a race condition in the implementation of the initialization of the mutex used to protect FILE operations, first of all: multiple instances of FLOCKFILE() in libc could occur on the same FILE at the same time and cause strange behavior by overwriting eachothers' creation of the mutex and the rest of the file lock. Secondly, it's not appropriate to test the "validity" of the file descriptor referenced by the FILE; if the code is calling FLOCKFILE() or FUNLOCKFILE(), it wants the FILE to be locked or unlocked, not to be locked or unlocked on the condition that _file is >= 0. This also could quite easily cause leaks by failing to perform the lock or unlock operation when it actually is needed. Mozilla now works again on -CURRENT when linked to libc_r.so.5 and libc.so.5.
* Place some hooks (__stdin, __stdout, __stderr) into libc for a futurepeter2001-02-201-0/+23
| | | | | | | | | | | ABI change. There is some serious evilness here to work around some gcc weaknesses. We need to know the sizeof(FILE) manually until __sF goes away in the next major bump. We have the size for Alpha and i386, missing is ia64, ppc and sparc* (and i386 with 64 bit longs). At some point down the track we can change the stdin etc #defines to stop hard coding the size of FILE into application binaries. Lots of head scratching and ideas and testing by: green, imp
* Extra needs to be initialized for our usual pool of FILEs. This wasimp2001-02-161-3/+14
| | | | | | | | causing some versions of as to dump core. This survived make buildworld/installworld and the building gettext port afterwards. Submitted by: <nnd@mail.nsk.ru> "N.Dudorov" Reviewed by: "Daniel M. Eischen" <eischen@vigrid.com>
* Fix the current libc breakage in current:imp2001-02-165-17/+38
| | | | | | | | | | | | | o Back out the __std* stuff. Can't figure out how to do this right now, so we'll save it for late. o use _up as a pointer for extra fields that we need to access. o back out the libc major version bump. Submitted by: green reviewed by: peter, imp, green, obrien (to varying degrees). We'll fix the "how do we stop encoding sizeof(FILE) in binaries" part later.
* Remove freelists managed by Balloc/Bfree.tegge2001-02-151-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 Reviewed by: deischen
* 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
|
OpenPOWER on IntegriCloud