summaryrefslogtreecommitdiff
path: root/static/unix-v10/man2/open.2
blob: 3f295f9011eccb065bd0d2fa0bb5d4588cd20631 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.TH OPEN 2
.CT 2 file_io
.SH NAME
open \(mi open for reading or writing
.SH SYNOPSIS
.nf
.B int open(name, rwmode)
.B char *name;
.fi
.SH DESCRIPTION
.I Open
opens the file
.I name
for reading
(if
.I rwmode
is 0),
writing (if
.I rwmode
is 1)
or for both reading and writing
(if
.I rwmode
is 2)
and returns an associated file descriptor.
.I Name
is a null-terminated string representing
a path name.
.PP
The file pointer is set to 0.
.PP
It is not possible to open for writing a file with set-userid
or set-groupid permission; see
.IR stat (2).
.SH "SEE ALSO"
.IR close (2),
.IR creat (2), 
.IR dup (2), 
.IR read (2), 
.IR write (2)
.SH DIAGNOSTICS
.BR EACCES ,
.BR EBUSY ,
.BR ECONC ,
.BR EFAULT ,
.BR EINTR ,
.BR EIO ,
.BR EISDIR ,
.BR ELAB ,
.BR ELOOP ,
.BR EMFILE ,
.BR ENFILE ,
.BR ENOENT ,
.BR ENOTDIR ,
.BR EROFS ,
.BR ETXTBSY
.SH BUGS
It should be possible to open files for writing with exclusive use,
and to call
.I open
without the necessity of waiting for carrier on communication lines.