@@ -48,8 +48,46 @@ fn main_0() -> i32 {
4848 } == 11_isize ) as i32 )
4949 != 0 )
5050 ) ;
51- assert ! ( ( ( ( libc:: lseek( ( * fd. borrow( ) ) , 0_i64 , 2 ) == 11_i64 ) as i32 ) != 0 ) ) ;
52- assert ! ( ( ( ( libc:: lseek( ( * fd. borrow( ) ) , 6_i64 , 0 ) == 6_i64 ) as i32 ) != 0 ) ) ;
51+ assert ! (
52+ ( ( ( {
53+ let __whence = match 2 {
54+ 0 => nix:: unistd:: Whence :: SeekSet ,
55+ 1 => nix:: unistd:: Whence :: SeekCur ,
56+ 2 => nix:: unistd:: Whence :: SeekEnd ,
57+ __w => panic!( "lseek: unsupported whence {__w}" ) ,
58+ } ;
59+ match FdRegistry :: with_fd( ( * fd. borrow( ) ) , |__fd| {
60+ nix:: unistd:: lseek( __fd, 0_i64 , __whence)
61+ } ) {
62+ Ok ( __off) => __off,
63+ Err ( __e) => {
64+ libcc2rs:: cpp2rust_errno( ) . write( __e as i32 ) ;
65+ -1
66+ }
67+ }
68+ } == 11_i64 ) as i32 )
69+ != 0 )
70+ ) ;
71+ assert ! (
72+ ( ( ( {
73+ let __whence = match 0 {
74+ 0 => nix:: unistd:: Whence :: SeekSet ,
75+ 1 => nix:: unistd:: Whence :: SeekCur ,
76+ 2 => nix:: unistd:: Whence :: SeekEnd ,
77+ __w => panic!( "lseek: unsupported whence {__w}" ) ,
78+ } ;
79+ match FdRegistry :: with_fd( ( * fd. borrow( ) ) , |__fd| {
80+ nix:: unistd:: lseek( __fd, 6_i64 , __whence)
81+ } ) {
82+ Ok ( __off) => __off,
83+ Err ( __e) => {
84+ libcc2rs:: cpp2rust_errno( ) . write( __e as i32 ) ;
85+ -1
86+ }
87+ }
88+ } == 6_i64 ) as i32 )
89+ != 0 )
90+ ) ;
5391 let buf: Value < Box < [ u8 ] > > = Rc :: new ( RefCell :: new (
5492 ( 0 ..16 ) . map ( |_| <u8 >:: default ( ) ) . collect :: < Box < [ u8 ] > > ( ) ,
5593 ) ) ;
@@ -93,8 +131,36 @@ fn main_0() -> i32 {
93131 } == 0 ) as i32 )
94132 != 0 )
95133 ) ;
96- assert ! ( ( ( ( libc:: ftruncate( ( * fd. borrow( ) ) , 5_i64 ) == 0 ) as i32 ) != 0 ) ) ;
97- assert ! ( ( ( ( libc:: lseek( ( * fd. borrow( ) ) , 0_i64 , 2 ) == 5_i64 ) as i32 ) != 0 ) ) ;
134+ assert ! (
135+ ( ( ( match FdRegistry :: with_fd( ( * fd. borrow( ) ) , |__fd| nix:: unistd:: ftruncate( __fd, 5_i64 ) ) {
136+ Ok ( ( ) ) => 0 ,
137+ Err ( __e) => {
138+ libcc2rs:: cpp2rust_errno( ) . write( __e as i32 ) ;
139+ -1
140+ }
141+ } == 0 ) as i32 )
142+ != 0 )
143+ ) ;
144+ assert ! (
145+ ( ( ( {
146+ let __whence = match 2 {
147+ 0 => nix:: unistd:: Whence :: SeekSet ,
148+ 1 => nix:: unistd:: Whence :: SeekCur ,
149+ 2 => nix:: unistd:: Whence :: SeekEnd ,
150+ __w => panic!( "lseek: unsupported whence {__w}" ) ,
151+ } ;
152+ match FdRegistry :: with_fd( ( * fd. borrow( ) ) , |__fd| {
153+ nix:: unistd:: lseek( __fd, 0_i64 , __whence)
154+ } ) {
155+ Ok ( __off) => __off,
156+ Err ( __e) => {
157+ libcc2rs:: cpp2rust_errno( ) . write( __e as i32 ) ;
158+ -1
159+ }
160+ }
161+ } == 5_i64 ) as i32 )
162+ != 0 )
163+ ) ;
98164 assert ! ( ( ( ( FdRegistry :: close( ( * fd. borrow( ) ) ) == 0 ) as i32 ) != 0 ) ) ;
99165 assert ! (
100166 ( ( ( match nix:: unistd:: unlink( ( * path. borrow( ) ) . to_rust_string( ) . as_str( ) ) {
0 commit comments