@@ -51,13 +51,14 @@ pub(crate) fn new_socket(domain: libc::c_int, socket_type: libc::c_int) -> io::R
5151 target_os = "tvos" ,
5252 target_os = "watchos" ,
5353 target_os = "espidf" ,
54+ target_os = "vita" ,
5455 ) ) ]
5556 {
5657 if let Err ( err) = syscall ! ( fcntl( socket, libc:: F_SETFL , libc:: O_NONBLOCK ) ) {
5758 let _ = syscall ! ( close( socket) ) ;
5859 return Err ( err) ;
5960 }
60- #[ cfg( not( target_os = "espidf" ) ) ]
61+ #[ cfg( not( any ( target_os = "espidf" , target_os = "vita" ) ) ) ]
6162 if let Err ( err) = syscall ! ( fcntl( socket, libc:: F_SETFD , libc:: FD_CLOEXEC ) ) {
6263 let _ = syscall ! ( close( socket) ) ;
6364 return Err ( err) ;
@@ -97,7 +98,10 @@ pub(crate) fn socket_addr(addr: &SocketAddr) -> (SocketAddrCRepr, libc::socklen_
9798 sin_family : libc:: AF_INET as libc:: sa_family_t ,
9899 sin_port : addr. port ( ) . to_be ( ) ,
99100 sin_addr,
101+ #[ cfg( not( target_os = "vita" ) ) ]
100102 sin_zero : [ 0 ; 8 ] ,
103+ #[ cfg( target_os = "vita" ) ]
104+ sin_zero : [ 0 ; 6 ] ,
101105 #[ cfg( any(
102106 target_os = "aix" ,
103107 target_os = "dragonfly" ,
@@ -109,8 +113,11 @@ pub(crate) fn socket_addr(addr: &SocketAddr) -> (SocketAddrCRepr, libc::socklen_
109113 target_os = "tvos" ,
110114 target_os = "watchos" ,
111115 target_os = "espidf" ,
116+ target_os = "vita" ,
112117 ) ) ]
113118 sin_len : 0 ,
119+ #[ cfg( target_os = "vita" ) ]
120+ sin_vport : addr. port ( ) . to_be ( ) ,
114121 } ;
115122
116123 let sockaddr = SocketAddrCRepr { v4 : sockaddr_in } ;
@@ -137,8 +144,11 @@ pub(crate) fn socket_addr(addr: &SocketAddr) -> (SocketAddrCRepr, libc::socklen_
137144 target_os = "tvos" ,
138145 target_os = "watchos" ,
139146 target_os = "espidf" ,
147+ target_os = "vita" ,
140148 ) ) ]
141149 sin6_len : 0 ,
150+ #[ cfg( target_os = "vita" ) ]
151+ sin6_vport : addr. port ( ) . to_be ( ) ,
142152 #[ cfg( target_os = "illumos" ) ]
143153 __sin6_src_id : 0 ,
144154 } ;
0 commit comments