Skip to content

Commit 015f637

Browse files
committed
add missing symbols for Android (needed by nix crate)
1 parent 4d9b179 commit 015f637

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

libc-test/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ fn main() {
179179
cfg.header("sys/shm.h");
180180
cfg.header("sys/user.h");
181181
cfg.header("sys/fsuid.h");
182-
cfg.header("pty.h");
183182
cfg.header("shadow.h");
184183
cfg.header("linux/input.h");
185184
if x86_64 {
@@ -200,6 +199,7 @@ fn main() {
200199
cfg.header("sys/syscall.h");
201200
cfg.header("sys/personality.h");
202201
cfg.header("sys/swap.h");
202+
cfg.header("pty.h");
203203
if !uclibc {
204204
cfg.header("sys/sysinfo.h");
205205
}

src/unix/notbsd/android/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
173173

174174
pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
175175
pub const EPOLLONESHOT: ::c_int = 0x40000000;
176+
pub const EPOLLRDHUP: ::c_int = 0x00002000;
177+
pub const EPOLLWAKEUP: ::c_int = 0x20000000;
176178

177179
pub const EFD_CLOEXEC: ::c_int = 0x80000;
178180

@@ -458,6 +460,7 @@ pub const O_NONBLOCK: ::c_int = 2048;
458460
pub const O_SYNC: ::c_int = 0x101000;
459461
pub const O_ASYNC: ::c_int = 0x2000;
460462
pub const O_NDELAY: ::c_int = 0x800;
463+
pub const O_DSYNC: ::c_int = 4096;
461464

462465
pub const NI_MAXHOST: ::size_t = 1025;
463466

@@ -562,6 +565,7 @@ pub const TIOCMBIC: ::c_int = 0x5417;
562565
pub const TIOCMSET: ::c_int = 0x5418;
563566
pub const FIONREAD: ::c_int = 0x541B;
564567
pub const TIOCCONS: ::c_int = 0x541D;
568+
pub const CLONE_NEWCGROUP: ::c_int = 0x02000000;
565569

566570
pub const RTLD_NOLOAD: ::c_int = 0x4;
567571

src/unix/notbsd/linux/mod.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,6 @@ extern {
10131013
timeout: ::c_int,
10141014
sigmask: *const ::sigset_t) -> ::c_int;
10151015
pub fn dup3(oldfd: ::c_int, newfd: ::c_int, flags: ::c_int) -> ::c_int;
1016-
pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
10171016
pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
10181017
pub fn mkostemps(template: *mut ::c_char,
10191018
suffixlen: ::c_int,
@@ -1023,15 +1022,6 @@ extern {
10231022
timeout: *const ::timespec) -> ::c_int;
10241023
pub fn sigwaitinfo(set: *const sigset_t,
10251024
info: *mut siginfo_t) -> ::c_int;
1026-
pub fn openpty(amaster: *mut ::c_int,
1027-
aslave: *mut ::c_int,
1028-
name: *mut ::c_char,
1029-
termp: *const termios,
1030-
winp: *const ::winsize) -> ::c_int;
1031-
pub fn forkpty(amaster: *mut ::c_int,
1032-
name: *mut ::c_char,
1033-
termp: *const termios,
1034-
winp: *const ::winsize) -> ::pid_t;
10351025
pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
10361026
pub fn getnameinfo(sa: *const ::sockaddr,
10371027
salen: ::socklen_t,
@@ -1064,8 +1054,6 @@ extern {
10641054
pub fn reboot(how_to: ::c_int) -> ::c_int;
10651055
pub fn setfsgid(gid: ::gid_t) -> ::c_int;
10661056
pub fn setfsuid(uid: ::uid_t) -> ::c_int;
1067-
pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
1068-
pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
10691057

10701058
// Not available now on Android
10711059
pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char,

src/unix/notbsd/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,9 @@ extern {
10101010
pub fn brk(addr: *mut ::c_void) -> ::c_int;
10111011
pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void;
10121012
pub fn vfork() -> ::pid_t;
1013+
pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
1014+
pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
1015+
pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
10131016
pub fn wait4(pid: ::pid_t, status: *mut ::c_int, options: ::c_int,
10141017
rusage: *mut ::rusage) -> ::pid_t;
10151018
pub fn openpty(amaster: *mut ::c_int,

0 commit comments

Comments
 (0)