Skip to content

Commit 7b199bb

Browse files
pfmooneycpu
authored andcommitted
Clean up unnecessary cfg_attr attributes
1 parent 59ac711 commit 7b199bb

File tree

9 files changed

+22
-117
lines changed

9 files changed

+22
-117
lines changed

src/unix/bsd/freebsdlike/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1245,7 +1245,6 @@ extern "C" {
12451245
buflen: ::size_t,
12461246
result: *mut *mut ::group,
12471247
) -> ::c_int;
1248-
#[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")]
12491248
pub fn getpwent_r(
12501249
pwd: *mut ::passwd,
12511250
buf: *mut ::c_char,

src/unix/bsd/mod.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,6 @@ extern "C" {
686686
) -> ::ssize_t;
687687

688688
pub fn sync();
689-
#[cfg_attr(target_os = "solaris", link_name = "__posix_getgrgid_r")]
690689
pub fn getgrgid_r(
691690
gid: ::gid_t,
692691
grp: *mut ::group,
@@ -702,7 +701,6 @@ extern "C" {
702701
pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int;
703702
pub fn sem_close(sem: *mut sem_t) -> ::c_int;
704703
pub fn getdtablesize() -> ::c_int;
705-
#[cfg_attr(target_os = "solaris", link_name = "__posix_getgrnam_r")]
706704
pub fn getgrnam_r(
707705
name: *const ::c_char,
708706
grp: *mut ::group,
@@ -729,7 +727,6 @@ extern "C" {
729727
pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
730728
pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
731729
#[cfg_attr(target_os = "netbsd", link_name = "__getpwnam_r50")]
732-
#[cfg_attr(target_os = "solaris", link_name = "__posix_getpwnam_r")]
733730
pub fn getpwnam_r(
734731
name: *const ::c_char,
735732
pwd: *mut passwd,
@@ -738,7 +735,6 @@ extern "C" {
738735
result: *mut *mut passwd,
739736
) -> ::c_int;
740737
#[cfg_attr(target_os = "netbsd", link_name = "__getpwuid_r50")]
741-
#[cfg_attr(target_os = "solaris", link_name = "__posix_getpwuid_r")]
742738
pub fn getpwuid_r(
743739
uid: ::uid_t,
744740
pwd: *mut passwd,
@@ -750,7 +746,6 @@ extern "C" {
750746
all(target_os = "macos", target_arch = "x86"),
751747
link_name = "sigwait$UNIX2003"
752748
)]
753-
#[cfg_attr(target_os = "solaris", link_name = "__posix_sigwait")]
754749
pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int;
755750
pub fn pthread_atfork(
756751
prepare: ::Option<unsafe extern "C" fn()>,

src/unix/linux_like/android/mod.rs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2349,33 +2349,22 @@ extern "C" {
23492349
pub fn setfsgid(gid: ::gid_t) -> ::c_int;
23502350
pub fn setfsuid(uid: ::uid_t) -> ::c_int;
23512351
pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
2352-
#[cfg_attr(target_os = "solaris", link_name = "__posix_getgrgid_r")]
23532352
pub fn getgrgid_r(
23542353
gid: ::gid_t,
23552354
grp: *mut ::group,
23562355
buf: *mut ::c_char,
23572356
buflen: ::size_t,
23582357
result: *mut *mut ::group,
23592358
) -> ::c_int;
2360-
#[cfg_attr(
2361-
all(target_os = "macos", target_arch = "x86"),
2362-
link_name = "sigaltstack$UNIX2003"
2363-
)]
2364-
#[cfg_attr(target_os = "netbsd", link_name = "__sigaltstack14")]
23652359
pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int;
23662360
pub fn sem_close(sem: *mut sem_t) -> ::c_int;
2367-
#[cfg_attr(target_os = "solaris", link_name = "__posix_getgrnam_r")]
23682361
pub fn getgrnam_r(
23692362
name: *const ::c_char,
23702363
grp: *mut ::group,
23712364
buf: *mut ::c_char,
23722365
buflen: ::size_t,
23732366
result: *mut *mut ::group,
23742367
) -> ::c_int;
2375-
#[cfg_attr(
2376-
all(target_os = "macos", target_arch = "x86"),
2377-
link_name = "pthread_sigmask$UNIX2003"
2378-
)]
23792368
pub fn pthread_sigmask(
23802369
how: ::c_int,
23812370
set: *const sigset_t,
@@ -2386,29 +2375,20 @@ extern "C" {
23862375
pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
23872376
pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
23882377
pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
2389-
#[cfg_attr(target_os = "netbsd", link_name = "__getpwnam_r50")]
2390-
#[cfg_attr(target_os = "solaris", link_name = "__posix_getpwnam_r")]
23912378
pub fn getpwnam_r(
23922379
name: *const ::c_char,
23932380
pwd: *mut passwd,
23942381
buf: *mut ::c_char,
23952382
buflen: ::size_t,
23962383
result: *mut *mut passwd,
23972384
) -> ::c_int;
2398-
#[cfg_attr(target_os = "netbsd", link_name = "__getpwuid_r50")]
2399-
#[cfg_attr(target_os = "solaris", link_name = "__posix_getpwuid_r")]
24002385
pub fn getpwuid_r(
24012386
uid: ::uid_t,
24022387
pwd: *mut passwd,
24032388
buf: *mut ::c_char,
24042389
buflen: ::size_t,
24052390
result: *mut *mut passwd,
24062391
) -> ::c_int;
2407-
#[cfg_attr(
2408-
all(target_os = "macos", target_arch = "x86"),
2409-
link_name = "sigwait$UNIX2003"
2410-
)]
2411-
#[cfg_attr(target_os = "solaris", link_name = "__posix_sigwait")]
24122392
pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int;
24132393
pub fn pthread_atfork(
24142394
prepare: ::Option<unsafe extern "C" fn()>,
@@ -2427,10 +2407,6 @@ extern "C" {
24272407
attr: *const pthread_mutexattr_t,
24282408
pshared: *mut ::c_int,
24292409
) -> ::c_int;
2430-
#[cfg_attr(
2431-
all(target_os = "macos", target_arch = "x86"),
2432-
link_name = "popen$UNIX2003"
2433-
)]
24342410
pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
24352411
pub fn faccessat(
24362412
dirfd: ::c_int,

src/unix/linux_like/linux/align.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ macro_rules! expand_align {
3939
#[doc(hidden)]
4040
size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
4141
}
42+
43+
#[repr(align(8))]
44+
pub struct fanotify_event_metadata {
45+
pub event_len: __u32,
46+
pub vers: __u8,
47+
pub reserved: __u8,
48+
pub metadata_len: __u16,
49+
pub mask: __u64,
50+
pub fd: ::c_int,
51+
pub pid: ::c_int,
52+
}
4253
}
4354

4455
s_no_extra_traits! {

src/unix/linux_like/linux/gnu/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,16 +1268,12 @@ extern "C" {
12681268
pub fn sched_getcpu() -> ::c_int;
12691269
pub fn mallinfo() -> ::mallinfo;
12701270
pub fn malloc_usable_size(ptr: *mut ::c_void) -> ::size_t;
1271-
#[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")]
1272-
#[cfg_attr(target_os = "solaris", link_name = "__posix_getpwent_r")]
12731271
pub fn getpwent_r(
12741272
pwd: *mut ::passwd,
12751273
buf: *mut ::c_char,
12761274
buflen: ::size_t,
12771275
result: *mut *mut ::passwd,
12781276
) -> ::c_int;
1279-
#[cfg_attr(target_os = "netbsd", link_name = "__getgrent_r50")]
1280-
#[cfg_attr(target_os = "solaris", link_name = "__posix_getgrent_r")]
12811277
pub fn getgrent_r(
12821278
grp: *mut ::group,
12831279
buf: *mut ::c_char,

src/unix/linux_like/linux/mod.rs

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -477,17 +477,6 @@ s! {
477477
pub len: u32
478478
}
479479

480-
#[repr(align(8))]
481-
pub struct fanotify_event_metadata {
482-
pub event_len: __u32,
483-
pub vers: __u8,
484-
pub reserved: __u8,
485-
pub metadata_len: __u16,
486-
pub mask: __u64,
487-
pub fd: ::c_int,
488-
pub pid: ::c_int,
489-
}
490-
491480
pub struct fanotify_response {
492481
pub fd: ::c_int,
493482
pub response: __u32,
@@ -3168,23 +3157,16 @@ extern "C" {
31683157
count: ::size_t,
31693158
) -> ::ssize_t;
31703159
pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
3171-
#[cfg_attr(target_os = "solaris", link_name = "__posix_getgrgid_r")]
31723160
pub fn getgrgid_r(
31733161
gid: ::gid_t,
31743162
grp: *mut ::group,
31753163
buf: *mut ::c_char,
31763164
buflen: ::size_t,
31773165
result: *mut *mut ::group,
31783166
) -> ::c_int;
3179-
#[cfg_attr(
3180-
all(target_os = "macos", target_arch = "x86"),
3181-
link_name = "sigaltstack$UNIX2003"
3182-
)]
3183-
#[cfg_attr(target_os = "netbsd", link_name = "__sigaltstack14")]
31843167
pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int;
31853168
pub fn sem_close(sem: *mut sem_t) -> ::c_int;
31863169
pub fn getdtablesize() -> ::c_int;
3187-
#[cfg_attr(target_os = "solaris", link_name = "__posix_getgrnam_r")]
31883170
pub fn getgrnam_r(
31893171
name: *const ::c_char,
31903172
grp: *mut ::group,
@@ -3193,10 +3175,6 @@ extern "C" {
31933175
result: *mut *mut ::group,
31943176
) -> ::c_int;
31953177
pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int;
3196-
#[cfg_attr(
3197-
all(target_os = "macos", target_arch = "x86"),
3198-
link_name = "pthread_sigmask$UNIX2003"
3199-
)]
32003178
pub fn pthread_sigmask(
32013179
how: ::c_int,
32023180
set: *const sigset_t,
@@ -3208,29 +3186,20 @@ extern "C" {
32083186
pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
32093187
pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
32103188
pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
3211-
#[cfg_attr(target_os = "netbsd", link_name = "__getpwnam_r50")]
3212-
#[cfg_attr(target_os = "solaris", link_name = "__posix_getpwnam_r")]
32133189
pub fn getpwnam_r(
32143190
name: *const ::c_char,
32153191
pwd: *mut passwd,
32163192
buf: *mut ::c_char,
32173193
buflen: ::size_t,
32183194
result: *mut *mut passwd,
32193195
) -> ::c_int;
3220-
#[cfg_attr(target_os = "netbsd", link_name = "__getpwuid_r50")]
3221-
#[cfg_attr(target_os = "solaris", link_name = "__posix_getpwuid_r")]
32223196
pub fn getpwuid_r(
32233197
uid: ::uid_t,
32243198
pwd: *mut passwd,
32253199
buf: *mut ::c_char,
32263200
buflen: ::size_t,
32273201
result: *mut *mut passwd,
32283202
) -> ::c_int;
3229-
#[cfg_attr(
3230-
all(target_os = "macos", target_arch = "x86"),
3231-
link_name = "sigwait$UNIX2003"
3232-
)]
3233-
#[cfg_attr(target_os = "solaris", link_name = "__posix_sigwait")]
32343203
pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int;
32353204
pub fn pthread_atfork(
32363205
prepare: ::Option<unsafe extern "C" fn()>,
@@ -3248,10 +3217,6 @@ extern "C" {
32483217
attr: *const pthread_mutexattr_t,
32493218
pshared: *mut ::c_int,
32503219
) -> ::c_int;
3251-
#[cfg_attr(
3252-
all(target_os = "macos", target_arch = "x86"),
3253-
link_name = "popen$UNIX2003"
3254-
)]
32553220
pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
32563221
pub fn faccessat(
32573222
dirfd: ::c_int,

src/unix/linux_like/linux/no_align.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ macro_rules! expand_align {
3535
__align: [::c_int; 0],
3636
size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
3737
}
38+
39+
pub struct fanotify_event_metadata {
40+
__align: [::c_long; 0],
41+
pub event_len: __u32,
42+
pub vers: __u8,
43+
pub reserved: __u8,
44+
pub metadata_len: __u16,
45+
pub mask: __u64,
46+
pub fd: ::c_int,
47+
pub pid: ::c_int,
48+
}
3849
}
3950

4051
s_no_extra_traits! {

src/unix/newlib/mod.rs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -639,34 +639,23 @@ extern "C" {
639639
envp: *const *const ::c_char,
640640
) -> ::c_int;
641641
pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
642-
#[cfg_attr(target_os = "solaris", link_name = "__posix_getgrgid_r")]
643642
pub fn getgrgid_r(
644643
gid: ::gid_t,
645644
grp: *mut ::group,
646645
buf: *mut ::c_char,
647646
buflen: ::size_t,
648647
result: *mut *mut ::group,
649648
) -> ::c_int;
650-
#[cfg_attr(
651-
all(target_os = "macos", target_arch = "x86"),
652-
link_name = "sigaltstack$UNIX2003"
653-
)]
654-
#[cfg_attr(target_os = "netbsd", link_name = "__sigaltstack14")]
655649
pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int;
656650
pub fn sem_close(sem: *mut sem_t) -> ::c_int;
657651
pub fn getdtablesize() -> ::c_int;
658-
#[cfg_attr(target_os = "solaris", link_name = "__posix_getgrnam_r")]
659652
pub fn getgrnam_r(
660653
name: *const ::c_char,
661654
grp: *mut ::group,
662655
buf: *mut ::c_char,
663656
buflen: ::size_t,
664657
result: *mut *mut ::group,
665658
) -> ::c_int;
666-
#[cfg_attr(
667-
all(target_os = "macos", target_arch = "x86"),
668-
link_name = "pthread_sigmask$UNIX2003"
669-
)]
670659
pub fn pthread_sigmask(
671660
how: ::c_int,
672661
set: *const sigset_t,
@@ -677,40 +666,27 @@ extern "C" {
677666
pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
678667
pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
679668
pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
680-
#[cfg_attr(target_os = "netbsd", link_name = "__getpwnam_r50")]
681-
#[cfg_attr(target_os = "solaris", link_name = "__posix_getpwnam_r")]
682669
pub fn getpwnam_r(
683670
name: *const ::c_char,
684671
pwd: *mut passwd,
685672
buf: *mut ::c_char,
686673
buflen: ::size_t,
687674
result: *mut *mut passwd,
688675
) -> ::c_int;
689-
#[cfg_attr(target_os = "netbsd", link_name = "__getpwuid_r50")]
690-
#[cfg_attr(target_os = "solaris", link_name = "__posix_getpwuid_r")]
691676
pub fn getpwuid_r(
692677
uid: ::uid_t,
693678
pwd: *mut passwd,
694679
buf: *mut ::c_char,
695680
buflen: ::size_t,
696681
result: *mut *mut passwd,
697682
) -> ::c_int;
698-
#[cfg_attr(
699-
all(target_os = "macos", target_arch = "x86"),
700-
link_name = "sigwait$UNIX2003"
701-
)]
702-
#[cfg_attr(target_os = "solaris", link_name = "__posix_sigwait")]
703683
pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int;
704684
pub fn pthread_atfork(
705685
prepare: ::Option<unsafe extern "C" fn()>,
706686
parent: ::Option<unsafe extern "C" fn()>,
707687
child: ::Option<unsafe extern "C" fn()>,
708688
) -> ::c_int;
709689
pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
710-
#[cfg_attr(
711-
all(target_os = "macos", target_arch = "x86"),
712-
link_name = "popen$UNIX2003"
713-
)]
714690
pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
715691
pub fn uname(buf: *mut ::utsname) -> ::c_int;
716692
}

0 commit comments

Comments
 (0)