summaryrefslogtreecommitdiffstats
path: root/include/stdio.h
Commit message (Collapse)AuthorAgeFilesLines
* Namespace: dprintf() and getline() are in P1003.1-2008.das2009-03-141-2/+2
|
* Add dprintf() and vdprintf() from POSIX.1-2008. Like getline(),das2009-03-041-4/+20
| | | | | | dprintf() is a simple wrapper around another function, so we may as well implement it. But also like getline(), we can't prototype it by default right now because it would break too many ports.
* Add renameat to the POSIX.1-2008 namespace.das2009-03-041-1/+1
|
* - Add getdelim(), getline(), stpncpy(), strnlen(), wcsnlen(),das2009-02-281-0/+39
| | | | | | | | | | | | wcscasecmp(), and wcsncasecmp(). - Make some previously non-standard extensions visible if POSIX_VISIBLE >= 200809. - Use restrict qualifiers in stpcpy(). - Declare off_t and size_t in stdio.h. - Bump __FreeBSD_version in case the new symbols (particularly getline()) cause issues with ports. Reviewed by: standards@
* Tag FILE's _bf as being part of the public ABI as well due to the in-treejhb2008-05-071-1/+1
| | | | sort(1) referencing it.
* Retire the __fgetcookie(), __fgetpendout(), and __fsetfileno() accessorsjhb2008-05-051-6/+0
| | | | as we aren't hiding FILE's internals anymore.
* Note that FILE's __cookie is also part of the public ABI.jhb2008-05-051-1/+1
|
* Expose FILE's internals to the world again in all their glory. Restorejhb2008-05-051-4/+172
| | | | | all the previous inline optimizations as well. FILE is back to using __mbstate_t, struct pthread *, and struct pthread_mutex *.
* Unbreak build: gnu sort has been configured to grope inside structmarcel2008-05-031-0/+3
| | | | | | | __sFILE. It's opaque now, so add a function that returns the pending output bytes. Pointy hat: jhb
* Unbreak build: libftpio gropes inside struct __sFILE. Implementmarcel2008-05-031-0/+3
| | | | | | | | accessor functions for its benefit now thaat FILE is opaque. I'm sure there's a better way. I leave that for people to work on in a src tree that isn't broken. Pointy hat: jhb
* Axe now-empty __BSD_VISIBLE block that held renameat().jhb2008-05-021-2/+0
| | | | | Reported by: kib Pointy hat: jhb
* - Move declaration of renameat() to the existing section of BSD_VISIBLEjhb2008-05-021-6/+6
| | | | | | | function prototypes. - Fix a few whitespace inconsistencies in prototypes. MFC after: 1 month
* Next round of stdio changes: Remove all inlining of stdio operations andjhb2008-05-021-172/+4
| | | | | | | | | | | | | | | | move the definition of the type backing FILE (struct __sFILE) into an internal header. - Remove macros to inline certain operations from stdio.h. Applications will now always call the functions instead. - Move the various foo_unlocked() functions from unlocked.c into foo.c. This lets some of the inlining macros (e.g. __sfeof()) move into foo.c. - Update a few comments. - struct __sFILE can now go back to using mbstate_t, pthread_t, and pthread_mutex_t instead of knowing about their private, backing types. MFC after: 1 month Reviewed by: kan
* Next stage of stdio cleanup: Retire __sFILEX and merge the fields back intojhb2008-04-171-4/+7
| | | | | | | | | | | | | | | | | | | __sFILE. This was supposed to be done in 6.0. Some notes: - Where possible I restored the various lines to their pre-__sFILEX state. - Retire INITEXTRA() and just initialize the wchar bits (orientation and mbstate) explicitly instead. The various places that used INITEXTRA didn't need the locking fields or _up initialized. (Some places needed _up to exist and not be off the end of a NULL or garbage pointer, but they didn't require it to be initialized to a specific value.) - For now, stdio.h "knows" that pthread_t is a 'struct pthread *' to avoid namespace pollution of including all the pthread types in stdio.h. Once we remove all the inlines and make __sFILE private it can go back to using pthread_t, etc. - This does not remove any of the inlines currently and does not change any of the public ABI of 'FILE'. MFC after: 1 month Reviewed by: peter
* Specifically mark the members of 'FILE' that are accessed via inlinejhb2008-04-171-6/+10
| | | | | | functions or macros since they are part of the public ABI as a result. MFC after: 1 month
* Add the libc glue and headers definitions for the *at() syscalls.kib2008-03-311-0/+3
| | | | | | | Based on the submission by rdivacky, sponsored by Google Summer of Code 2007 Reviewed by: rwatson, rdivacky Tested by: pho
* Allow an application to define FOPEN_MAX (like we allow for OPEN_MAXjb2008-03-261-0/+2
| | | | in sys/syslimits.h).
* - Remove SEEK_DATA and SEEK_HOLE from stdio.h, they don't belong here.pjd2007-04-071-6/+0
| | | | | | | - Only define SEEK_DATA and SEEK_HOLE in sys/unistd.h when neither _POSIX_SOURCE nor _XOPEN_SOURCE is defined. Pointed out by: bde, ache
* Implement SEEK_DATA and SEEK_HOLE extensions to lseek(2) as found inpjd2007-04-051-0/+6
| | | | | | OpenSolaris. For more information please refer to: http://blogs.sun.com/bonwick/entry/seek_hole_and_seek_data
* Add a prototype for fcloseall().deischen2006-04-221-0/+1
|
* Analogous to __printflike and __scanflike, add the macro __format_arg whichstefanf2006-01-261-6/+1
| | | | | | | expands to the GCC format_arg attribute if supported. This fixes a syntax error in <nl_types.h> for compilers/tools not implementing the GCC __attribute__ extensions.
* 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.
OpenPOWER on IntegriCloud