History log of /src/lib/libc/sys/open.2
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base
# 1.67 17-Jul-2025 kre

Man pages for O_CLOFORK implementation

These are Ricardo Branco's man page updates for affected functions
using O_CLOFORK (and associated variants) for NetBSD (with
a few minor changes and additions by me).


Revision tags: perseant-exfatfs-base-20240630 perseant-exfatfs-base
# 1.66 05-Mar-2023 thorpej

branches: 1.66.2;
Document the error code when O_REGULAR is specified and the last
path component is not a regular file.


Revision tags: netbsd-10-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.65 17-Mar-2021 wiz

branches: 1.65.6;
Remove superfluous article.


# 1.64 17-Mar-2021 dholland

Clarify use of open flags in open(2).

(Avoid using values of three that are equal to four.)


# 1.63 30-Nov-2020 riastradh

Note that open(O_ASYNC) does not work as advertised.

This matches Linux, which also advertises the same semantics and
fails to implement it, according to:

https://man7.org/linux/man-pages/man2/fcntl.2.html

(At what point should we collectively stop advertising the semantics
that doesn't work and call the bug a feature?)


Revision tags: phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 phil-wifi-20191119
# 1.62 16-Sep-2019 wiz

Sort errors.


# 1.61 15-Sep-2019 christos

Document O_EXEC, and add some extra explanation for O_CREAT from FreeBSD.


# 1.60 01-Sep-2019 sevan

Open was present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf


Revision tags: netbsd-9-base phil-wifi-20190609 pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.59 13-Nov-2017 wiz

branches: 1.59.4; 1.59.6;
Remove Tn.


# 1.58 09-Nov-2017 christos

Add O_REGULAR to enforce opening of only regular files
(like we have O_DIRECTORY for directories).
This is better than open(, O_NONBLOCK), fstat()+S_ISREG() because opening
devices can have side effects.


Revision tags: matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3
# 1.57 14-May-2017 wiz

branches: 1.57.2;
file system police.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.56 29-Jul-2013 njoly

branches: 1.56.16;
Add openat(2) specific errors.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8
# 1.55 13-Jan-2013 dholland

Revert defective O_SEARCH implementation committed by manu@ along with
the *at system calls on November 18th of last year. Reasons to revert
it include:
- it is incorrect in a whole variety of ways (but fortunately, one
of them is that the missing and improper permission checks have
no net effect);
- it was committed without review or discussion;
- core ruled that all the new O_* flags pertaining to the *at calls
needed to wait until their semantics could be clarified.

manu was asked to revert it on these grounds but has ignored the request.

I have left O_SEARCH defined and visible and made open() explicitly
ignore it. This way, most code that tries to use it will continue to
build and run. I've also arranged lib/libc/c063/t_o_search.c so that
the tests that make use of the O_SEARCH semantics will disappear until
O_SEARCH comes back, and fixed some mistakes and/or incorrect hacks
that were causing some of these to succeed despite the broken O_SEARCH
implementation.


Revision tags: yamt-pagecache-base7
# 1.54 01-Dec-2012 wiz

Bump date. New sentence, new line. Wording/articles.
Sort errors while here.


# 1.53 01-Dec-2012 wiz

Remove trailing whitespace.


# 1.52 18-Nov-2012 manu

Add most system calls for POSIX extended API set, part 2, with test cases:
faccessat(2), fchmodat(2), fchownat(2), fstatat(2), mkdirat(2), mkfifoat(2),
mknodat(2), linkat(2), readlinkat(2), symlinkat(2), renameat(2), unlinkat(2),
utimensat(2), openat(2).

Also implement O_SEARCH for openat(2)

Still missing:
- some flags for openat(2)
- fexecve(2) implementation


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 yamt-pagecache-base5 yamt-pagecache-base4 netbsd-6-base
# 1.51 25-Jan-2012 christos

branches: 1.51.6;
As discussed in tech-kern, provide the means to prevent delivery of SIGPIPE
on EPIPE for all file descriptor types:

- provide O_NOSIGPIPE for open,kqueue1,pipe2,dup3,fcntl(F_{G,S}ETFL) [NetBSD]
- provide SOCK_NOSIGPIPE for socket,socketpair [NetBSD]
- provide SO_NOSIGPIPE for {g,s}seckopt [NetBSD/FreeBSD/MacOSX]
- provide F_{G,S}ETNOSIGPIPE for fcntl [MacOSX]


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base cherry-xenmp-base
# 1.50 20-Apr-2011 christos

branches: 1.50.4;
sync with reality (prototype of open is varyadic)


# 1.49 11-Apr-2011 wiz

exec is on a higher plane of existence.


# 1.48 10-Apr-2011 christos

Document O_CLOEXEC.


Revision tags: bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.47 22-Sep-2010 wiz

Bump date for O_DIRECTORY, more markup, merge two error sections.


# 1.46 21-Sep-2010 chs

implement O_DIRECTORY as standardized in POSIX-2008,
for both native and linux emulations.
this fixes the rest of PR 43695.


# 1.45 06-Sep-2010 wiz

O_NOFOLLOW is not a non-standard extension any longer (2, 6 years? who counts).


# 1.44 06-Sep-2010 wiz

Note a difference to IEEE Std 2003.1-2008. Bump date.


# 1.43 05-Sep-2010 wiz

Explain how O_NOFOLLOW may cause EFTYPE. From joerg.
While here, sort errors. Bump date.


# 1.42 31-May-2010 njoly

Consistently use `.Brq Dv XXX' across syscalls man pages, for NAME_MAX
and PATH_MAX.


# 1.41 05-Apr-2010 wiz

Sort ERRORS section.


# 1.40 03-Apr-2010 jruoho

Mention the history of stat(2) and fix the history of open(2).


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE jym-xensuspend-nbase netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 christos-time_t-nbase christos-time_t-base netbsd-5-base matt-mips64-base2 mjf-devfs2-base netbsd-4-0-1-RELEASE wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-fixsa-newbase wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base hpcarm-cleanup-base wrstuden-fixsa-base netbsd-4-base
# 1.39 26-Oct-2006 wiz

Bump date for previous.


# 1.38 23-Oct-2006 rillig

open(2) can fail with EPERM.


# 1.37 13-Oct-2006 wiz

Bump date for previous.
New sentence, new line.


# 1.36 05-Oct-2006 chs

add support for O_DIRECT (I/O directly to application memory,
bypassing any kernel caching for file data).


# 1.35 23-Sep-2006 wiz

Add article. Remove superfluous braces.


# 1.34 23-Sep-2006 mishka

lib/26532: Manual page for open(2) bit difficult to understand:
apply patch with small improvement - s/conditions/methods/


Revision tags: abandoned-netbsd-4-base
# 1.33 11-Aug-2005 pooka

document the flags O_ALT_IO and O_NOCTTY


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-3-base netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.32 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.


# 1.31 08-May-2003 lukem

O_NOFOLLOW is another non-standard extension


# 1.30 16-Apr-2003 wiz

Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.


# 1.29 15-Mar-2003 wiz

Use "its" instead of "it's" where appropriate.
From Soren Jacobsen in PR 20730.


# 1.28 18-Jan-2003 thorpej

Merge the nathanw_sa branch.


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.27 06-Dec-2002 christos

Provide O_NOFOLLOW with compatibility with the joneses.


# 1.26 20-Aug-2002 wiz

-1 -> \-1.


# 1.25 17-Aug-2002 yamt

- move return values info into RETURN VALUES section.
- note that O_SHLOCK and O_EXLOCK are not portable.
from OpenBSD.


# 1.24 13-Jun-2002 christos

Remove the cross reference of fileno(3). It is more appropriate to
cross reference this from fopen(3). After discussion with John Heasley
in PR/17224.


# 1.23 12-Jun-2002 wiz

Add Xr to fileno(3), as request in lib/17224.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.22 08-Feb-2002 ross

Generate <>& symbolically. I'm avoiding .../dist/... directories for now.


# 1.21 16-Sep-2001 wiz

Sort sections, sort SEE ALSO, punctuation and miscellanous fixes.


# 1.20 16-Sep-2001 wiz

Boring whitespace fixes.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 kqueue-base netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base
# 1.19 17-Jun-2000 hubertf

branches: 1.19.4;
Merge duplicate mentions of EPERM, EACCESS, ... into one entry
(where applicable).


Revision tags: minoura-xpg4dl-base wrstuden-devbsize-19991221 wrstuden-devbsize-base
# 1.18 02-Dec-1999 kleink

branches: 1.18.2;
Add a LIBRARY section to system call manual pages. While it's clear that the
libraries contain stubs only (with minor exceptions a la pipe(2)), the purpose
of this section is to provide linkage information.


Revision tags: comdex-fall-1999-base
# 1.17 21-Oct-1999 erh

Add ENXIO error for FIFOs.


Revision tags: netbsd-1-4-PATCH003 netbsd-1-4-PATCH002 netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.16 22-Mar-1999 garbled

branches: 1.16.4;
Last of the .Os cleanups. .Os is defined in the tmac.doc-common file,
so we shouldn't override it with versions in the manpages. Wheee!


# 1.15 29-Aug-1998 lukem

first pass at fixing up capitalization of function names and
arguments; ensure that each is correct with respect to the
implementation, rather than being correct as per english.


# 1.14 02-Aug-1998 kleink

Per IEEE Std 1003.1b-1993, Synchronous I/O Option, add O_DSYNC (synchronized
I/O data integrity completion) and O_RSYNC (complete read operations at the
same level of integrity requested for write operations).


# 1.13 28-Apr-1998 fair

fix mdoc references


# 1.12 15-Jan-1998 thorpej

Document the O_SYNC flag, and where its semantics are defined (XPG4.2).
Be more clear about how file access modes are specified, and do a bit
of general cleanup.


# 1.11 01-Nov-1997 mycroft

Nuke trailing comma in SEE ALSO section.


Revision tags: netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.10 11-Jul-1997 mikel

branches: 1.10.2;
xref getdtablesize(3) not getdtablesize(2)


# 1.9 16-May-1997 kleink

Add/update 1003.1 conformance notice.


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.8 27-Feb-1995 cgd

merge with lite, keeping most local changes. clean up Ids


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE netbsd-1-0-base
# 1.7 19-Apr-1994 jtc

Use symbolic names {NAME_MAX} & {PATH_MAX} instead of 255 and 1023 in
description of ENAMETOOLONG error.


# 1.6 11-Apr-1994 glass

bleh


# 1.5 15-Dec-1993 jtc

Tell user to #include <fcntl.h>, not <sys/fcntl.h> or <sys/file.h>.


# 1.4 01-Dec-1993 jtc

Manpage formatting tweaks.


# 1.3 25-Nov-1993 jtc

Clean up manpages:
Use .Fn rather than .Nm macro in HISTORY and STANDARDS sections.
Use .At and .St macros instead of spelling out "Version 6 UNIX",
"IEEE 1003.1-1988 (POSIX)", etc.


# 1.2 01-Aug-1993 mycroft

Add RCS indentifiers.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision