78
78
#![ allow( non_uppercase_statics) ]
79
79
#![ allow( missing_doc) ]
80
80
#![ allow( uppercase_variables) ]
81
+ #![ allow( unused_imports) ]
81
82
82
83
#[ cfg( test) ] extern crate std;
83
84
#[ cfg( test) ] extern crate test;
@@ -151,7 +152,9 @@ pub use funcs::posix88::stat_::{chmod, fstat, mkdir, stat};
151
152
pub use funcs:: posix88:: stdio:: { fdopen, fileno, pclose, popen} ;
152
153
pub use funcs:: posix88:: unistd:: { access, chdir, close, dup, dup2} ;
153
154
pub use funcs:: posix88:: unistd:: { execv, execve, execvp, getcwd} ;
154
- pub use funcs:: posix88:: unistd:: { getpid, isatty, lseek, pipe, read} ;
155
+ pub use funcs:: posix88:: unistd:: { isatty, lseek, pipe, read} ;
156
+ #[ cfg( not( target_os = "nacl" , target_libc = "newlib" ) ) ]
157
+ pub use funcs:: posix88:: unistd:: getpid;
155
158
pub use funcs:: posix88:: unistd:: { rmdir, unlink, write} ;
156
159
157
160
pub use funcs:: bsd43:: { socket, setsockopt, bind, send, recv, recvfrom} ;
@@ -186,13 +189,17 @@ pub use funcs::bsd43::{shutdown};
186
189
#[ cfg( unix) ] pub use types:: os:: arch:: posix88:: { uid_t, gid_t} ;
187
190
#[ cfg( unix) ] pub use types:: os:: arch:: posix01:: { pthread_attr_t} ;
188
191
#[ cfg( unix) ] pub use types:: os:: arch:: posix01:: { stat, utimbuf} ;
189
- #[ cfg( unix) ] pub use funcs:: posix88:: unistd:: { sysconf, setgid, setsid, setuid, pread, pwrite} ;
192
+ #[ cfg( unix, not( target_os = "nacl" , target_libc = "newlib" ) ) ]
193
+ pub use funcs:: posix88:: unistd:: setsid;
194
+ #[ cfg( unix) ] pub use funcs:: posix88:: unistd:: { sysconf, setgid, setuid, pread, pwrite} ;
190
195
#[ cfg( unix) ] pub use funcs:: posix88:: unistd:: { getgid, getuid} ;
191
196
#[ cfg( unix) ] pub use funcs:: posix88:: unistd:: { _PC_NAME_MAX, utime, nanosleep, link} ;
192
197
#[ cfg( unix, not( target_os = "nacl" , target_libc = "newlib" ) ) ]
193
198
pub use funcs:: posix88:: unistd:: pathconf;
194
199
#[ cfg( unix) ] pub use funcs:: posix88:: unistd:: { chown} ;
195
- #[ cfg( unix) ] pub use funcs:: posix88:: mman:: { mmap, munmap, mprotect} ;
200
+ #[ cfg( unix, not( target_os = "nacl" , target_libc = "newlib" ) ) ]
201
+ pub use funcs:: posix88:: mman:: mprotect;
202
+ #[ cfg( unix) ] pub use funcs:: posix88:: mman:: { mmap, munmap} ;
196
203
#[ cfg( unix) ] pub use funcs:: posix88:: dirent:: { opendir, readdir_r, closedir} ;
197
204
#[ cfg( unix) ] pub use funcs:: posix88:: fcntl:: { fcntl} ;
198
205
#[ cfg( unix) ] pub use funcs:: posix01:: stat_:: { lstat} ;
@@ -4084,6 +4091,7 @@ pub mod funcs {
4084
4091
pub fn fstat ( fildes : c_int , buf : * mut stat ) -> c_int ;
4085
4092
4086
4093
pub fn mkdir ( path : * const c_char , mode : mode_t ) -> c_int ;
4094
+ #[ cfg( not( target_os = "nacl" ) ) ]
4087
4095
pub fn mkfifo ( path : * const c_char , mode : mode_t ) -> c_int ;
4088
4096
4089
4097
#[ cfg( target_os = "linux" ) ]
@@ -4165,6 +4173,7 @@ pub mod funcs {
4165
4173
4166
4174
extern {
4167
4175
pub fn access ( path : * const c_char , amode : c_int ) -> c_int ;
4176
+ #[ cfg( not( target_os = "nacl" , target_libc = "newlib" ) ) ]
4168
4177
pub fn alarm ( seconds : c_uint ) -> c_uint ;
4169
4178
pub fn chdir ( dir : * const c_char ) -> c_int ;
4170
4179
pub fn chown ( path : * const c_char , uid : uid_t ,
@@ -4180,18 +4189,23 @@ pub mod funcs {
4180
4189
pub fn execvp ( c : * const c_char ,
4181
4190
argv : * mut * const c_char ) -> c_int ;
4182
4191
pub fn fork ( ) -> pid_t ;
4192
+ #[ cfg( not( target_os = "nacl" , target_libc = "newlib" ) ) ]
4183
4193
pub fn fpathconf ( filedes : c_int , name : c_int ) -> c_long ;
4184
4194
pub fn getcwd ( buf : * mut c_char , size : size_t ) -> * mut c_char ;
4185
4195
pub fn getegid ( ) -> gid_t ;
4186
4196
pub fn geteuid ( ) -> uid_t ;
4187
4197
pub fn getgid ( ) -> gid_t ;
4198
+ #[ cfg( not( target_os = "nacl" , target_libc = "newlib" ) ) ]
4188
4199
pub fn getgroups ( ngroups_max : c_int , groups : * mut gid_t )
4189
4200
-> c_int ;
4190
4201
pub fn getlogin ( ) -> * mut c_char ;
4191
4202
pub fn getopt ( argc : c_int , argv : * mut * const c_char ,
4192
4203
optstr : * const c_char ) -> c_int ;
4204
+ #[ cfg( not( target_os = "nacl" , target_libc = "newlib" ) ) ]
4193
4205
pub fn getpgrp ( ) -> pid_t ;
4206
+ #[ cfg( not( target_os = "nacl" , target_libc = "newlib" ) ) ]
4194
4207
pub fn getpid ( ) -> pid_t ;
4208
+ #[ cfg( not( target_os = "nacl" , target_libc = "newlib" ) ) ]
4195
4209
pub fn getppid ( ) -> pid_t ;
4196
4210
pub fn getuid ( ) -> uid_t ;
4197
4211
pub fn isatty ( fd : c_int ) -> c_int ;
@@ -4200,20 +4214,24 @@ pub mod funcs {
4200
4214
-> off_t ;
4201
4215
#[ cfg( not( target_os = "nacl" , target_libc = "newlib" ) ) ]
4202
4216
pub fn pathconf ( path : * mut c_char , name : c_int ) -> c_long ;
4217
+ #[ cfg( not( target_os = "nacl" , target_libc = "newlib" ) ) ]
4203
4218
pub fn pause ( ) -> c_int ;
4204
4219
pub fn pipe ( fds : * mut c_int ) -> c_int ;
4205
4220
pub fn read ( fd : c_int , buf : * mut c_void , count : size_t )
4206
4221
-> ssize_t ;
4207
4222
pub fn rmdir ( path : * const c_char ) -> c_int ;
4208
4223
pub fn setgid ( gid : gid_t ) -> c_int ;
4224
+ #[ cfg( not( target_os = "nacl" , target_libc = "newlib" ) ) ]
4209
4225
pub fn setpgid ( pid : pid_t , pgid : pid_t ) -> c_int ;
4226
+ #[ cfg( not( target_os = "nacl" , target_libc = "newlib" ) ) ]
4210
4227
pub fn setsid ( ) -> pid_t ;
4211
4228
pub fn setuid ( uid : uid_t ) -> c_int ;
4212
4229
pub fn sleep ( secs : c_uint ) -> c_uint ;
4213
4230
pub fn usleep ( secs : c_uint ) -> c_int ;
4214
4231
pub fn nanosleep ( rqtp : * const timespec ,
4215
4232
rmtp : * mut timespec ) -> c_int ;
4216
4233
pub fn sysconf ( name : c_int ) -> c_long ;
4234
+ #[ cfg( not( target_os = "nacl" , target_libc = "newlib" ) ) ]
4217
4235
pub fn tcgetpgrp ( fd : c_int ) -> pid_t ;
4218
4236
pub fn ttyname ( fd : c_int ) -> * mut c_char ;
4219
4237
pub fn unlink ( c : * const c_char ) -> c_int ;
@@ -4241,12 +4259,24 @@ pub mod funcs {
4241
4259
use types:: os:: arch:: c95:: { size_t, c_int, c_char} ;
4242
4260
use types:: os:: arch:: posix88:: { mode_t, off_t} ;
4243
4261
4262
+ #[ cfg( not( target_os = "nacl" , target_libc = "newlib" ) ) ]
4244
4263
extern {
4245
4264
pub fn mlock ( addr : * const c_void , len : size_t ) -> c_int ;
4246
4265
pub fn munlock ( addr : * const c_void , len : size_t ) -> c_int ;
4247
4266
pub fn mlockall ( flags : c_int ) -> c_int ;
4248
4267
pub fn munlockall ( ) -> c_int ;
4249
4268
4269
+ pub fn mprotect ( addr : * mut c_void , len : size_t , prot : c_int )
4270
+ -> c_int ;
4271
+
4272
+ pub fn msync ( addr : * mut c_void , len : size_t , flags : c_int )
4273
+ -> c_int ;
4274
+ pub fn shm_open ( name : * const c_char , oflag : c_int , mode : mode_t )
4275
+ -> c_int ;
4276
+ pub fn shm_unlink ( name : * const c_char ) -> c_int ;
4277
+ }
4278
+
4279
+ extern {
4250
4280
pub fn mmap ( addr : * mut c_void ,
4251
4281
len : size_t ,
4252
4282
prot : c_int ,
@@ -4256,14 +4286,6 @@ pub mod funcs {
4256
4286
-> * mut c_void ;
4257
4287
pub fn munmap ( addr : * mut c_void , len : size_t ) -> c_int ;
4258
4288
4259
- pub fn mprotect ( addr : * mut c_void , len : size_t , prot : c_int )
4260
- -> c_int ;
4261
-
4262
- pub fn msync ( addr : * mut c_void , len : size_t , flags : c_int )
4263
- -> c_int ;
4264
- pub fn shm_open ( name : * const c_char , oflag : c_int , mode : mode_t )
4265
- -> c_int ;
4266
- pub fn shm_unlink ( name : * const c_char ) -> c_int ;
4267
4289
}
4268
4290
}
4269
4291
}
@@ -4359,6 +4381,7 @@ pub mod funcs {
4359
4381
use types:: common:: c95:: { c_void} ;
4360
4382
use types:: os:: arch:: c95:: { c_int, size_t} ;
4361
4383
4384
+ #[ cfg( not( target_os = "nacl" , target_libc = "newlib" ) ) ]
4362
4385
extern {
4363
4386
pub fn posix_madvise ( addr : * mut c_void ,
4364
4387
len : size_t ,
@@ -4509,7 +4532,6 @@ pub mod funcs {
4509
4532
4510
4533
#[ cfg( target_os = "linux" ) ]
4511
4534
#[ cfg( target_os = "android" ) ]
4512
- #[ cfg( target_os = "nacl" ) ]
4513
4535
pub mod bsd44 {
4514
4536
use types:: common:: c95:: { c_void} ;
4515
4537
use types:: os:: arch:: c95:: { c_uchar, c_int, size_t} ;
@@ -4525,6 +4547,7 @@ pub mod funcs {
4525
4547
4526
4548
4527
4549
#[ cfg( target_os = "win32" ) ]
4550
+ #[ cfg( target_os = "nacl" ) ]
4528
4551
pub mod bsd44 {
4529
4552
}
4530
4553
0 commit comments