@@ -175,7 +175,7 @@ extern {}
175
175
#[ cfg( all( target_os = "nacl" , not( feature = "cargo-build" ) , not( test) ) ) ]
176
176
#[ link( name = "pnaclmm" , kind = "static" ) ]
177
177
extern { }
178
-
178
+
179
179
#[ cfg( target_os = "haiku" ) ]
180
180
#[ link( name = "root" ) ]
181
181
#[ link( name = "network" ) ]
@@ -2426,17 +2426,18 @@ pub mod types {
2426
2426
}
2427
2427
}
2428
2428
}
2429
-
2429
+
2430
2430
#[ cfg( target_os = "haiku" ) ]
2431
2431
pub mod os {
2432
2432
pub mod common {
2433
2433
pub mod posix01 {
2434
2434
use types:: common:: c95:: { c_void} ;
2435
2435
use types:: os:: arch:: c95:: { c_char, c_int, size_t,
2436
2436
time_t, suseconds_t, c_long} ;
2437
+ use types:: os:: arch:: c99:: { uintptr_t} ;
2437
2438
2438
- pub type pthread_t = u32 ;
2439
- pub type rlim_t = u32 ;
2439
+ pub type pthread_t = uintptr_t ;
2440
+ pub type rlim_t = uintptr_t ;
2440
2441
2441
2442
#[ repr( C ) ]
2442
2443
#[ derive( Copy , Clone ) ] pub struct glob_t {
@@ -2468,31 +2469,31 @@ pub mod types {
2468
2469
}
2469
2470
2470
2471
pub enum timezone { }
2471
-
2472
- // TODO : find whether this definition is correct
2472
+
2473
+ // FIXME : find whether this definition is correct
2473
2474
pub type sighandler_t = size_t ;
2474
-
2475
+
2475
2476
#[ repr( C ) ]
2476
2477
#[ derive( Copy , Clone ) ]
2477
2478
pub struct rlimit {
2478
- pub rlim_cur : rlim_t ,
2479
- pub rlim_max : rlim_t ,
2479
+ pub rlim_cur : rlim_t ,
2480
+ pub rlim_max : rlim_t ,
2480
2481
}
2481
2482
}
2482
-
2483
+
2483
2484
pub mod bsd43 {
2484
2485
use types:: os:: common:: posix01:: timeval;
2485
-
2486
+
2486
2487
#[ repr( C ) ]
2487
2488
#[ derive( Copy , Clone ) ]
2488
2489
pub struct rusage {
2489
2490
pub ru_utime : timeval ,
2490
2491
pub ru_stime : timeval ,
2491
2492
}
2492
2493
}
2493
-
2494
+
2494
2495
pub mod bsd44 {
2495
- use core:: clone:: Clone ;
2496
+ use core:: clone:: Clone ;
2496
2497
use types:: os:: arch:: c95:: { c_char, c_int, c_uint} ;
2497
2498
2498
2499
pub type socklen_t = u32 ;
@@ -2514,7 +2515,7 @@ pub mod types {
2514
2515
pub __ss_pad2 : [ u8 ; 112 ] ,
2515
2516
}
2516
2517
impl Clone for sockaddr_storage {
2517
- fn clone ( & self ) -> sockaddr_storage { * self }
2518
+ fn clone ( & self ) -> sockaddr_storage { * self }
2518
2519
}
2519
2520
#[ repr( C ) ]
2520
2521
#[ derive( Copy , Clone ) ] pub struct sockaddr_in {
@@ -2569,11 +2570,102 @@ pub mod types {
2569
2570
pub sun_path : [ c_char ; 126 ]
2570
2571
}
2571
2572
impl Clone for sockaddr_un {
2572
- fn clone ( & self ) -> sockaddr_un { * self }
2573
+ fn clone ( & self ) -> sockaddr_un { * self }
2574
+ }
2575
+ }
2576
+ }
2577
+
2578
+ #[ cfg( target_arch = "x86_64" ) ]
2579
+ pub mod arch {
2580
+ pub mod c95 {
2581
+ pub type c_char = i8 ;
2582
+ pub type c_schar = i8 ;
2583
+ pub type c_uchar = u8 ;
2584
+ pub type c_short = i16 ;
2585
+ pub type c_ushort = u16 ;
2586
+ pub type c_int = i32 ;
2587
+ pub type c_uint = u32 ;
2588
+ pub type c_long = i64 ;
2589
+ pub type c_ulong = u64 ;
2590
+ pub type c_float = f32 ;
2591
+ pub type c_double = f64 ;
2592
+ pub type size_t = u64 ;
2593
+ pub type ptrdiff_t = i64 ;
2594
+ pub type clock_t = i32 ;
2595
+ pub type time_t = i32 ;
2596
+ pub type suseconds_t = i32 ;
2597
+ pub type wchar_t = i32 ;
2598
+ }
2599
+ pub mod c99 {
2600
+ pub type c_longlong = i64 ;
2601
+ pub type c_ulonglong = u64 ;
2602
+ pub type intptr_t = i64 ;
2603
+ pub type uintptr_t = u64 ;
2604
+ pub type intmax_t = i64 ;
2605
+ pub type uintmax_t = u64 ;
2606
+ }
2607
+ pub mod posix88 {
2608
+ pub type off_t = i64 ;
2609
+ pub type dev_t = i32 ;
2610
+ pub type ino_t = i64 ;
2611
+ pub type pid_t = i32 ;
2612
+ pub type uid_t = u32 ;
2613
+ pub type gid_t = u32 ;
2614
+ pub type useconds_t = u32 ;
2615
+ pub type mode_t = u32 ;
2616
+ pub type ssize_t = i64 ;
2617
+ }
2618
+ pub mod posix01 {
2619
+ use types:: common:: c95:: { c_void} ;
2620
+ use types:: os:: arch:: c95:: { time_t, c_long} ;
2621
+ use types:: os:: arch:: posix88:: { dev_t, gid_t, ino_t} ;
2622
+ use types:: os:: arch:: posix88:: { mode_t, off_t} ;
2623
+ use types:: os:: arch:: posix88:: { uid_t} ;
2624
+
2625
+ pub type nlink_t = i32 ;
2626
+ pub type blksize_t = i32 ;
2627
+ pub type blkcnt_t = i64 ;
2628
+
2629
+ #[ repr( C ) ]
2630
+ #[ derive( Copy , Clone ) ] pub struct stat {
2631
+ pub st_dev : dev_t ,
2632
+ pub st_ino : ino_t ,
2633
+ pub st_mode : mode_t ,
2634
+ pub st_nlink : nlink_t ,
2635
+ pub st_uid : uid_t ,
2636
+ pub st_gid : gid_t ,
2637
+ pub st_size : off_t ,
2638
+ pub st_rdev : dev_t ,
2639
+ pub st_blksize : blksize_t ,
2640
+ pub st_atime : time_t ,
2641
+ pub st_atime_nsec : c_long ,
2642
+ pub st_mtime : time_t ,
2643
+ pub st_mtime_nsec : c_long ,
2644
+ pub st_ctime : time_t ,
2645
+ pub st_ctime_nsec : c_long ,
2646
+ pub st_crtime : time_t ,
2647
+ pub st_crtime_nsec : c_long ,
2648
+ pub st_type : u32 ,
2649
+ pub st_blocks : blkcnt_t ,
2573
2650
}
2651
+
2652
+ #[ repr( C ) ]
2653
+ #[ derive( Copy , Clone ) ] pub struct utimbuf {
2654
+ pub actime : time_t ,
2655
+ pub modtime : time_t ,
2656
+ }
2657
+
2658
+ pub type pthread_attr_t = * mut c_void ;
2659
+ }
2660
+ pub mod posix08 {
2661
+ }
2662
+ pub mod bsd44 {
2663
+ }
2664
+ pub mod extra {
2574
2665
}
2575
2666
}
2576
-
2667
+
2668
+ #[ cfg( target_arch = "x86" ) ]
2577
2669
pub mod arch {
2578
2670
pub mod c95 {
2579
2671
pub type c_char = i8 ;
@@ -2614,7 +2706,8 @@ pub mod types {
2614
2706
pub type ssize_t = i32 ;
2615
2707
}
2616
2708
pub mod posix01 {
2617
- use types:: os:: arch:: c95:: { time_t} ;
2709
+ use types:: common:: c95:: { c_void} ;
2710
+ use types:: os:: arch:: c95:: { time_t, c_long} ;
2618
2711
use types:: os:: arch:: posix88:: { dev_t, gid_t, ino_t} ;
2619
2712
use types:: os:: arch:: posix88:: { mode_t, off_t} ;
2620
2713
use types:: os:: arch:: posix88:: { uid_t} ;
@@ -2635,27 +2728,24 @@ pub mod types {
2635
2728
pub st_rdev : dev_t ,
2636
2729
pub st_blksize : blksize_t ,
2637
2730
pub st_atime : time_t ,
2638
- pub st_atime_nsec : i32 ,
2731
+ pub st_atime_nsec : c_long ,
2639
2732
pub st_mtime : time_t ,
2640
- pub st_mtime_nsec : i32 ,
2733
+ pub st_mtime_nsec : c_long ,
2641
2734
pub st_ctime : time_t ,
2642
- pub st_ctime_nsec : i32 ,
2735
+ pub st_ctime_nsec : c_long ,
2643
2736
pub st_crtime : time_t ,
2644
- pub st_crtime_nsec : i32 ,
2737
+ pub st_crtime_nsec : c_long ,
2645
2738
pub st_type : u32 ,
2646
2739
pub st_blocks : blkcnt_t ,
2647
2740
}
2648
-
2741
+
2649
2742
#[ repr( C ) ]
2650
2743
#[ derive( Copy , Clone ) ] pub struct utimbuf {
2651
2744
pub actime : time_t ,
2652
2745
pub modtime : time_t ,
2653
2746
}
2654
2747
2655
- #[ repr( C ) ]
2656
- #[ derive( Copy , Clone ) ] pub struct pthread_attr_t {
2657
- pub __size : [ u32 ; 4 ]
2658
- }
2748
+ pub type pthread_attr_t = * mut c_void ;
2659
2749
}
2660
2750
pub mod posix08 {
2661
2751
}
@@ -5468,7 +5558,7 @@ pub mod consts {
5468
5558
pub const _SC_PASS_MAX : c_int = 131 ;
5469
5559
}
5470
5560
}
5471
-
5561
+
5472
5562
#[ cfg( target_os = "haiku" ) ]
5473
5563
pub mod os {
5474
5564
pub mod c95 {
@@ -5546,7 +5636,8 @@ pub mod consts {
5546
5636
pub const PROT_WRITE : c_int = 2 ;
5547
5637
pub const PROT_EXEC : c_int = 4 ;
5548
5638
5549
- pub const MAP_FILE : c_int = 0x00 ; // Warning: Haiku does not have a MAP_FILE, but libstd/os.rs requires it
5639
+ // Warning: Haiku does not have a MAP_FILE, but libstd/os.rs requires it
5640
+ pub const MAP_FILE : c_int = 0x00 ;
5550
5641
pub const MAP_SHARED : c_int = 0x01 ;
5551
5642
pub const MAP_PRIVATE : c_int = 0x02 ;
5552
5643
pub const MAP_FIXED : c_int = 0x04 ;
@@ -5672,7 +5763,7 @@ pub mod consts {
5672
5763
pub const F_SETFD : c_int = 0x0004 ;
5673
5764
pub const F_GETFL : c_int = 0x0008 ;
5674
5765
pub const F_SETFL : c_int = 0x0010 ;
5675
-
5766
+
5676
5767
pub const FD_CLOEXEC : c_int = 1 ;
5677
5768
5678
5769
pub const SIGTRAP : c_int = 22 ;
@@ -5723,7 +5814,7 @@ pub mod consts {
5723
5814
5724
5815
pub const CLOCK_REALTIME : c_int = -1 ;
5725
5816
pub const CLOCK_MONOTONIC : c_int = 0 ;
5726
-
5817
+
5727
5818
pub const RLIMIT_CORE : c_int = 0 ;
5728
5819
pub const RLIMIT_CPU : c_int = 1 ;
5729
5820
pub const RLIMIT_DATA : c_int = 2 ;
@@ -5733,20 +5824,20 @@ pub mod consts {
5733
5824
pub const RLIMIT_AS : c_int = 6 ;
5734
5825
// Haiku specific
5735
5826
pub const RLIMIT_NOVMON : c_int = 7 ;
5736
-
5827
+
5737
5828
pub const RLIMIT_NLIMITS : c_int = 8 ;
5738
5829
pub const RLIM_INFINITY : rlim_t = 0xffffffff ;
5739
5830
pub const RLIM_SAVED_MAX : rlim_t = RLIM_INFINITY ;
5740
5831
pub const RLIM_SAVED_CUR : rlim_t = RLIM_INFINITY ;
5741
-
5832
+
5742
5833
pub const RUSAGE_SELF : c_int = 0 ;
5743
5834
pub const RUSAGE_CHILDREN : c_int = -1 ;
5744
5835
}
5745
5836
pub mod posix08 {
5746
5837
}
5747
5838
pub mod bsd44 {
5748
5839
use types:: os:: arch:: c95:: c_int;
5749
-
5840
+
5750
5841
// In Haiku these are prefixed with POSIX_
5751
5842
pub const MADV_NORMAL : c_int = 1 ;
5752
5843
pub const MADV_RANDOM : c_int = 3 ;
@@ -6762,7 +6853,7 @@ pub mod funcs {
6762
6853
#[ cfg( target_os = "windows" ) ]
6763
6854
pub mod bsd44 {
6764
6855
}
6765
-
6856
+
6766
6857
#[ cfg( target_os = "haiku" ) ]
6767
6858
pub mod bsd44 {
6768
6859
use types:: os:: arch:: c95:: { c_int, c_ulong} ;
0 commit comments