File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#include < netinet/in.h>
2+ #include < netinet/tcp.h>
23
34typedef struct sockaddr_in t1;
45typedef struct in_addr t2;
@@ -26,3 +27,7 @@ int f5() {
2627 return IPPROTO_MPTCP ;
2728}
2829#endif
30+
31+ int f6 () {
32+ return TCP_NODELAY ;
33+ }
Original file line number Diff line number Diff line change @@ -34,3 +34,7 @@ unsafe fn f4() -> i32 {
3434unsafe fn f5 ( ) -> i32 {
3535 libc:: IPPROTO_MPTCP
3636}
37+
38+ unsafe fn f6 ( ) -> i32 {
39+ libc:: TCP_NODELAY
40+ }
Original file line number Diff line number Diff line change @@ -96,3 +96,15 @@ int f20() {
9696int f21 () {
9797 return AF_INET6 ;
9898}
99+
100+ int f22 () {
101+ return SOL_SOCKET ;
102+ }
103+
104+ int f23 () {
105+ return SO_KEEPALIVE ;
106+ }
107+
108+ int f24 () {
109+ return SO_ERROR ;
110+ }
Original file line number Diff line number Diff line change @@ -110,3 +110,15 @@ unsafe fn f20() -> i32 {
110110unsafe fn f21 ( ) -> i32 {
111111 libc:: AF_INET6
112112}
113+
114+ unsafe fn f22 ( ) -> i32 {
115+ libc:: SOL_SOCKET
116+ }
117+
118+ unsafe fn f23 ( ) -> i32 {
119+ libc:: SO_KEEPALIVE
120+ }
121+
122+ unsafe fn f24 ( ) -> i32 {
123+ libc:: SO_ERROR
124+ }
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ fn main_0() -> i32 {
4141 let on: Value < i32 > = Rc :: new ( RefCell :: new ( 1 ) ) ;
4242 assert ! (
4343 ( ( ( {
44- let __res = match ( 1 , 9 ) {
44+ let __res = match ( libc :: SOL_SOCKET , libc :: SO_KEEPALIVE ) {
4545 ( :: libc:: IPPROTO_TCP , :: libc:: TCP_NODELAY ) => {
4646 let __v = ( ( on. as_pointer( ) ) as Ptr <i32 >)
4747 . to_any( )
@@ -213,7 +213,7 @@ fn main_0() -> i32 {
213213 ) ;
214214 assert ! (
215215 ( ( ( {
216- let __res = match ( libc:: IPPROTO_TCP , 1 ) {
216+ let __res = match ( libc:: IPPROTO_TCP , libc :: TCP_NODELAY ) {
217217 ( :: libc:: IPPROTO_TCP , :: libc:: TCP_NODELAY ) => {
218218 let __v = ( ( on. as_pointer( ) ) as Ptr <i32 >)
219219 . to_any( )
@@ -386,7 +386,7 @@ fn main_0() -> i32 {
386386 let err: Value < i32 > = Rc :: new ( RefCell :: new ( -1_i32 ) ) ;
387387 let len: Value < u32 > = Rc :: new ( RefCell :: new ( ( :: std:: mem:: size_of :: < i32 > ( ) as u32 ) ) ) ;
388388 assert ! (
389- ( ( ( match ( 1 , 4 ) {
389+ ( ( ( match ( libc :: SOL_SOCKET , libc :: SO_ERROR ) {
390390 ( :: libc:: SOL_SOCKET , :: libc:: SO_ERROR ) => {
391391 match FdRegistry :: with_fd( ( * s. borrow( ) ) , |__fd| {
392392 nix:: sys:: socket:: getsockopt( & __fd, nix:: sys:: socket:: sockopt:: SocketError )
Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ unsafe fn main_0() -> i32 {
1818 assert ! (
1919 ( ( ( ( libc:: setsockopt(
2020 s,
21- 1 ,
22- 9 ,
21+ libc :: SOL_SOCKET ,
22+ libc :: SO_KEEPALIVE ,
2323 ( ( & mut on as * mut i32 ) as * const i32 as * const :: libc:: c_void) ,
2424 ( :: std:: mem:: size_of:: <i32 >( ) as u32 )
2525 ) ) == ( 0 ) ) as i32 )
@@ -29,7 +29,7 @@ unsafe fn main_0() -> i32 {
2929 ( ( ( ( libc:: setsockopt(
3030 s,
3131 libc:: IPPROTO_TCP ,
32- 1 ,
32+ libc :: TCP_NODELAY ,
3333 ( ( & mut on as * mut i32 ) as * const i32 as * const :: libc:: c_void) ,
3434 ( :: std:: mem:: size_of:: <i32 >( ) as u32 )
3535 ) ) == ( 0 ) ) as i32 )
@@ -40,8 +40,8 @@ unsafe fn main_0() -> i32 {
4040 assert ! (
4141 ( ( ( ( libc:: getsockopt(
4242 s,
43- 1 ,
44- 4 ,
43+ libc :: SOL_SOCKET ,
44+ libc :: SO_ERROR ,
4545 ( ( & mut err as * mut i32 ) as * mut i32 as * mut :: libc:: c_void) ,
4646 ( & mut len as * mut u32 )
4747 ) ) == ( 0 ) ) as i32 )
You can’t perform that action at this time.
0 commit comments