File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -269,6 +269,7 @@ TST_NOFILE := \
269
269
sigtrap \
270
270
sigtrap01 \
271
271
change_mnt_context \
272
+ fd_offset \
272
273
# jobctl00 \
273
274
274
275
PKG_CONFIG ?= pkg-config
Original file line number Diff line number Diff line change
1
+ #include <fcntl.h>
2
+
3
+ #include "zdtmtst.h"
4
+ #include "lock.h"
5
+
6
+ const char * test_doc = "Check that criu properly restores offsets on ELF files" ;
7
+ const char * test_author = "Michal Clapinski <[email protected] >" ;
8
+
9
+ void check_offset (int fd )
10
+ {
11
+ int offset = lseek (fd , 0 , SEEK_CUR );
12
+ if (offset < 0 ) {
13
+ fail ("lseek" );
14
+ exit (1 );
15
+ }
16
+ if (offset != 0 ) {
17
+ fail ("wrong offset; expected: 0, got: %d" , offset );
18
+ exit (1 );
19
+ }
20
+ }
21
+
22
+ int main (int argc , char * * argv )
23
+ {
24
+ int fd ;
25
+
26
+ test_init (argc , argv );
27
+
28
+ fd = open ("/proc/self/exe" , O_RDONLY );
29
+ if (fd < 0 ) {
30
+ fail ("open" );
31
+ exit (1 );
32
+ }
33
+ check_offset (fd );
34
+
35
+ test_daemon ();
36
+ test_waitsig ();
37
+
38
+ check_offset (fd );
39
+
40
+ pass ();
41
+ return 0 ;
42
+ }
You can’t perform that action at this time.
0 commit comments