@@ -92,6 +92,7 @@ pub(crate) use libc::IP_HDRINCL;
9292 target_os = "haiku" ,
9393 target_os = "nto" ,
9494 target_os = "espidf" ,
95+ target_os = "vita" ,
9596) ) ) ]
9697pub ( crate ) use libc:: IP_RECVTOS ;
9798#[ cfg( not( any(
@@ -121,6 +122,7 @@ pub(crate) use libc::{
121122 target_os = "fuchsia" ,
122123 target_os = "nto" ,
123124 target_os = "espidf" ,
125+ target_os = "vita" ,
124126) ) ) ]
125127pub ( crate ) use libc:: {
126128 ip_mreq_source as IpMreqSource , IP_ADD_SOURCE_MEMBERSHIP , IP_DROP_SOURCE_MEMBERSHIP ,
@@ -175,6 +177,7 @@ use libc::TCP_KEEPALIVE as KEEPALIVE_TIME;
175177 target_os = "haiku" ,
176178 target_os = "openbsd" ,
177179 target_os = "nto" ,
180+ target_os = "vita" ,
178181) ) ) ]
179182use libc:: TCP_KEEPIDLE as KEEPALIVE_TIME ;
180183
@@ -237,6 +240,7 @@ type IovLen = usize;
237240 target_os = "nto" ,
238241 target_vendor = "apple" ,
239242 target_os = "espidf" ,
243+ target_os = "vita" ,
240244) ) ]
241245type IovLen = c_int ;
242246
@@ -713,6 +717,7 @@ pub(crate) fn try_clone(fd: Socket) -> io::Result<Socket> {
713717 syscall ! ( fcntl( fd, libc:: F_DUPFD_CLOEXEC , 0 ) )
714718}
715719
720+ #[ cfg( not( target_os = "vita" ) ) ]
716721pub ( crate ) fn set_nonblocking ( fd : Socket , nonblocking : bool ) -> io:: Result < ( ) > {
717722 if nonblocking {
718723 fcntl_add ( fd, libc:: F_GETFL , libc:: F_SETFL , libc:: O_NONBLOCK )
@@ -721,6 +726,18 @@ pub(crate) fn set_nonblocking(fd: Socket, nonblocking: bool) -> io::Result<()> {
721726 }
722727}
723728
729+ #[ cfg( target_os = "vita" ) ]
730+ pub ( crate ) fn set_nonblocking ( fd : Socket , nonblocking : bool ) -> io:: Result < ( ) > {
731+ unsafe {
732+ setsockopt (
733+ fd,
734+ libc:: SOL_SOCKET ,
735+ libc:: SO_NONBLOCK ,
736+ nonblocking as libc:: c_int ,
737+ )
738+ }
739+ }
740+
724741pub ( crate ) fn shutdown ( fd : Socket , how : Shutdown ) -> io:: Result < ( ) > {
725742 let how = match how {
726743 Shutdown :: Write => libc:: SHUT_WR ,
@@ -923,7 +940,7 @@ fn into_timeval(duration: Option<Duration>) -> libc::timeval {
923940}
924941
925942#[ cfg( feature = "all" ) ]
926- #[ cfg( not( any( target_os = "haiku" , target_os = "openbsd" ) ) ) ]
943+ #[ cfg( not( any( target_os = "haiku" , target_os = "openbsd" , target_os = "vita" ) ) ) ]
927944pub ( crate ) fn keepalive_time ( fd : Socket ) -> io:: Result < Duration > {
928945 unsafe {
929946 getsockopt :: < c_int > ( fd, IPPROTO_TCP , KEEPALIVE_TIME )
@@ -933,7 +950,12 @@ pub(crate) fn keepalive_time(fd: Socket) -> io::Result<Duration> {
933950
934951#[ allow( unused_variables) ]
935952pub ( crate ) fn set_tcp_keepalive ( fd : Socket , keepalive : & TcpKeepalive ) -> io:: Result < ( ) > {
936- #[ cfg( not( any( target_os = "haiku" , target_os = "openbsd" , target_os = "nto" ) ) ) ]
953+ #[ cfg( not( any(
954+ target_os = "haiku" ,
955+ target_os = "openbsd" ,
956+ target_os = "nto" ,
957+ target_os = "vita"
958+ ) ) ) ]
937959 if let Some ( time) = keepalive. time {
938960 let secs = into_secs ( time) ;
939961 unsafe { setsockopt ( fd, libc:: IPPROTO_TCP , KEEPALIVE_TIME , secs) ? }
@@ -969,12 +991,18 @@ pub(crate) fn set_tcp_keepalive(fd: Socket, keepalive: &TcpKeepalive) -> io::Res
969991 Ok ( ( ) )
970992}
971993
972- #[ cfg( not( any( target_os = "haiku" , target_os = "openbsd" , target_os = "nto" ) ) ) ]
994+ #[ cfg( not( any(
995+ target_os = "haiku" ,
996+ target_os = "openbsd" ,
997+ target_os = "nto" ,
998+ target_os = "vita"
999+ ) ) ) ]
9731000fn into_secs ( duration : Duration ) -> c_int {
9741001 min ( duration. as_secs ( ) , c_int:: max_value ( ) as u64 ) as c_int
9751002}
9761003
9771004/// Add `flag` to the current set flags of `F_GETFD`.
1005+ #[ cfg( not( target_os = "vita" ) ) ]
9781006fn fcntl_add ( fd : Socket , get_cmd : c_int , set_cmd : c_int , flag : c_int ) -> io:: Result < ( ) > {
9791007 let previous = syscall ! ( fcntl( fd, get_cmd) ) ?;
9801008 let new = previous | flag;
@@ -987,6 +1015,7 @@ fn fcntl_add(fd: Socket, get_cmd: c_int, set_cmd: c_int, flag: c_int) -> io::Res
9871015}
9881016
9891017/// Remove `flag` to the current set flags of `F_GETFD`.
1018+ #[ cfg( not( target_os = "vita" ) ) ]
9901019fn fcntl_remove ( fd : Socket , get_cmd : c_int , set_cmd : c_int , flag : c_int ) -> io:: Result < ( ) > {
9911020 let previous = syscall ! ( fcntl( fd, get_cmd) ) ?;
9921021 let new = previous & !flag;
@@ -1066,6 +1095,7 @@ pub(crate) fn from_in6_addr(addr: in6_addr) -> Ipv6Addr {
10661095 target_os = "solaris" ,
10671096 target_os = "nto" ,
10681097 target_os = "espidf" ,
1098+ target_os = "vita" ,
10691099) ) ) ]
10701100pub ( crate ) fn to_mreqn (
10711101 multiaddr : & Ipv4Addr ,
@@ -1152,12 +1182,13 @@ impl crate::Socket {
11521182 /// # Notes
11531183 ///
11541184 /// On supported platforms you can use [`Type::cloexec`].
1155- #[ cfg( feature = "all" ) ]
1156- #[ cfg_attr( docsrs, doc( cfg( all( feature = "all" , unix) ) ) ) ]
1185+ #[ cfg( all ( feature = "all" , not ( target_os = "vita" ) ) ) ]
1186+ #[ cfg_attr( docsrs, doc( cfg( all( feature = "all" , unix, not ( target_os = "vita" ) ) ) ) ) ]
11571187 pub fn set_cloexec ( & self , close_on_exec : bool ) -> io:: Result < ( ) > {
11581188 self . _set_cloexec ( close_on_exec)
11591189 }
11601190
1191+ #[ cfg( not( target_os = "vita" ) ) ]
11611192 pub ( crate ) fn _set_cloexec ( & self , close_on_exec : bool ) -> io:: Result < ( ) > {
11621193 if close_on_exec {
11631194 fcntl_add (
0 commit comments