summaryrefslogtreecommitdiff
path: root/include/stdio.h
Commit message (Collapse)AuthorAgeFilesLines
* libc: provide fputc_unlockedKyle Evans2020-02-021-0/+1
| | | | | | | | | | | | | | Among the same justification as the other stdio _unlocked; in addition to an inline version in <stdio.h>, we must provide a function in libc as well for the functionality. This fixes the lang/gcc* builds, which want to use the symbol from libc. PR: 243810 Reported by: antoine, swills, Michael <michael.adm gmail com> X-MFC-With: r357284 Notes: svn path=/head/; revision=357419
* stdio: provide _unlocked variants of fflush, fputc, fputs, fread, fwriteKyle Evans2020-01-301-1/+7
| | | | | | | | | | | | | | | | fflush_unlocked is currently desired in ports by sysutils/metalog, and redefined as the locked fflush. fputc_unlocked, fputs_unlocked, fread_unlocked, and fwrite_unlocked are currently desired in ports by devel/elfutils, and redefined as the locked fputs, fread, and fwrite respectively. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D23336 Notes: svn path=/head/; revision=357284
* Make snprintf(3) and vscanf(3) definitions available under appropriateKonstantin Belousov2019-09-091-3/+5
| | | | | | | | | | | | POSIX visibility. Reported by: jbeich Reviewed by: jilles PR: 207287 MFC after: 1 week Notes: svn path=/head/; revision=352056
* libc: remove getsEd Maste2019-09-011-1/+0
| | | | | | | | | | | | | | | | | | | | gets is unsafe and shouldn't be used (for many years now). Leave it in the existing symbol version so anything that previously linked aginst it still runs, but do not allow new software to link against it. (The compatability/legacy implementation must not be static so that the symbol and in particular the compat sym gets@FBSD_1.0 make it into libc.) PR: 222796 (exp-run) Reported by: Paul Vixie Reviewed by: allanjude, cy, eadler, gnn, jhb, kib, ngie (some earlier) Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D12298 Notes: svn path=/head/; revision=351659
* Remove redundant check.Cy Schubert2018-04-031-1/+1
| | | | | | | | | | Reported by: kib@ MFC after: 2 weeks X-MFC with: r331936 Differential Revision: https://reviews.freebsd.org/D12785 Notes: svn path=/head/; revision=331948
* Include update to stdio.h missed in r331936.Cy Schubert2018-04-031-0/+8
| | | | | | | | | | | | | | In my attempt to limit the commit in r331936 to only the gets_s() commit and not include unrelated patches in my tree, this patch was missed. Reported by: pfg MFC after: 2 weeks X-MFC with: r331936 Differential Revision: https://reviews.freebsd.org/D12785 Notes: svn path=/head/; revision=331943
* include: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326024
* libthr: fix warnings from GCC when WARNS=6Eric van Gyzen2017-05-231-0/+3
| | | | | | | | | | | | | | | | | | | Fix warnings about: - redundant declarations - a local variable shadowing a global function (dlinfo) - an old-style function definition (with an empty parameter list) - a variable that is possibly used uninitialized "make tinderbox" passes this time, except for a few unrelated kernel failures. Reviewed by: kib MFC after: 3 days Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D10870 Notes: svn path=/head/; revision=318749
* <stdio.h>: ftello() and fseeko() were in SUSv2, so extend visibility.Pedro F. Giffuni2017-04-291-1/+1
| | | | | | | | | | | | See: http://pubs.opengroup.org/onlinepubs/007908799/xsh/fseek.html http://pubs.opengroup.org/onlinepubs/007908799/xsh/ftell.html Hinted from: DragonFlyBSD (git 58696e28) Notes: svn path=/head/; revision=317595
* Make use of clang nullability attributes.Pedro F. Giffuni2017-01-281-8/+12
| | | | | | | | | | | | | | | | | | Replace uses of the GCC __nonnull__ attribute with the clang nullability qualifiers. The replacement should be transparent for clang developers as the new qualifiers will produce the same warnings and will be useful for static checkers but will not cause aggressive optimizations. GCC will not produce such warnings and developers will have to use upgraded GCC ports built with the system headers from r312538. Hinted by: Apple's Libc-1158.20.4, Bionic libc MFC after: 11.1 Release Differential Revision: https://reviews.freebsd.org/D9004 Notes: svn path=/head/; revision=312934
* Add the __printflike attribute to the declaration of vdprintf(3)Eric van Gyzen2016-10-011-1/+1
| | | | | | | | | | I intended to add this in r306568. MFC after: 3 days Sponsored by: Dell EMC Notes: svn path=/head/; revision=306569
* Add the __printflike attribute to the declaration of dprintf(3)Eric van Gyzen2016-10-011-1/+1
| | | | | | | | MFC after: 3 days Sponsored by: Dell EMC Notes: svn path=/head/; revision=306568
* tools/build looks for _WITH_GETLINE in /usr/include/stdio.h to see ifWarner Losh2016-08-021-0/+1
| | | | | | | | | | we need to include it in -legacy or not. Since the ifdef was removed, this broke building 10.x and older source trees on -current. Restore just enough of _WITH_GETLINE to allow these older source trees to still build and properly omit getline() from their -legacy library. Notes: svn path=/head/; revision=303683
* Remove _WITH_GETLINE and _WITH_DPRINTF guardsBaptiste Daroussin2016-07-301-37/+1
| | | | | | | | | | | | | When adding getline(3) and dprintf(3) into libc, those guards were added to prevent breaking too many ports. 7 years later the ports tree have been fixed, it is time to remove this FreeBSDism While here remove the extra parenthesis surrounding dprintf(3) Notes: svn path=/head/; revision=303524
* stdio.h: Fix function-type typedef style and use _types.h __ssize_tConrad Meyer2016-05-121-4/+4
| | | | | | | | | | | | | | | I'm still not sure why only Pypy runs into the error with the function typedefs. Fix it anyway. Use __ssize_t instead of ssize_t for the types; it's possible for the size_t type to not be visible if at the wrong POSIX_VISIBLE level. A final (crossing my fingers) follow-up to r299456. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=299574
* Pollute more places with off64_t and add __off64_tConrad Meyer2016-05-121-1/+1
| | | | | | | | | | | | | | Despite the private namespace, several broken ports depend on the __off64_t name for the type. Export it exactly the same way off_t and __off_t are exported. A follow-up to r299456. Suggested by: php56 Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=299571
* libc: Add fopencookie(3) wrapper around funopen(3)Conrad Meyer2016-05-111-0/+17
| | | | | | | | | Reviewed by: jhb, oshogbo Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D6282 Notes: svn path=/head/; revision=299456
* Add _flags2 per jhb@ suggestion since no room left in _flags.Andrey A. Chernov2015-10-281-0/+3
| | | | | | | | | Rewrite O_APPEND flag checking using new __S2OAP flag. MFC after: 3 weeks Notes: svn path=/head/; revision=290110
* Add fdclose(3) function.Mariusz Zaborski2015-07-041-0/+1
| | | | | | | | | | | | | This function is equivalent to fclose(3) function except that it does not close the underlying file descriptor. fdclose(3) is step forward to make FILE structure private. Reviewed by: wblock, jilles, jhb, pjd Approved by: pjd (mentor) Differential Revision: https://reviews.freebsd.org/D2697 Notes: svn path=/head/; revision=285140
* Correct and clarify comment for __SMBF.Bryan Drewery2015-02-111-1/+1
| | | | | | | | MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=278600
* include: Don't expose L_cuserid in strict C standard compliance mode.Jilles Tjoelker2014-05-111-1/+1
| | | | | | | | L_cuserid is supposed to be exposed only for old POSIX, or in the default (expose everything) environment. Notes: svn path=/head/; revision=265881
* include: Remove checks for __BSD_VISIBLE where redundant with __XSI_VISIBLEJilles Tjoelker2014-05-111-4/+4
| | | | | | | | | | | | or __POSIX_VISIBLE. Whenever <sys/cdefs.h> sets __BSD_VISIBLE to non-zero, it also sets __POSIX_VISIBLE and __XSI_VISIBLE to the newest version supported. No functional change is intended. Notes: svn path=/head/; revision=265878
* Add an implementation of open_memstream() and open_wmemstream(). TheseJohn Baldwin2013-02-271-0/+1
| | | | | | | | | | | | routines provide write-only stdio FILE objects that store their data in a dynamically allocated buffer. They are a string builder interface somewhat akin to a completely dynamic sbuf. Reviewed by: bde, jilles (earlier versions) MFC after: 1 month Notes: svn path=/head/; revision=247411
* Add fmemopen(3), an interface to get a FILE * from a buffer in memory, alongPietro Cerutti2013-01-301-0/+1
| | | | | | | | | | | with the respective regression test. See http://pubs.opengroup.org/onlinepubs/9699919799/functions/fmemopen.html Reviewed by: cognet Approved by: cognet Notes: svn path=/head/; revision=246120
* Correctly expose xlocale functions if people include the headers in the wrongDavid Chisnall2012-03-281-0/+3
| | | | | | | | | order (as some ports apparently do). Approved by: dim (mentor) Notes: svn path=/head/; revision=233600
* In POSIX.1-2008:Xin LI2011-12-281-1/+1
| | | | | | | | | | | | | P_tmpdir [OB XSI] Default directory prefix for tempnam(). This macro is used in a lot of places in legacy applications, and is why we see a lot of programs written for e.g. Linux store volatile temporary files in /var/tmp and not /tmp. MFC after: 2 months Notes: svn path=/head/; revision=228924
* Restore __is_threaded in C++ mode. Some Google stuff needs it apparently.David Chisnall2011-12-251-1/+3
| | | | | | | | Reported by: swills Approved by: dim (mentor) Notes: svn path=/head/; revision=228875
* Replace __const by const in all non-contributed source code.Ed Schouten2011-12-131-2/+2
| | | | | | | | | As C1X is close to being released, there is no need to wrap around a feature that is already part of C90. Most of these files already use `const' in different placed as well. Notes: svn path=/head/; revision=228468
* The spec says that FILE must be defined in wchar.h, but it wasn't. ItDavid Chisnall2011-11-131-3/+8
| | | | | | | | | | is now. Also hide some macros in C++ mode that will break C++ namespaced calls. Approved by: dim (mentor) Notes: svn path=/head/; revision=227487
* Remove stale reference to UT_NAMESIZE from <stdio.h>.Ed Schouten2010-08-061-2/+1
| | | | | | | Spotted by: bde@ Notes: svn path=/head/; revision=210957
* Remove the Berkeley clause 3's.Warner Losh2010-02-161-5/+1
| | | | | | | Add a few $FreeBSD$ Notes: svn path=/head/; revision=203964
* Merge fmtcheck() prototype change.Xin LI2009-06-231-1/+1
| | | | | | | Obtained from: NetBSD Notes: svn path=/head/; revision=194801
* Make programs that define a macro called `dprintf' more likely to work.David Schultz2009-03-251-1/+1
| | | | Notes: svn path=/head/; revision=190409
* Namespace: dprintf() and getline() are in P1003.1-2008.David Schultz2009-03-141-2/+2
| | | | Notes: svn path=/head/; revision=189818
* Add dprintf() and vdprintf() from POSIX.1-2008. Like getline(),David Schultz2009-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. Notes: svn path=/head/; revision=189356
* Add renameat to the POSIX.1-2008 namespace.David Schultz2009-03-041-1/+1
| | | | Notes: svn path=/head/; revision=189355
* - Add getdelim(), getline(), stpncpy(), strnlen(), wcsnlen(),David Schultz2009-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@ Notes: svn path=/head/; revision=189136
* Tag FILE's _bf as being part of the public ABI as well due to the in-treeJohn Baldwin2008-05-071-1/+1
| | | | | | | sort(1) referencing it. Notes: svn path=/head/; revision=178829
* Retire the __fgetcookie(), __fgetpendout(), and __fsetfileno() accessorsJohn Baldwin2008-05-051-6/+0
| | | | | | | as we aren't hiding FILE's internals anymore. Notes: svn path=/head/; revision=178782
* Note that FILE's __cookie is also part of the public ABI.John Baldwin2008-05-051-1/+1
| | | | Notes: svn path=/head/; revision=178779
* Expose FILE's internals to the world again in all their glory. RestoreJohn Baldwin2008-05-051-4/+172
| | | | | | | | all the previous inline optimizations as well. FILE is back to using __mbstate_t, struct pthread *, and struct pthread_mutex *. Notes: svn path=/head/; revision=178778
* Unbreak build: gnu sort has been configured to grope inside structMarcel Moolenaar2008-05-031-0/+3
| | | | | | | | | | __sFILE. It's opaque now, so add a function that returns the pending output bytes. Pointy hat: jhb Notes: svn path=/head/; revision=178755
* Unbreak build: libftpio gropes inside struct __sFILE. ImplementMarcel Moolenaar2008-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 Notes: svn path=/head/; revision=178747
* Axe now-empty __BSD_VISIBLE block that held renameat().John Baldwin2008-05-021-2/+0
| | | | | | | | Reported by: kib Pointy hat: jhb Notes: svn path=/head/; revision=178723
* - Move declaration of renameat() to the existing section of BSD_VISIBLEJohn Baldwin2008-05-021-6/+6
| | | | | | | | | | function prototypes. - Fix a few whitespace inconsistencies in prototypes. MFC after: 1 month Notes: svn path=/head/; revision=178722
* Next round of stdio changes: Remove all inlining of stdio operations andJohn Baldwin2008-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 Notes: svn path=/head/; revision=178721
* Next stage of stdio cleanup: Retire __sFILEX and merge the fields back intoJohn Baldwin2008-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 Notes: svn path=/head/; revision=178287
* Specifically mark the members of 'FILE' that are accessed via inlineJohn Baldwin2008-04-171-6/+10
| | | | | | | | | functions or macros since they are part of the public ABI as a result. MFC after: 1 month Notes: svn path=/head/; revision=178282
* Add the libc glue and headers definitions for the *at() syscalls.Konstantin Belousov2008-03-311-0/+3
| | | | | | | | | | Based on the submission by rdivacky, sponsored by Google Summer of Code 2007 Reviewed by: rwatson, rdivacky Tested by: pho Notes: svn path=/head/; revision=177791
* Allow an application to define FOPEN_MAX (like we allow for OPEN_MAXJohn Birrell2008-03-261-0/+2
| | | | | | | in sys/syslimits.h). Notes: svn path=/head/; revision=177653