aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/sys/open.2
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2009-02-28 10:10:30 +0000
committerEd Schouten <ed@FreeBSD.org>2009-02-28 10:10:30 +0000
commit6cf4a02c5e286138f7745ee4d9261d1faf735855 (patch)
treeaed61ae8dea8d203ff43b736d45cb76269527ddc /lib/libc/sys/open.2
parent7fb2aa104fd145f3ed18b5f1c0b20a198cfafb71 (diff)
downloadsrc-6cf4a02c5e286138f7745ee4d9261d1faf735855.tar.gz
src-6cf4a02c5e286138f7745ee4d9261d1faf735855.zip
Add missing POSIX 1003.1-2008 open(2) flag; O_TTY_INIT.
On FreeBSD, this is the default behaviour. According to the spec, we may give this flag a value of zero, but I'd rather not do this. If we define it to a non-zero value, we can always change default behaviour without changing the ABI. This is very unlikely to happen, though.
Notes
Notes: svn path=/head/; revision=189143
Diffstat (limited to 'lib/libc/sys/open.2')
-rw-r--r--lib/libc/sys/open.216
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2
index 8fc6d76a610c..3a5979fff9bd 100644
--- a/lib/libc/sys/open.2
+++ b/lib/libc/sys/open.2
@@ -28,7 +28,7 @@
.\" @(#)open.2 8.2 (Berkeley) 11/16/93
.\" $FreeBSD$
.\"
-.Dd April 10, 2008
+.Dd February 28, 2009
.Dt OPEN 2
.Os
.Sh NAME
@@ -116,6 +116,7 @@ O_FSYNC synchronous writes
O_SYNC synchronous writes
O_NOFOLLOW do not follow symlinks
O_NOCTTY don't assign controlling terminal
+O_TTY_INIT restore default terminal attributes
.Ed
.Pp
Opening a file with
@@ -208,6 +209,19 @@ The
system call will not assign controlling terminals on
.Fx .
.Pp
+.Dv O_TTY_INIT
+may be used to ensure the OS restores the terminal attributes when
+initially opening a TTY.
+This is the default on
+.Fx ,
+but is present for
+.Tn POSIX
+compatibility.
+The initial call to
+.Fn open
+on a TTY will always restore default terminal attributes on
+.Fx .
+.Pp
If successful,
.Fn open
returns a non-negative integer, termed a file descriptor.