Up

Traces

linux[3.13.0-29-generic][system[GNU C Library (GNU libc) stable release version 2.21, by Roland McGrath et al.]][ext4_loop[mke2fs 1.42.9 (4-Feb-2014)]]@[2015-07-24T13:23:26Z./nix/store/fxisrpncjn4cxxwnq2lvilriqx63s9k9-fs_test]

Checked Trace
linux_spec@[/nix/store/fxisrpncjn4cxxwnq2lvilriqx63s9k9-fs_test] sexp stdout stderr
Traced Execution stdout stderr
Script script

Combined Trace

1 # processing file 'adhoc_open_append-int.trace' ...
2 @type trace
3
4 # #############################################
5 # O_APPEND
6 # #############################################
7
8 # write fresh content
9 open "f1.txt" [O_CREAT;O_RDWR] 0o600
10 Tau
11 RV_num(3)
12 write! (FD 3) "0123456789" 10
13 Tau
14 RV_num(10)
15 pread! (FD 3) 100 0
16 Tau
17 RV_bytes("0123456789")
18 close (FD 3)
19 Tau
20 RV_none
21
22 # override at beginning
23 open "f1.txt" [O_RDWR]
24 Tau
25 RV_num(3)
26 write (FD 3) "ABCDE" 5
27 Tau
28 RV_num(5)
29 pread! (FD 3) 100 0
30 Tau
31 RV_bytes("ABCDE56789")
32 close (FD 3)
33 Tau
34 RV_none
35
36 # override at end
37 open "f1.txt" [O_APPEND;O_RDWR]
38 Tau
39 RV_num(3)
40 write (FD 3) "ABCDE" 5
41 Tau
42 RV_num(5)
43 pread! (FD 3) 100 0
44 Tau
45 RV_bytes("ABCDE56789ABCDE")
46 close (FD 3)
47 Tau
48 RV_none
49
50 # O_APPEND sets file-offset before every(!) write
51 open "f1.txt" [O_APPEND;O_RDWR]
52 Tau
53 RV_num(3)
54 write (FD 3) "XXX" 3
55 Tau
56 RV_num(3)
57 lseek (FD 3) 0 SEEK_SET
58 Tau
59 RV_num(0)
60 write (FD 3) "YYY" 3
61 Tau
62 RV_num(3)
63 lseek (FD 3) 0 SEEK_SET
64 Tau
65 RV_num(0)
66 write (FD 3) "ZZZ" 3
67 Tau
68 RV_num(3)
69 read (FD 3) 100
70 Tau
71 RV_bytes("")
72 lseek (FD 3) 0 SEEK_SET
73 Tau
74 RV_num(0)
75 read (FD 3) 100
76 Tau
77 RV_bytes("ABCDE56789ABCDEXXXYYYZZZ")
78 pread! (FD 3) 100 0
79 Tau
80 RV_bytes("ABCDE56789ABCDEXXXYYYZZZ")
81 close (FD 3)
82 Tau
83 RV_none
84
85 # O_APPEND also affects pwrite
86 open "f1.txt" [O_APPEND;O_RDWR]
87 Tau
88 RV_num(3)
89 pwrite (FD 3) "AAA" 3 0
90 Tau
91 RV_num(3)
92 pwrite (FD 3) "BBB" 3 -1
93 Tau
94 EINVAL
95 pwrite (FD 3) "CCC" 3 5
96 Tau
97 RV_num(3)
98 pread! (FD 3) 100 0
99 Tau
100 RV_bytes("ABCDE56789ABCDEXXXYYYZZZAAACCC")
101 close (FD 3)
102 Tau
103 RV_none
104
105 # pwrite does not modify fd-offset, whereas write does
106 open "f1.txt" [O_APPEND;O_RDWR]
107 Tau
108 RV_num(3)
109 lseek (FD 3) 0 SEEK_CUR
110 Tau
111 RV_num(0)
112 pwrite (FD 3) "DDD" 3 0
113 Tau
114 RV_num(3)
115 lseek (FD 3) 0 SEEK_CUR
116 Tau
117 RV_num(0)
118 write (FD 3) "EEE" 3
119 Tau
120 RV_num(3)
121 lseek (FD 3) 0 SEEK_CUR
122 Tau
123 RV_num(36)
124 pread! (FD 3) 100 0
125 Tau
126 RV_bytes("ABCDE56789ABCDEXXXYYYZZZAAACCCDDDEEE")
127 close (FD 3)
128 Tau
129 RV_none
130
131
132 # O_APPEND does only influence write and pwrite
133 open "f1.txt" [O_APPEND;O_RDWR]
134 Tau
135 RV_num(3)
136 read (FD 3) 100
137 Tau
138 RV_bytes("ABCDE56789ABCDEXXXYYYZZZAAACCCDDDEEE")
139 close (FD 3)
140 Tau
141 RV_none
142
143 open "f1.txt" [O_APPEND;O_RDWR]
144 Tau
145 RV_num(3)
146 pread (FD 3) 100 0
147 Tau
148 RV_bytes("ABCDE56789ABCDEXXXYYYZZZAAACCCDDDEEE")
149 close (FD 3)
150 Tau
151 RV_none
152
153 open "f1.txt" [O_APPEND;O_RDWR]
154 Tau
155 RV_num(3)
156 lseek (FD 3) 0 SEEK_CUR
157 Tau
158 RV_num(0)
159 close (FD 3)
160 Tau
161 RV_none
162
163