summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/fopen.3
Commit message (Collapse)AuthorAgeFilesLines
* MFH (r291197): markup fixesdes2016-01-261-3/+9
|
* MFC discussed with: jilles, -developersngie2015-01-111-0/+9
| | | | | | | | | | | | | MFC r266971: - Return NULL and set errno to EINVAL if size is 0 (as required by POSIX). Update the manpage to reflect this change. - Always set the current position to the first null-byte when opening in append mode. This makes the implementation compatible with glibc's. Update the test suite. Reported by: pho Approved by: cognet
* mdoc: Remove EOL whitespace.joel2013-02-091-1/+1
|
* - Remove underscores from the internal structure name, as it doesn't collidegahr2013-01-311-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with the user's namespace. - Correct size and position variables type from long to size_t. - Do not set errno to ENOMEM on malloc failure, as malloc already does so. - Implement the concept of "buffer data length", which mandates what SEEK_END refers to and the allowed extent for a read. - Use NULL as read-callback if the buffer is opened in write-only mode. Conversely, use NULL as write-callback when opened in read-only mode. - Implement the handling of the ``b'' character in the mode argument. A binary buffer differs from a text buffer (default mode if ``b'' is omitted) in that NULL bytes are never appended to writes and that the "buffer data length" equals to the size of the buffer. - Remove shall from the man page. Use indicative instead. Also, specify that the ``b'' flag does not conform with POSIX but is supported by glibc. - Update the regression test so that the ``b'' functionality and the "buffer data length" concepts are tested. - Minor style(9) corrections. Suggested by: jilles Reviewed by: cognet Approved by: cognet
* Add fmemopen(3), an interface to get a FILE * from a buffer in memory, alonggahr2013-01-301-5/+38
| | | | | | | | with the respective regression test. See http://pubs.opengroup.org/onlinepubs/9699919799/functions/fmemopen.html Reviewed by: cognet Approved by: cognet
* libc: Allow setting close-on-exec in fopen/freopen/fdopen.jilles2012-11-301-1/+18
| | | | | | | | | | | | | | | | | | | This commit adds a new mode option 'e' that must follow any 'b', '+' and/or 'x' options. C11 is clear about the 'x' needing to follow 'b' and/or '+' and that is what we implement; therefore, require a strict position for 'e' as well. For freopen() with a non-NULL path argument and fopen(), the close-on-exec flag is set iff the 'e' mode option is specified. For freopen() with a NULL path argument and fdopen(), the close-on-exec flag is turned on if the 'e' mode option is specified and remains unchanged otherwise. Although the same behaviour for fopen() can be obtained by open(O_CLOEXEC) and fdopen(), this needlessly complicates the calling code. Apart from the ordering requirement, the new option matches glibc. PR: kern/169320
* fopen(3): Mention that the "x" mode option is from C11.jilles2012-11-011-1/+5
| | | | MFC after: 1 week
* Add support for the 'x' mode option in fopen() as specified in the C1Xdas2011-10-211-47/+39
| | | | | | draft standard. The option is equivalent to O_EXCL. MFC after: 1 month
* mdoc: fix parenthesisuqs2010-05-111-2/+2
| | | | Reviewed by: brueffer
* Make the description of `b' a little better.ed2009-09-091-1/+1
| | | | | | | If you have a one-byte sequence, `w', `b' is the second character. Not the third. Submitted by: Christoph Mallon
* Per Regents of the University of Calfornia letter, remove advertisingimp2007-01-091-4/+0
| | | | | | clause. # If I've done so improperly on a file, please let me know.
* The correct description for mode "w" isdes2005-05-041-1/+1
| | | | | | | | (((truncate to zero length) or (create)) (text file)) (for writing) and not ((truncate file to zero length) or (create text file)) (for writing) MFC after: 1 week
* Initial implementation of the C99 feature whereby calling freopen() withtjr2003-01-261-1/+36
| | | | | | | | | | a NULL filename argument allows a stream's mode to be changed. At the moment it just recycles the old file descriptor instead of storing the filename somewhere and using that to reopen the file, as the standard seems to require. Strictly conforming C99 applications probably can't tell the difference but POSIX ones can. PR: 46791
* mdoc(7) police: "The .Fa argument.".ru2002-12-191-3/+3
|
* Consistently mark std(in|out|err) with .Dv, because that's how theyru2002-12-041-3/+2
| | | | | | | are marked up in stdio(3), and because they are defined expressions of type "FILE *". Approved by: re
* Add restrict type-qualifier.mike2002-10-121-1/+1
|
* mdoc(7) police: sort xrefs.ru2001-11-201-2/+2
|
* Cross-reference the fdopen and fileno manpages.murray2001-11-141-1/+2
| | | | | PR: docs/31866 Submitted by: W. Campbell <wcampbel@botbay.net>
* mdoc(7) police: Use the new .In macro for #include statements.ru2001-10-011-1/+1
|
* .St -ansiC -> .St -isoCru2001-02-261-2/+2
|
* Better documentation of append mode. This should have gone in -currenteivind2000-09-221-0/+8
| | | | | | directly. Now also .Xr fseek reference. Prodded by: sheldonh
* Use `Er' variable to define first column width in ERRORS section.phantom2000-05-061-1/+1
|
* Introduce ".Lb" macro to libc manpages.phantom2000-04-211-0/+2
| | | | More libraries manpages updates following.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Add $Id$, to make it simpler for members of the translation teams tonik1999-07-121-0/+1
| | | | | | | | | | | | | | | | | track. The $Id$ line is normally at the bottom of the main comment block in the man page, separated from the rest of the manpage by an empty comment, like so; .\" $Id$ .\" If the immediately preceding comment is a @(#) format ID marker than the the $Id$ will line up underneath it with no intervening blank lines. Otherwise, an additional blank line is inserted. Approved by: bde
* Add a note that when a stream opened via fdopen() is closed via fclose(),archie1999-05-171-0/+4
| | | | | the underlying file descriptor is also closed. To me at least this wasn't immediately obvious.
* Fixed #include and/or prototype bugs in synopsis.bde1997-04-131-3/+3
|
* The w+ entry description was misformatted.mpp1997-03-271-1/+1
| | | | Pointed out by: bde
* Added missing section numbers to a bunch of .Xr macros, ormpp1996-03-271-1/+1
| | | | | converted them into .Fn macros where appropriate. Also fixed up some minor formatting problems.
* BSD 4.4 Lite Lib Sourcesrgrimes1994-05-271-0/+237
OpenPOWER on IntegriCloud