11pub type blkcnt_t = i32 ;
22pub type blksize_t = i32 ;
33
4- cfg_if ! {
5- if #[ cfg( target_os = "vita" ) ] {
6- pub type clockid_t = :: c_uint;
7- } else {
8- pub type clockid_t = :: c_ulong;
9- }
10- }
4+ pub type clockid_t = :: c_ulong ;
115
126cfg_if ! {
137 if #[ cfg( any( target_os = "espidf" ) ) ] {
@@ -170,16 +164,6 @@ s! {
170164 pub sa_flags: :: c_int,
171165 }
172166
173- pub struct dirent {
174- #[ cfg( not( target_os = "vita" ) ) ]
175- pub d_ino: ino_t,
176- #[ cfg( not( target_os = "vita" ) ) ]
177- pub d_type: :: c_uchar,
178- #[ cfg( target_os = "vita" ) ]
179- __offset: [ u8 ; 88 ] ,
180- pub d_name: [ :: c_char; 256usize ] ,
181- }
182-
183167 pub struct stack_t {
184168 pub ss_sp: * mut :: c_void,
185169 pub ss_flags: :: c_int,
@@ -546,8 +530,16 @@ pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
546530pub const IFF_ALTPHYS : :: c_int = IFF_LINK2 ; // use alternate physical connection
547531pub const IFF_MULTICAST : :: c_int = 0x8000 ; // supports multicast
548532
549- pub const TCP_NODELAY : :: c_int = 8193 ;
550- pub const TCP_MAXSEG : :: c_int = 8194 ;
533+ cfg_if ! {
534+ if #[ cfg( target_os = "vita" ) ] {
535+ pub const TCP_NODELAY : :: c_int = 1 ;
536+ pub const TCP_MAXSEG : :: c_int = 2 ;
537+ } else {
538+ pub const TCP_NODELAY : :: c_int = 8193 ;
539+ pub const TCP_MAXSEG : :: c_int = 8194 ;
540+ }
541+ }
542+
551543pub const TCP_NOPUSH : :: c_int = 4 ;
552544pub const TCP_NOOPT : :: c_int = 8 ;
553545pub const TCP_KEEPIDLE : :: c_int = 256 ;
@@ -561,13 +553,25 @@ cfg_if! {
561553 pub const IP_TOS : :: c_int = 3 ;
562554 }
563555}
564- pub const IP_TTL : :: c_int = 8 ;
556+ cfg_if ! {
557+ if #[ cfg( target_os = "vita" ) ] {
558+ pub const IP_TTL : :: c_int = 4 ;
559+ } else {
560+ pub const IP_TTL : :: c_int = 8 ;
561+ }
562+ }
565563pub const IP_MULTICAST_IF : :: c_int = 9 ;
566564pub const IP_MULTICAST_TTL : :: c_int = 10 ;
567565pub const IP_MULTICAST_LOOP : :: c_int = 11 ;
568- pub const IP_ADD_MEMBERSHIP : :: c_int = 11 ;
569- pub const IP_DROP_MEMBERSHIP : :: c_int = 12 ;
570-
566+ cfg_if ! {
567+ if #[ cfg( target_os = "vita" ) ] {
568+ pub const IP_ADD_MEMBERSHIP : :: c_int = 12 ;
569+ pub const IP_DROP_MEMBERSHIP : :: c_int = 13 ;
570+ } else {
571+ pub const IP_ADD_MEMBERSHIP : :: c_int = 11 ;
572+ pub const IP_DROP_MEMBERSHIP : :: c_int = 12 ;
573+ }
574+ }
571575pub const IPV6_UNICAST_HOPS : :: c_int = 4 ;
572576pub const IPV6_MULTICAST_IF : :: c_int = 9 ;
573577pub const IPV6_MULTICAST_HOPS : :: c_int = 10 ;
@@ -598,10 +602,15 @@ pub const NI_NAMEREQD: ::c_int = 4;
598602pub const NI_NUMERICSERV : :: c_int = 0 ;
599603pub const NI_DGRAM : :: c_int = 0 ;
600604
601- pub const EAI_FAMILY : :: c_int = -303 ;
602- pub const EAI_MEMORY : :: c_int = -304 ;
603- pub const EAI_NONAME : :: c_int = -305 ;
604- pub const EAI_SOCKTYPE : :: c_int = -307 ;
605+ cfg_if ! {
606+ // Defined in vita/mod.rs for "vita"
607+ if #[ cfg( not( target_os = "vita" ) ) ] {
608+ pub const EAI_FAMILY : :: c_int = -303 ;
609+ pub const EAI_MEMORY : :: c_int = -304 ;
610+ pub const EAI_NONAME : :: c_int = -305 ;
611+ pub const EAI_SOCKTYPE : :: c_int = -307 ;
612+ }
613+ }
605614
606615pub const EXIT_SUCCESS : :: c_int = 0 ;
607616pub const EXIT_FAILURE : :: c_int = 1 ;
@@ -777,6 +786,13 @@ cfg_if! {
777786 }
778787}
779788
789+ cfg_if ! {
790+ if #[ cfg( not( target_os = "vita" ) ) ] {
791+ mod dirent;
792+ pub use self :: dirent:: * ;
793+ }
794+ }
795+
780796cfg_if ! {
781797 if #[ cfg( libc_align) ] {
782798 #[ macro_use]
0 commit comments