Skip to content

Commit 67e6410

Browse files
committed
Track Rust master
1 parent 05b3bb1 commit 67e6410

File tree

9 files changed

+52
-112
lines changed

9 files changed

+52
-112
lines changed

src/errno.rs

Lines changed: 38 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -287,152 +287,115 @@ impl SysError {
287287
#[cfg(target_os = "linux")]
288288
EHWPOISON => "Memory page has hardware error",
289289

290-
#[cfg(target_os = "macos")]
291-
#[cfg(target_os = "ios")]
290+
#[cfg(any(target_os = "macos", target_os = "ios"))]
292291
ENOTSUP => "Operation not supported",
293292

294-
#[cfg(target_os = "macos")]
295-
#[cfg(target_os = "ios")]
293+
#[cfg(any(target_os = "macos", target_os = "ios"))]
296294
EPROCLIM => "Too many processes",
297295

298-
#[cfg(target_os = "macos")]
299-
#[cfg(target_os = "ios")]
296+
#[cfg(any(target_os = "macos", target_os = "ios"))]
300297
EUSERS => "Too many users",
301298

302-
#[cfg(target_os = "macos")]
303-
#[cfg(target_os = "ios")]
299+
#[cfg(any(target_os = "macos", target_os = "ios"))]
304300
EDQUOT => "Disc quota exceeded",
305301

306-
#[cfg(target_os = "macos")]
307-
#[cfg(target_os = "ios")]
302+
#[cfg(any(target_os = "macos", target_os = "ios"))]
308303
ESTALE => "Stale NFS file handle",
309304

310-
#[cfg(target_os = "macos")]
311-
#[cfg(target_os = "ios")]
305+
#[cfg(any(target_os = "macos", target_os = "ios"))]
312306
EREMOTE => "Stale NFS file handle",
313307

314-
#[cfg(target_os = "macos")]
315-
#[cfg(target_os = "ios")]
308+
#[cfg(any(target_os = "macos", target_os = "ios"))]
316309
EBADRPC => "RPC struct is bad",
317310

318-
#[cfg(target_os = "macos")]
319-
#[cfg(target_os = "ios")]
311+
#[cfg(any(target_os = "macos", target_os = "ios"))]
320312
ERPCMISMATCH => "RPC version wrong",
321313

322-
#[cfg(target_os = "macos")]
323-
#[cfg(target_os = "ios")]
314+
#[cfg(any(target_os = "macos", target_os = "ios"))]
324315
EPROGUNAVAIL => "RPC prog. not avail",
325316

326-
#[cfg(target_os = "macos")]
327-
#[cfg(target_os = "ios")]
317+
#[cfg(any(target_os = "macos", target_os = "ios"))]
328318
EPROGMISMATCH => "Program version wrong",
329319

330-
#[cfg(target_os = "macos")]
331-
#[cfg(target_os = "ios")]
320+
#[cfg(any(target_os = "macos", target_os = "ios"))]
332321
EPROCUNAVAIL => "Bad procedure for program",
333322

334-
#[cfg(target_os = "macos")]
335-
#[cfg(target_os = "ios")]
323+
#[cfg(any(target_os = "macos", target_os = "ios"))]
336324
EFTYPE => "Inappropriate file type or format",
337325

338-
#[cfg(target_os = "macos")]
339-
#[cfg(target_os = "ios")]
326+
#[cfg(any(target_os = "macos", target_os = "ios"))]
340327
EAUTH => "Authentication error",
341328

342-
#[cfg(target_os = "macos")]
343-
#[cfg(target_os = "ios")]
329+
#[cfg(any(target_os = "macos", target_os = "ios"))]
344330
ENEEDAUTH => "Need authenticator",
345331

346-
#[cfg(target_os = "macos")]
347-
#[cfg(target_os = "ios")]
332+
#[cfg(any(target_os = "macos", target_os = "ios"))]
348333
EPWROFF => "Device power is off",
349334

350-
#[cfg(target_os = "macos")]
351-
#[cfg(target_os = "ios")]
335+
#[cfg(any(target_os = "macos", target_os = "ios"))]
352336
EDEVERR => "Device error, e.g. paper out",
353337

354-
#[cfg(target_os = "macos")]
355-
#[cfg(target_os = "ios")]
338+
#[cfg(any(target_os = "macos", target_os = "ios"))]
356339
EOVERFLOW => "Value too large to be stored in data type",
357340

358-
#[cfg(target_os = "macos")]
359-
#[cfg(target_os = "ios")]
341+
#[cfg(any(target_os = "macos", target_os = "ios"))]
360342
EBADEXEC => "Bad executable",
361343

362-
#[cfg(target_os = "macos")]
363-
#[cfg(target_os = "ios")]
344+
#[cfg(any(target_os = "macos", target_os = "ios"))]
364345
EBADARCH => "Bad CPU type in executable",
365346

366-
#[cfg(target_os = "macos")]
367-
#[cfg(target_os = "ios")]
347+
#[cfg(any(target_os = "macos", target_os = "ios"))]
368348
ESHLIBVERS => "Shared library version mismatch",
369349

370-
#[cfg(target_os = "macos")]
371-
#[cfg(target_os = "ios")]
350+
#[cfg(any(target_os = "macos", target_os = "ios"))]
372351
EBADMACHO => "Malformed Macho file",
373352

374-
#[cfg(target_os = "macos")]
375-
#[cfg(target_os = "ios")]
353+
#[cfg(any(target_os = "macos", target_os = "ios"))]
376354
ECANCELED => "Operation canceled",
377355

378-
#[cfg(target_os = "macos")]
379-
#[cfg(target_os = "ios")]
356+
#[cfg(any(target_os = "macos", target_os = "ios"))]
380357
EILSEQ => "Illegal byte sequence",
381358

382-
#[cfg(target_os = "macos")]
383-
#[cfg(target_os = "ios")]
359+
#[cfg(any(target_os = "macos", target_os = "ios"))]
384360
ENOATTR => "Attribute not found",
385361

386-
#[cfg(target_os = "macos")]
387-
#[cfg(target_os = "ios")]
362+
#[cfg(any(target_os = "macos", target_os = "ios"))]
388363
EBADMSG => "Bad message",
389364

390-
#[cfg(target_os = "macos")]
391-
#[cfg(target_os = "ios")]
365+
#[cfg(any(target_os = "macos", target_os = "ios"))]
392366
EMULTIHOP => "Reserved",
393367

394-
#[cfg(target_os = "macos")]
395-
#[cfg(target_os = "ios")]
368+
#[cfg(any(target_os = "macos", target_os = "ios"))]
396369
ENODATA => "No message available on STREAM",
397370

398-
#[cfg(target_os = "macos")]
399-
#[cfg(target_os = "ios")]
371+
#[cfg(any(target_os = "macos", target_os = "ios"))]
400372
ENOLINK => "Reserved",
401373

402-
#[cfg(target_os = "macos")]
403-
#[cfg(target_os = "ios")]
374+
#[cfg(any(target_os = "macos", target_os = "ios"))]
404375
ENOSR => "No STREAM resources",
405376

406-
#[cfg(target_os = "macos")]
407-
#[cfg(target_os = "ios")]
377+
#[cfg(any(target_os = "macos", target_os = "ios"))]
408378
ENOSTR => "Not a STREAM",
409379

410-
#[cfg(target_os = "macos")]
411-
#[cfg(target_os = "ios")]
380+
#[cfg(any(target_os = "macos", target_os = "ios"))]
412381
EPROTO => "Protocol error",
413382

414-
#[cfg(target_os = "macos")]
415-
#[cfg(target_os = "ios")]
383+
#[cfg(any(target_os = "macos", target_os = "ios"))]
416384
ETIME => "STREAM ioctl timeout",
417385

418-
#[cfg(target_os = "macos")]
419-
#[cfg(target_os = "ios")]
386+
#[cfg(any(target_os = "macos", target_os = "ios"))]
420387
EOPNOTSUPP => "Operation not supported on socket",
421388

422-
#[cfg(target_os = "macos")]
423-
#[cfg(target_os = "ios")]
389+
#[cfg(any(target_os = "macos", target_os = "ios"))]
424390
ENOPOLICY => "No such policy registered",
425391

426-
#[cfg(target_os = "macos")]
427-
#[cfg(target_os = "ios")]
392+
#[cfg(any(target_os = "macos", target_os = "ios"))]
428393
ENOTRECOVERABLE => "State not recoverable",
429394

430-
#[cfg(target_os = "macos")]
431-
#[cfg(target_os = "ios")]
395+
#[cfg(any(target_os = "macos", target_os = "ios"))]
432396
EOWNERDEAD => "Previous owner died",
433397

434-
#[cfg(target_os = "macos")]
435-
#[cfg(target_os = "ios")]
398+
#[cfg(any(target_os = "macos", target_os = "ios"))]
436399
EQFULL => "Interface output queue is full",
437400
}
438401
}
@@ -596,8 +559,7 @@ mod consts {
596559
pub static EDEADLOCK: Errno = EDEADLK;
597560
}
598561

599-
#[cfg(target_os = "macos")]
600-
#[cfg(target_os = "ios")]
562+
#[cfg(any(target_os = "macos", target_os = "ios"))]
601563
mod consts {
602564
#[deriving(Show, Clone, PartialEq, FromPrimitive)]
603565
pub enum Errno {

src/fcntl.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ mod ffi {
4040
pub static F_GETLK: c_int = 5;
4141
}
4242

43-
#[cfg(target_os = "macos")]
44-
#[cfg(target_os = "ios")]
43+
#[cfg(any(target_os = "macos", target_os = "ios"))]
4544
mod os {
4645
use libc::{c_int, c_short, off_t, pid_t};
4746

@@ -153,8 +152,7 @@ mod consts {
153152
)
154153
}
155154

156-
#[cfg(target_os = "macos")]
157-
#[cfg(target_os = "ios")]
155+
#[cfg(any(target_os = "macos", target_os = "ios"))]
158156
mod consts {
159157
use libc::c_int;
160158

src/features.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ mod os {
77
}
88
}
99

10-
#[cfg(target_os = "macos")]
11-
#[cfg(target_os = "ios")]
10+
#[cfg(any(target_os = "macos", target_os = "ios"))]
1211
mod os {
1312
pub fn atomic_cloexec() -> bool {
1413
false

src/lib.rs

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![crate_name = "nix"]
2+
23
#![feature(globs)]
34
#![feature(linkage)]
45
#![allow(non_camel_case_types)]
@@ -8,21 +9,16 @@ extern crate libc;
89
// Re-export some libc constants
910
pub use libc::{c_int, c_void};
1011

12+
#[cfg(unix)]
1113
pub use errno::{SysResult, SysError};
1214

13-
#[cfg(target_os = "linux")]
14-
#[cfg(target_os = "macos")]
15-
#[cfg(target_os = "ios")]
15+
#[cfg(unix)]
1616
pub mod errno;
1717

18-
#[cfg(target_os = "linux")]
19-
#[cfg(target_os = "macos")]
20-
#[cfg(target_os = "ios")]
18+
#[cfg(unix)]
2119
pub mod features;
2220

23-
#[cfg(target_os = "linux")]
24-
#[cfg(target_os = "macos")]
25-
#[cfg(target_os = "ios")]
21+
#[cfg(unix)]
2622
pub mod fcntl;
2723

2824
#[cfg(target_os = "linux")]
@@ -31,15 +27,11 @@ pub mod mount;
3127
#[cfg(target_os = "linux")]
3228
pub mod sched;
3329

34-
#[cfg(target_os = "linux")]
35-
#[cfg(target_os = "macos")]
36-
#[cfg(target_os = "ios")]
30+
#[cfg(unix)]
3731
pub mod sys;
3832

3933
#[cfg(target_os = "linux")]
4034
pub mod syscall;
4135

42-
#[cfg(target_os = "linux")]
43-
#[cfg(target_os = "macos")]
44-
#[cfg(target_os = "ios")]
36+
#[cfg(unix)]
4537
pub mod unistd;

src/sched.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![cfg(target_os = "linux")]
2-
31
use std::mem;
42
use libc::{c_int, c_uint, c_void};
53
use super::{SysResult, SysError};

src/sys/mod.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,12 @@
22
#[cfg(target_os = "linux")]
33
pub mod epoll;
44

5-
#[cfg(target_os = "macos")]
6-
#[cfg(target_os = "ios")]
5+
#[cfg(any(target_os = "macos", target_os = "ios"))]
76
pub mod event;
87

98
#[cfg(target_os = "linux")]
109
pub mod eventfd;
1110

12-
#[cfg(target_os = "linux")]
13-
#[cfg(target_os = "macos")]
14-
#[cfg(target_os = "ios")]
1511
pub mod socket;
1612

1713
#[cfg(target_os = "linux")]

src/sys/socket.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ mod consts {
9797
pub static SO_BUSY_POLL: SockOpt = 46;
9898
}
9999

100-
#[cfg(target_os = "macos")]
101-
#[cfg(target_os = "ios")]
100+
#[cfg(any(target_os = "macos", target_os = "ios"))]
102101
mod consts {
103102
use libc::{c_int};
104103

@@ -255,8 +254,7 @@ pub fn accept4(sockfd: Fd, flags: SockFlag) -> SysResult<Fd> {
255254
Ok(res)
256255
}
257256

258-
#[cfg(target_os = "macos")]
259-
#[cfg(target_os = "ios")]
257+
#[cfg(any(target_os = "macos", target_os = "ios"))]
260258
pub fn accept4(sockfd: Fd, flags: SockFlag) -> SysResult<Fd> {
261259
let res = unsafe { ffi::accept(sockfd, ptr::null_mut(), ptr::null_mut()) };
262260

src/syscall.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![cfg(target_os = "linux")]
2-
31
use libc::c_int;
42

53
pub use self::arch::*;

src/unistd.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,7 @@ pub fn pipe2(flags: OFlag) -> SysResult<(Fd, Fd)> {
238238
}
239239
}
240240

241-
#[cfg(target_os = "macos")]
242-
#[cfg(target_os = "ios")]
241+
#[cfg(any(target_os = "macos", target_os = "ios"))]
243242
pub fn pipe2(flags: OFlag) -> SysResult<(Fd, Fd)> {
244243
unsafe {
245244
let mut res;

0 commit comments

Comments
 (0)