summaryrefslogtreecommitdiffstats
path: root/include/stdio.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove outdated comments.tjr2004-06-201-3/+1
|
* Bring back the macro versions of getwc(), getwchar(), putwc() andtjr2004-05-271-0/+3
| | | | | putwchar(), but this time avoid redundantly declaring __stdinp and __stdoutp when source files include both <stdio.h> and <wchar.h>.
* Parenthesize function names in masking macros for getc() etc. for thetjr2004-03-201-6/+6
| | | | benefit of obsolete C preprocessors.
* Re-add macro versions of getc(), getchar(), putc(), putchar(), feof(),tjr2004-03-171-0/+16
| | | | | | | ferror(), fileno() and clearerr(), using the value of __isthreaded to decide between the fast inline single-threaded code and the more general function equivalent. This gives most of the performance benefits of the old unsafe macros while preserving thread safety.
* Change the definition of NULL on ia64 (for LP64 compilations) frommarcel2003-12-071-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | an int constant to a long constant. This change improves consistency in the following two ways: 1. The first 8 arguments are always passed in registers on ia64, which by virtue of the generated code implicitly widens ints to longs and allows the use of an 32-bit integral type for 64-bit arguments. Subsequent arguments are passed onto the memory stack, which does not exhibit the same behaviour and consequently do not allow this. In practice this means that variadic functions taking pointers and given NULL (without cast) work as long as the NULL is passed in one of the first 8 arguments. A SIGSEGV is more likely the result if such would be done for stack-based arguments. This is due to the fact that the upper 4 bytes remain undefined. 2. All 64-bit platforms that FreeBSD supports, with the obvious exception of ia64, allow 32-bit integral types (specifically NULL) when 64-bit pointers are expected in variadic functions by way of how the compiler generates code. As such, code that works correctly (whether rightfully so or not) on any platform other than ia64, may fail on ia64. To more easily allow tweaking of the definition of NULL, this commit removes the 12 definitions in the various headers and puts it in a new header that can be included whenever NULL is to be made visible. This commit fixes GNOME, emacs, xemacs and a whole bunch of ports that I don't particularly care about at this time...
* Add prototypes for the non-standard _unlocked functions.tjr2003-01-131-0/+6
|
* Use a weak reference instead of a macro to make vfscanf an aliastjr2002-10-141-11/+2
| | | | for __vfscanf.
* Add restrict type-qualifier.mike2002-10-121-16/+12
|
* Zap the early-adopter transition aid before we get into seriouspeter2002-10-111-8/+0
| | | | | 5.0-R territory, as threatened. This only affects antique 5.0 systems that have not had a 'make world' done for well over a year.
* o Move location of the fpos_t typedef to be closer to other typedefs.mike2002-10-061-14/+33
| | | | | | | | | | o Add typedef for va_list. o Add comment about missing restrict type-qualifiers. o Move vscanf(), vsscanf() and vfscanf() to the C99-visible block. o Add note about missing backing function for vfscanf(). o Restrict L_cuserid to only older versions of POSIX, and BSD namespaces. o Conditionalize some BSD-specific foo_unlock() macros.
* Style: One space between "restrict" qualifier and "*".tjr2002-09-061-10/+10
|
* o Merge <machine/ansi.h> and <machine/types.h> into a new headermike2002-08-211-20/+20
| | | | | | | | | | | | | | | | | | | | | called <machine/_types.h>. o <machine/ansi.h> will continue to live so it can define MD clock macros, which are only MD because of gratuitous differences between architectures. o Change all headers to make use of this. This mainly involves changing: #ifdef _BSD_FOO_T_ typedef _BSD_FOO_T_ foo_t; #undef _BSD_FOO_T_ #endif to: #ifndef _FOO_T_DECLARED typedef __foo_t foo_t; #define _FOO_T_DECLARED #endif Concept by: bde Reviewed by: jake, obrien
* - For compliance with IEEE Std 1003.1-2001, add the 'restrict'robert2002-08-151-6/+9
| | | | | | qualifier to function prototypes and definitions where appropriate using the '__restrict' macro. - Update the manual page.
* - Introduce the 'restrict' qualifier to function prototypes androbert2002-08-151-4/+4
| | | | | definitions to comply with IEEE Std 1003.1-2001. - Update the manual pages.
* - Add the 'restrict' qualifier to the function definitions androbert2002-08-141-2/+2
| | | | | | | | public prototypes of setbuf(3) and setvbuf(3) using the '__restrict' macro from <sys/cdefs.h> to be compliant with IEEE Std 1003.1-2001. - Replace the K&R with ANSI-C function definitions. - Bring the manual page up-to-date.
* Clean up some of the rather strange structure and ordering of thiswollman2002-07-151-52/+67
| | | | | | | | file. Correct visibility conditions and order blocks of declarations in order of increasing inclusiveness. Note that [v]snprintf() is now in ISO C and f{seek,tell}o() are now in POSIX. Deprecated getw() and putw() are no longer visible in XSH6 namespace (and should probably be removed from BSD namespace as well).
* Breath deep and take __P out of the system include files.imp2002-03-231-80/+80
| | | | | | # This appears to not break X11, but I'm having problems compiling the # glide part of the server with or without this patch, so I can't tell # for sure.
* An extra #ifdef crept in with rev 1.38.obrien2001-12-051-1/+0
|
* Turn back on fmtcheck's attribute checks, guarded for non-GCC compilers.obrien2001-12-041-1/+7
| | | | Submitted by: bde
* Remove the GCC'ism "__attribute__" from the 'fmtcheck' prototype.obrien2001-12-041-2/+1
| | | | I leave it up to someone else to fix this breakage properly.
* Now that the compat4x libc.so.4 binary has been updated, we can finallypeter2001-09-201-1/+1
| | | | | | | | switch over to using a future-proof stdin/out/err. Note that if you run 4.x binaries on your system, you will certainly want to update /usr/lib/compat/libc.so.4. The easiest way is to add "COMPAT4X= yes" in your /etc/make.conf.
* Rip out the old __stdin/out/err stuff. It was completely 100% useless. :-(peter2001-08-131-0/+10
| | | | | | | | | | | | | | | | 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()).
* Style(9) fixes:obrien2001-04-221-4/+4
| | | | | | | * get rid of space (0x20) before tab (^I) * indent with ^I, not 0x20 * continuation line for prototypes is for 0x20's past function's name col. * etc.
* I think this was supposed to be __const like in NetBSD: I have no ideakris2001-04-171-1/+1
| | | | | | why I changed it to const. Noticed by: David Wolfskill <david@catwhisker.org>
* Add fmtcheck(), a function for checking consistency of format stringkris2001-04-171-0/+2
| | | | | | | | | | | | | | | | | arguments where the format string is obtained from user data, or otherwise difficult to verify statically. Example usage: printf(fmtcheck(user_format, standard_format), arg1, arg2); checks the format string user_format for consistency (same number/order/ type of format operators) with standard_format. If they differ, standard_format is used instead to avoid potential crashes or security violations. Obtained from: NetBSD Reviewed by: -arch
* Hide the definition of struct __sFILEX and add the neededdeischen2001-03-011-6/+1
| | | | | | | 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.
* Fix the current libc breakage in current:imp2001-02-161-8/+11
| | | | | | | | | | | | | 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-4/+6
| | | | | | | | | | | | | | | | 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-6/+3
| | | | | FILE *buffer = stdout; so back it out for now.
* Take advantage of the current libc sizeof(FILE) breakage (__sF[]) andpeter2001-02-121-3/+6
| | | | | | | | | | 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-0/+4
| | | | Add a lock to FILE and define an additional flag.
* Add a lock to DIR to make telldir and friends MT-safe.deischen2001-01-241-54/+4
| | | | | | | Clean up stdio.h a bit and remove _THREAD_SAFE. Some of the usual macros getc, putc, getchar, putchar are no longer macros. Approved by: -arch
* Fixed missing declaration of ctermid_r(3).bde1999-12-231-0/+1
|
* $Id$ -> $FreeBSD$peter1999-08-271-1/+1
|
* Added functions fseeko() and ftello() (from susv2).dt1999-02-081-1/+3
| | | | | | | Fixed fgetpos() and fsetpos() for offsets > 2GB. PR: 8637 Submitted by: Dan Nelson <dnelson@emsphone.com> (adjusted by me a little)
* Make this protototype of mmap return void *, like two other copies.dt1998-12-141-2/+2
|
* Added macros __printflike() and __scanflike() to <sys/cdefs.h>.bde1998-07-131-7/+10
| | | | | | | | Use them to `make gcc -Wformat' check formats for all printf-like and scanf-like functions in /usr/src except for the err()/warn() family. err() isn't quite printf-like since its format arg can legitimately be NULL. syslog() isn't quite printf-like, but gcc already accepts %m, even for plain printf() when it shouldn't.
* New flag for internal stdio use to enable dynamic string allocation forpeter1998-07-081-1/+2
| | | | | | asprintf() implementation. Obtained from: Todd Miller <Todd.Miller@courtesan.com> via OpenBSD
* Complete the switch to using gcc-2.4 features to declare fpos_t ,bde1998-06-141-18/+1
| | | | | | | | | | as threatened in the 4-5 year old comment. Most of the change is in <machine/ansi.h>; this commit just removes cruft for the strict ANSI case. 64-bit types couldn't actually be defined using __attribute__(()) in gcc-2.4, since attribute names in the implementation namespace only became available in gcc-2.7. I've probably just broken gcc-2.6 support by using the gcc-2.7 names unconditionally.
* I have a long list of issues to address here, mostly related tojb1998-05-051-6/+4
| | | | | | namespace and revision levels of ANSI and POSIX. This change only removes the leading underscrore from the FILE locking functions that POSIX defines.
* Format changes in an attempt to address some of Bruce's commentsjb1998-04-121-18/+26
| | | | | | | | about spaces and tabs. The externs in the static inline functions remain 'cause (a) they're required; and (b) I can't find any gcc -W* cases where they generate warnings.
* Add *_unlocked() macros according to POSIX. In the _THREAD_SAFE case,jb1998-04-111-9/+59
| | | | | | | | test for __isthreaded before calling the lock/unlock functions to try to save some performance. The _THREAD_SAFE case should become the default, but since it tests for a global variable in libc, people won't be able to build -current on pre-3.0 systems unless the default leaves it out. Such is life.
* Added missing caddr_t --> void * conversions for sys/mman.h functions.alex1998-01-011-2/+2
| | | | Submitted by: bde
* Removed nonstandard #include of <sys/types.h>.bde1997-04-131-8/+29
| | | | | | | Use _BSD_OFF_T_ instead of off_t so that we're still self-sufficent. Copied the ftruncate/lseek()/mmap()/truncate() redeclaration hacks from <sys/types.h> so that things depending on them don't break.
* Merge Lite2 changespeter1997-03-111-2/+2
| | | | (Just version number)
* increase L_cuserid because UT_NAMESIZE increasedache1997-03-021-2/+2
|
* Revert $FreeBSD$ to $Id$peter1997-02-231-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.
* improve comments for UT_NAMESIZEwosch1996-10-271-2/+5
|
* remove zopen, zopen is not part of libc.wosch1996-07-021-1/+0
|
OpenPOWER on IntegriCloud