1
1
pub type blkcnt_t = i32 ;
2
2
pub type blksize_t = i32 ;
3
- pub type clock_t = i32 ;
4
3
pub type clockid_t = :: c_ulong ;
5
4
pub type dev_t = u32 ;
6
5
pub type fsblkcnt_t = u64 ;
@@ -25,14 +24,23 @@ pub type time_t = i32;
25
24
pub type useconds_t = u32 ;
26
25
27
26
s ! {
27
+ // The order of the `ai_addr` field in this struct is crucial
28
+ // for converting between the Rust and C types.
28
29
pub struct addrinfo {
29
30
pub ai_flags: :: c_int,
30
31
pub ai_family: :: c_int,
31
32
pub ai_socktype: :: c_int,
32
33
pub ai_protocol: :: c_int,
33
34
pub ai_addrlen: socklen_t,
35
+
36
+ #[ cfg( target_arch = "xtensa" ) ]
37
+ pub ai_addr: * mut sockaddr,
38
+
34
39
pub ai_canonname: * mut :: c_char,
40
+
41
+ #[ cfg( not( target_arch = "xtensa" ) ) ]
35
42
pub ai_addr: * mut sockaddr,
43
+
36
44
pub ai_next: * mut addrinfo,
37
45
}
38
46
@@ -364,11 +372,6 @@ pub const O_NONBLOCK: ::c_int = 16384;
364
372
pub const O_ACCMODE : :: c_int = 3 ;
365
373
pub const O_CLOEXEC : :: c_int = 0x80000 ;
366
374
367
- pub const POLLIN : :: c_short = 0x1 ;
368
- pub const POLLPRI : :: c_short = 0x2 ;
369
- pub const POLLERR : :: c_short = 0x8 ;
370
- pub const POLLNVAL : :: c_short = 0x20 ;
371
-
372
375
pub const RTLD_LAZY : :: c_int = 0x1 ;
373
376
374
377
pub const STDIN_FILENO : :: c_int = 0 ;
@@ -379,7 +382,6 @@ pub const SEEK_SET: ::c_int = 0;
379
382
pub const SEEK_CUR : :: c_int = 1 ;
380
383
pub const SEEK_END : :: c_int = 2 ;
381
384
382
- pub const FIONBIO : :: c_ulong = 1 ;
383
385
pub const FIOCLEX : :: c_ulong = 0x20006601 ;
384
386
pub const FIONCLEX : :: c_ulong = 0x20006602 ;
385
387
@@ -406,7 +408,6 @@ pub const S_IROTH: ::mode_t = 4;
406
408
pub const S_IWOTH : :: mode_t = 2 ;
407
409
pub const S_IXOTH : :: mode_t = 1 ;
408
410
409
- pub const SOL_SOCKET : :: c_int = 65535 ;
410
411
pub const SOL_TCP : :: c_int = 6 ;
411
412
412
413
pub const PF_UNSPEC : :: c_int = 0 ;
@@ -547,6 +548,9 @@ pub const EAI_MEMORY: ::c_int = -304;
547
548
pub const EAI_NONAME : :: c_int = -305 ;
548
549
pub const EAI_SOCKTYPE : :: c_int = -307 ;
549
550
551
+ pub const EXIT_SUCCESS : :: c_int = 0 ;
552
+ pub const EXIT_FAILURE : :: c_int = 1 ;
553
+
550
554
pub const PRIO_PROCESS : :: c_int = 0 ;
551
555
pub const PRIO_PGRP : :: c_int = 1 ;
552
556
pub const PRIO_USER : :: c_int = 2 ;
@@ -702,6 +706,9 @@ cfg_if! {
702
706
} else if #[ cfg( target_arch = "aarch64" ) ] {
703
707
mod aarch64;
704
708
pub use self :: aarch64:: * ;
709
+ } else if #[ cfg( target_arch = "xtensa" ) ] {
710
+ mod xtensa;
711
+ pub use self :: xtensa:: * ;
705
712
} else {
706
713
// Only tested on ARM so far. Other platforms might have different
707
714
// definitions for types and constants.
0 commit comments