summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/findfp.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix the style of the SCM ID's.obrien2002-03-221-4/+2
| | | | I believe have made all of libc .c's as consistent as possible.
* Remove __P() usage.obrien2002-03-211-1/+1
|
* Rip out the old __stdin/out/err stuff. It was completely 100% useless. :-(peter2001-08-131-15/+6
| | | | | | | | | | | | | | | | It was foiled because of dynamic copy relocations that caused compile-time space to be reserved in .bss and at run time a blob of data was copied to that space and everything used the .bss version.. The problem is that the space is reserved at compile time, not runtime... So we *still* could not change the size of FILE. Sigh. :-( Replace it with something that does actually work and really does let us make 'FILE' extendable. It also happens to be the same as Linux does in glibc, but has the slight cost of a pointer. Note that this is the same cost that 'fp = fopen(), fprintf(fp, ...); fclose(fp);' has. Fortunately, actual references to stdin/out/err are not all that common since we have implicit stdin/out/err-using versions of functions (printf() vs. fprintf()).
* Avoid any chance of being misunderstood as having libelled developerssheldonh2001-07-291-1/+1
| | | | | | | | or developers' vendors without compromising the importance of warning against bad practice. Reported by: mjacob MFC after: 1 week
* 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-161-14/+25
| | | | | | | | | | | | | 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.
* 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-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* 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
* Remove _THREAD_SAFE and make libc thread-safe by default bydeischen2001-01-241-17/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Make __sfp() (FILE allocator) thread-safe: added locking like in malloc().dt1999-11-201-0/+11
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Suggested by: Bruce Evans, Jeffrey Hsu, Gary Palmerjraynard1996-06-221-0/+6
| | | | | | | | | | | | | | | | | | | | | Added $Id$'s to files that were lacking them (gpalmer), made some cosmetic changes to conform to style guidelines (bde) and checked against NetBSD and Lite2 to remove unnecessary divergences (hsu, bde) One last code cleanup:- Removed spurious casts in fseek.c and stdio.c. Added missing function argument in fwalk.c. Added missing header include in flags.c and rget.c. Put in casts where int's were being passed as size_t's. Put in missing prototypes for static functions. Changed second args of __sflags() inflags.c and writehook() in vasprintf.c from char * to const char * to conform to prototypes. This directory now compiles with no warnings with -Wall under gcc-2.6.3 and with considerably less warnings than before with the ultra-pedantic script I used for testing. (Most of the remaining ones are due to const poisoning).
* Minor cleanup, #include's and unused vars.phk1995-10-221-0/+4
| | | | Added compile-time warning to an old funky function.
* BSD 4.4 Lite Lib Sourcesrgrimes1994-05-271-0/+165
OpenPOWER on IntegriCloud