<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib/libc/stdio/fdopen.c, branch release/13.2.0</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=release%2F13.2.0</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=release%2F13.2.0'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2017-11-20T19:49:47Z</updated>
<entry>
<title>General further adoption of SPDX licensing ID tags.</title>
<updated>2017-11-20T19:49:47Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2017-11-20T19:49:47Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=8a16b7a18f5d0b031f09832fd7752fba717e2a97'/>
<id>urn:sha1:8a16b7a18f5d0b031f09832fd7752fba717e2a97</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>Add _flags2 per jhb@ suggestion since no room left in _flags.</title>
<updated>2015-10-28T14:40:02Z</updated>
<author>
<name>Andrey A. Chernov</name>
<email>ache@FreeBSD.org</email>
</author>
<published>2015-10-28T14:40:02Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=8b63538d89ef0b1b1d38532c6ff15b4f0676d7d5'/>
<id>urn:sha1:8b63538d89ef0b1b1d38532c6ff15b4f0676d7d5</id>
<content type='text'>
Rewrite O_APPEND flag checking using new __S2OAP flag.

MFC after:      3 weeks
</content>
</entry>
<entry>
<title>Since no room left in the _flags, reuse __SALC for O_APPEND.</title>
<updated>2015-10-24T02:23:15Z</updated>
<author>
<name>Andrey A. Chernov</name>
<email>ache@FreeBSD.org</email>
</author>
<published>2015-10-24T02:23:15Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b956b176968d47ea25d84997eea446f01da67795'/>
<id>urn:sha1:b956b176968d47ea25d84997eea446f01da67795</id>
<content type='text'>
It helps to remove _fcntl() call from _ftello() and optimize seek position
calculation in _swrite().

MFC after:      3 weeks
</content>
</entry>
<entry>
<title>libc/stdio: Fail fdopen() on an execute-only fd.</title>
<updated>2014-04-21T17:40:23Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2014-04-21T17:40:23Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=93a65e1b5fc5677e3bd8473fb04b793e43d72643'/>
<id>urn:sha1:93a65e1b5fc5677e3bd8473fb04b793e43d72643</id>
<content type='text'>
An execute-only fd (opened with O_EXEC) allows neither read() nor write()
and is therefore incompatible with all stdio modes. Therefore, the [EINVAL]
error applies.

Also adjust the similar check in freopen() with a NULL path, even though
this checks an fd which is already from a FILE.
</content>
</entry>
<entry>
<title>Convert libc/stdio from K&amp;R to ANSI C</title>
<updated>2013-04-23T14:36:44Z</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2013-04-23T14:36:44Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=5a6307cf42c5b4965435b3b7af74a37fd4dc17b9'/>
<id>urn:sha1:5a6307cf42c5b4965435b3b7af74a37fd4dc17b9</id>
<content type='text'>
And add '__restrict' where it appeared in the header prototypes
</content>
</entry>
<entry>
<title>Renumber clauses to reduce diffs to other versions</title>
<updated>2013-04-23T13:33:13Z</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2013-04-23T13:33:13Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=1d8053c5c04e7977f9086d277ed79890a7a59720'/>
<id>urn:sha1:1d8053c5c04e7977f9086d277ed79890a7a59720</id>
<content type='text'>
NetBSD, OpenBSD, and Android's Bionic all number the clauses 1 through 3,
so follow suit to make comparison easier.

Acked-by: imp@
</content>
</entry>
<entry>
<title>libc: Allow setting close-on-exec in fopen/freopen/fdopen.</title>
<updated>2012-11-30T23:51:33Z</updated>
<author>
<name>Jilles Tjoelker</name>
<email>jilles@FreeBSD.org</email>
</author>
<published>2012-11-30T23:51:33Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=5ba651f00489791d21b1831cf7101c76fb3b3ae6'/>
<id>urn:sha1:5ba651f00489791d21b1831cf7101c76fb3b3ae6</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>Remove useless call to getdtablesize(2) in fdopen(3) and its useless</title>
<updated>2008-05-10T18:39:20Z</updated>
<author>
<name>Antoine Brodin</name>
<email>antoine@FreeBSD.org</email>
</author>
<published>2008-05-10T18:39:20Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=27522528ea191b84eddc7acf8e1d030564c1777b'/>
<id>urn:sha1:27522528ea191b84eddc7acf8e1d030564c1777b</id>
<content type='text'>
variable nofile.

PR:		123109
Submitted by:	Christoph Mallon
Approved by:	rwatson (mentor)
MFC after:	1 month
</content>
</entry>
<entry>
<title>Add &lt;limits.h&gt; for SHRT_MAX.</title>
<updated>2008-02-27T21:25:19Z</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2008-02-27T21:25:19Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=fc9ab4f6da867f22e1f3ab6d21378fba33160424'/>
<id>urn:sha1:fc9ab4f6da867f22e1f3ab6d21378fba33160424</id>
<content type='text'>
Pointy hat to:	jhb
</content>
</entry>
<entry>
<title>File descriptors are an int, but our stdio FILE object uses a short to hold</title>
<updated>2008-02-27T19:02:02Z</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2008-02-27T19:02:02Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=c55d7e868aeb0e29e47c3a8ea9238e143f2a4c78'/>
<id>urn:sha1:c55d7e868aeb0e29e47c3a8ea9238e143f2a4c78</id>
<content type='text'>
them.  Thus, any fd whose value is greater than SHRT_MAX is handled
incorrectly (the short value is sign-extended when converted to an int).
An unpleasant side effect is that if fopen() opens a file and gets a
backing fd that is greater than SHRT_MAX, fclose() will fail and the file
descriptor will be leaked.  Better handle this by fixing fopen(), fdopen(),
and freopen() to fail attempts to use a fd greater than SHRT_MAX with
EMFILE.

At some point in the future we should look at expanding the file descriptor
in FILE to an int, but that is a bit complicated due to ABI issues.

MFC after:	1 week
Discussed on:	arch
Reviewed by:	wollman
</content>
</entry>
</feed>
