Skip to content

Commit 4cc1df9

Browse files
committed
Auto merge of #269 - kamalmarhubi:linux-android-dups, r=alexcrichton
notbsd: Deduplicate definitions A bunch of definitions were duplicated across, eg, android and linux. This commit pulls these up to higher levels where they can be shared.
2 parents ac59d35 + b9750b6 commit 4cc1df9

File tree

6 files changed

+30
-70
lines changed

6 files changed

+30
-70
lines changed

src/unix/notbsd/android/mod.rs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -648,30 +648,7 @@ extern {
648648
serv: *mut ::c_char,
649649
sevlen: ::size_t,
650650
flags: ::c_int) -> ::c_int;
651-
pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
652651
pub fn ptrace(request: ::c_int, ...) -> ::c_long;
653-
pub fn fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int;
654-
pub fn stat64(path: *const c_char, buf: *mut stat64) -> ::c_int;
655-
pub fn open64(path: *const c_char, oflag: ::c_int, ...) -> ::c_int;
656-
pub fn creat64(path: *const c_char, mode: mode_t) -> ::c_int;
657-
pub fn lseek64(fd: ::c_int, offset: off64_t, whence: ::c_int) -> off64_t;
658-
pub fn pread64(fd: ::c_int, buf: *mut ::c_void, count: ::size_t,
659-
offset: off64_t) -> ::ssize_t;
660-
pub fn pwrite64(fd: ::c_int, buf: *const ::c_void, count: ::size_t,
661-
offset: off64_t) -> ::ssize_t;
662-
pub fn mmap64(addr: *mut ::c_void,
663-
len: ::size_t,
664-
prot: ::c_int,
665-
flags: ::c_int,
666-
fd: ::c_int,
667-
offset: off64_t)
668-
-> *mut ::c_void;
669-
pub fn lstat64(path: *const c_char, buf: *mut stat64) -> ::c_int;
670-
pub fn ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int;
671-
pub fn readdir64_r(dirp: *mut ::DIR, entry: *mut ::dirent64,
672-
result: *mut *mut ::dirent64) -> ::c_int;
673-
pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int;
674-
pub fn setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int;
675652
}
676653

677654
cfg_if! {

src/unix/notbsd/linux/mips.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -520,14 +520,6 @@ extern {
520520
-> ::c_int>,
521521
pglob: *mut glob64_t) -> ::c_int;
522522
pub fn globfree64(pglob: *mut glob64_t);
523-
pub fn getnameinfo(sa: *const ::sockaddr,
524-
salen: ::socklen_t,
525-
host: *mut ::c_char,
526-
hostlen: ::socklen_t,
527-
serv: *mut ::c_char,
528-
sevlen: ::socklen_t,
529-
flags: ::c_int) -> ::c_int;
530-
pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
531523
pub fn ptrace(request: ::c_uint, ...) -> ::c_long;
532524
pub fn pthread_attr_getaffinity_np(attr: *const ::pthread_attr_t,
533525
cpusetsize: ::size_t,

src/unix/notbsd/linux/mod.rs

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -494,29 +494,6 @@ extern {
494494
pub fn tmpfile64() -> *mut ::FILE;
495495
pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int;
496496
pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int;
497-
pub fn fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int;
498-
pub fn stat64(path: *const c_char, buf: *mut stat64) -> ::c_int;
499-
pub fn open64(path: *const c_char, oflag: ::c_int, ...) -> ::c_int;
500-
pub fn creat64(path: *const c_char, mode: mode_t) -> ::c_int;
501-
pub fn lseek64(fd: ::c_int, offset: off64_t, whence: ::c_int) -> off64_t;
502-
pub fn pread64(fd: ::c_int, buf: *mut ::c_void, count: ::size_t,
503-
offset: off64_t) -> ::ssize_t;
504-
pub fn pwrite64(fd: ::c_int, buf: *const ::c_void, count: ::size_t,
505-
offset: off64_t) -> ::ssize_t;
506-
pub fn mmap64(addr: *mut ::c_void,
507-
len: ::size_t,
508-
prot: ::c_int,
509-
flags: ::c_int,
510-
fd: ::c_int,
511-
offset: off64_t)
512-
-> *mut ::c_void;
513-
pub fn lstat64(path: *const c_char, buf: *mut stat64) -> ::c_int;
514-
pub fn ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int;
515-
pub fn readdir64_r(dirp: *mut ::DIR, entry: *mut ::dirent64,
516-
result: *mut *mut ::dirent64) -> ::c_int;
517-
518-
pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int;
519-
pub fn setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int;
520497
pub fn fseeko64(stream: *mut ::FILE,
521498
offset: ::off64_t,
522499
whence: ::c_int) -> ::c_int;
@@ -615,6 +592,13 @@ extern {
615592
termp: *const termios,
616593
winp: *const ::winsize) -> ::pid_t;
617594
pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
595+
pub fn getnameinfo(sa: *const ::sockaddr,
596+
salen: ::socklen_t,
597+
host: *mut ::c_char,
598+
hostlen: ::socklen_t,
599+
serv: *mut ::c_char,
600+
sevlen: ::socklen_t,
601+
flags: ::c_int) -> ::c_int;
618602
}
619603

620604
cfg_if! {

src/unix/notbsd/linux/musl/mod.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,7 @@ pub const CLOCK_SGI_CYCLE: ::clockid_t = 10;
154154
pub const CLOCK_TAI: ::clockid_t = 11;
155155

156156
extern {
157-
pub fn getnameinfo(sa: *const ::sockaddr,
158-
salen: ::socklen_t,
159-
host: *mut ::c_char,
160-
hostlen: ::socklen_t,
161-
serv: *mut ::c_char,
162-
sevlen: ::socklen_t,
163-
flags: ::c_int) -> ::c_int;
164157
pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
165-
pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
166158
pub fn ptrace(request: ::c_int, ...) -> ::c_long;
167159
}
168160

src/unix/notbsd/linux/other/mod.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -487,14 +487,6 @@ extern {
487487
-> ::c_int>,
488488
pglob: *mut glob64_t) -> ::c_int;
489489
pub fn globfree64(pglob: *mut glob64_t);
490-
pub fn getnameinfo(sa: *const ::sockaddr,
491-
salen: ::socklen_t,
492-
host: *mut ::c_char,
493-
hostlen: ::socklen_t,
494-
serv: *mut ::c_char,
495-
sevlen: ::socklen_t,
496-
flags: ::c_int) -> ::c_int;
497-
pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
498490
pub fn ptrace(request: ::c_uint, ...) -> ::c_long;
499491
pub fn pthread_attr_getaffinity_np(attr: *const ::pthread_attr_t,
500492
cpusetsize: ::size_t,

src/unix/notbsd/mod.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,29 @@ extern {
770770
locale: *const ::c_char,
771771
base: ::locale_t) -> ::locale_t;
772772
pub fn uselocale(loc: ::locale_t) -> ::locale_t;
773+
pub fn creat64(path: *const c_char, mode: mode_t) -> ::c_int;
774+
pub fn fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int;
775+
pub fn ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int;
776+
pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int;
777+
pub fn lseek64(fd: ::c_int, offset: off64_t, whence: ::c_int) -> off64_t;
778+
pub fn lstat64(path: *const c_char, buf: *mut stat64) -> ::c_int;
779+
pub fn mmap64(addr: *mut ::c_void,
780+
len: ::size_t,
781+
prot: ::c_int,
782+
flags: ::c_int,
783+
fd: ::c_int,
784+
offset: off64_t)
785+
-> *mut ::c_void;
786+
pub fn open64(path: *const c_char, oflag: ::c_int, ...) -> ::c_int;
787+
pub fn pread64(fd: ::c_int, buf: *mut ::c_void, count: ::size_t,
788+
offset: off64_t) -> ::ssize_t;
789+
pub fn pwrite64(fd: ::c_int, buf: *const ::c_void, count: ::size_t,
790+
offset: off64_t) -> ::ssize_t;
791+
pub fn readdir64_r(dirp: *mut ::DIR, entry: *mut ::dirent64,
792+
result: *mut *mut ::dirent64) -> ::c_int;
793+
pub fn setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int;
794+
pub fn stat64(path: *const c_char, buf: *mut stat64) -> ::c_int;
795+
pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
773796
}
774797

775798
cfg_if! {

0 commit comments

Comments
 (0)