authorgravatar for greg@unrelenting.technologyGreg V <greg@unrelenting.technology> 2018-10-17 18:12:53+03:00
committergravatar for greg@unrelenting.technologyGreg V <greg@unrelenting.technology> 2018-10-20 15:15:01+03:00
logd6cab0d4b653b1f6d7340b9a24766abae4f208a8
treef646aa21337544e64922a67ba537f22ad2b70220
parentafe26bbcbdfd7d6fc5ed141688dd9baeb2f1c104

Various fcntl flags are also machine-independent on FreeBSD


2 files changed, 40 insertions(+), 61 deletions(-)

std/os/freebsd/index.zig+40-20
...@@ -95,26 +95,46 @@ pub const O_WRONLY = 0o1;...@@ -95,26 +95,46 @@ pub const O_WRONLY = 0o1;
95pub const O_RDWR = 0o2;95pub const O_RDWR = 0o2;
96pub const O_ACCMODE = 0o3;96pub const O_ACCMODE = 0o3;
9797
98pub const O_CREAT = arch.O_CREAT;98pub const O_CREAT = 0o100;
99pub const O_EXCL = arch.O_EXCL;99pub const O_EXCL = 0o200;
100pub const O_NOCTTY = arch.O_NOCTTY;100pub const O_NOCTTY = 0o400;
101pub const O_TRUNC = arch.O_TRUNC;101pub const O_TRUNC = 0o1000;
102pub const O_APPEND = arch.O_APPEND;102pub const O_APPEND = 0o2000;
103pub const O_NONBLOCK = arch.O_NONBLOCK;103pub const O_NONBLOCK = 0o4000;
104pub const O_DSYNC = arch.O_DSYNC;104pub const O_DSYNC = 0o10000;
105pub const O_SYNC = arch.O_SYNC;105pub const O_SYNC = 0o4010000;
106pub const O_RSYNC = arch.O_RSYNC;106pub const O_RSYNC = 0o4010000;
107pub const O_DIRECTORY = arch.O_DIRECTORY;107pub const O_DIRECTORY = 0o200000;
108pub const O_NOFOLLOW = arch.O_NOFOLLOW;108pub const O_NOFOLLOW = 0o400000;
109pub const O_CLOEXEC = arch.O_CLOEXEC;109pub const O_CLOEXEC = 0o2000000;
110110
111pub const O_ASYNC = arch.O_ASYNC;111pub const O_ASYNC = 0o20000;
112pub const O_DIRECT = arch.O_DIRECT;112pub const O_DIRECT = 0o40000;
113pub const O_LARGEFILE = arch.O_LARGEFILE;113pub const O_LARGEFILE = 0;
114pub const O_NOATIME = arch.O_NOATIME;114pub const O_NOATIME = 0o1000000;
115pub const O_PATH = arch.O_PATH;115pub const O_PATH = 0o10000000;
116pub const O_TMPFILE = arch.O_TMPFILE;116pub const O_TMPFILE = 0o20200000;
117pub const O_NDELAY = arch.O_NDELAY;117pub const O_NDELAY = O_NONBLOCK;
118
119pub const F_DUPFD = 0;
120pub const F_GETFD = 1;
121pub const F_SETFD = 2;
122pub const F_GETFL = 3;
123pub const F_SETFL = 4;
124
125pub const F_SETOWN = 8;
126pub const F_GETOWN = 9;
127pub const F_SETSIG = 10;
128pub const F_GETSIG = 11;
129
130pub const F_GETLK = 5;
131pub const F_SETLK = 6;
132pub const F_SETLKW = 7;
133
134pub const F_SETOWN_EX = 15;
135pub const F_GETOWN_EX = 16;
136
137pub const F_GETOWNER_UIDS = 17;
118138
119pub const SEEK_SET = 0;139pub const SEEK_SET = 0;
120pub const SEEK_CUR = 1;140pub const SEEK_CUR = 1;
std/os/freebsd/x86_64.zig-41
...@@ -4,47 +4,6 @@ const iovec = freebsd.iovec;...@@ -4,47 +4,6 @@ const iovec = freebsd.iovec;
44
5pub const SYS_sbrk = 69;5pub const SYS_sbrk = 69;
66
7pub const O_CREAT = 0o100;
8pub const O_EXCL = 0o200;
9pub const O_NOCTTY = 0o400;
10pub const O_TRUNC = 0o1000;
11pub const O_APPEND = 0o2000;
12pub const O_NONBLOCK = 0o4000;
13pub const O_DSYNC = 0o10000;
14pub const O_SYNC = 0o4010000;
15pub const O_RSYNC = 0o4010000;
16pub const O_DIRECTORY = 0o200000;
17pub const O_NOFOLLOW = 0o400000;
18pub const O_CLOEXEC = 0o2000000;
19
20pub const O_ASYNC = 0o20000;
21pub const O_DIRECT = 0o40000;
22pub const O_LARGEFILE = 0;
23pub const O_NOATIME = 0o1000000;
24pub const O_PATH = 0o10000000;
25pub const O_TMPFILE = 0o20200000;
26pub const O_NDELAY = O_NONBLOCK;
27
28pub const F_DUPFD = 0;
29pub const F_GETFD = 1;
30pub const F_SETFD = 2;
31pub const F_GETFL = 3;
32pub const F_SETFL = 4;
33
34pub const F_SETOWN = 8;
35pub const F_GETOWN = 9;
36pub const F_SETSIG = 10;
37pub const F_GETSIG = 11;
38
39pub const F_GETLK = 5;
40pub const F_SETLK = 6;
41pub const F_SETLKW = 7;
42
43pub const F_SETOWN_EX = 15;
44pub const F_GETOWN_EX = 16;
45
46pub const F_GETOWNER_UIDS = 17;
47
48pub fn syscall0(number: usize) usize {7pub fn syscall0(number: usize) usize {
49 return asm volatile ("syscall"8 return asm volatile ("syscall"
50 : [ret] "={rax}" (-> usize)9 : [ret] "={rax}" (-> usize)