Skip to content

Commit 495d22a

Browse files
authored
Merge branch 'master' into linux_input_types
2 parents 92fac1d + edbc1f1 commit 495d22a

File tree

4 files changed

+76
-67
lines changed

4 files changed

+76
-67
lines changed

src/unix/notbsd/android/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ pub const SA_RESTART: ::c_int = 0x10000000;
172172
pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
173173

174174
pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
175+
pub const EPOLLONESHOT: ::c_int = 0x40000000;
175176

176177
pub const EFD_CLOEXEC: ::c_int = 0x80000;
177178

src/unix/notbsd/linux/mips/mips32.rs

-53
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ pub type ino_t = u32;
1010
pub type blkcnt_t = i32;
1111
pub type blksize_t = i32;
1212
pub type nlink_t = u32;
13-
pub type fsblkcnt_t = ::c_ulong;
14-
pub type fsfilcnt_t = ::c_ulong;
15-
pub type rlim_t = c_ulong;
1613
pub type __u64 = ::c_ulonglong;
1714

1815
s! {
@@ -108,19 +105,6 @@ s! {
108105
pub _pad: [::c_int; 29],
109106
}
110107

111-
pub struct glob64_t {
112-
pub gl_pathc: ::size_t,
113-
pub gl_pathv: *mut *mut ::c_char,
114-
pub gl_offs: ::size_t,
115-
pub gl_flags: ::c_int,
116-
117-
__unused1: *mut ::c_void,
118-
__unused2: *mut ::c_void,
119-
__unused3: *mut ::c_void,
120-
__unused4: *mut ::c_void,
121-
__unused5: *mut ::c_void,
122-
}
123-
124108
pub struct ipc_perm {
125109
pub __key: ::key_t,
126110
pub uid: ::uid_t,
@@ -239,15 +223,6 @@ s! {
239223
pub mem_unit: ::c_uint,
240224
pub _f: [::c_char; 8],
241225
}
242-
243-
// FIXME this is actually a union
244-
pub struct sem_t {
245-
#[cfg(target_pointer_width = "32")]
246-
__size: [::c_char; 16],
247-
#[cfg(target_pointer_width = "64")]
248-
__size: [::c_char; 32],
249-
__align: [::c_long; 0],
250-
}
251226
}
252227

253228
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
@@ -258,31 +233,3 @@ pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
258233
pub const RLIM_INFINITY: ::rlim_t = 0x7fffffff;
259234

260235
pub const SYS_gettid: ::c_long = 4222; // Valid for O32
261-
262-
#[link(name = "util")]
263-
extern {
264-
pub fn sysctl(name: *mut ::c_int,
265-
namelen: ::c_int,
266-
oldp: *mut ::c_void,
267-
oldlenp: *mut ::size_t,
268-
newp: *mut ::c_void,
269-
newlen: ::size_t)
270-
-> ::c_int;
271-
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
272-
pub fn backtrace(buf: *mut *mut ::c_void,
273-
sz: ::c_int) -> ::c_int;
274-
pub fn glob64(pattern: *const ::c_char,
275-
flags: ::c_int,
276-
errfunc: ::dox::Option<extern fn(epath: *const ::c_char,
277-
errno: ::c_int)
278-
-> ::c_int>,
279-
pglob: *mut glob64_t) -> ::c_int;
280-
pub fn globfree64(pglob: *mut glob64_t);
281-
pub fn ptrace(request: ::c_uint, ...) -> ::c_long;
282-
pub fn pthread_attr_getaffinity_np(attr: *const ::pthread_attr_t,
283-
cpusetsize: ::size_t,
284-
cpuset: *mut ::cpu_set_t) -> ::c_int;
285-
pub fn pthread_attr_setaffinity_np(attr: *mut ::pthread_attr_t,
286-
cpusetsize: ::size_t,
287-
cpuset: *const ::cpu_set_t) -> ::c_int;
288-
}

src/unix/notbsd/linux/mips/mips64.rs

+8-14
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@ pub type blksize_t = i64;
33
pub type c_char = i8;
44
pub type c_long = i64;
55
pub type c_ulong = u64;
6-
pub type fsblkcnt_t = ::c_ulong;
7-
pub type fsfilcnt_t = ::c_ulong;
86
pub type ino_t = u64;
97
pub type nlink_t = u64;
108
pub type off_t = i64;
11-
pub type rlim_t = ::c_ulong;
129
pub type suseconds_t = i64;
1310
pub type time_t = i64;
1411
pub type wchar_t = i32;
@@ -188,6 +185,14 @@ s! {
188185
pub c_cc: [::cc_t; ::NCCS],
189186
}
190187

188+
pub struct flock {
189+
pub l_type: ::c_short,
190+
pub l_whence: ::c_short,
191+
pub l_start: ::off_t,
192+
pub l_len: ::off_t,
193+
pub l_pid: ::pid_t,
194+
}
195+
191196
pub struct sysinfo {
192197
pub uptime: ::c_long,
193198
pub loads: [::c_ulong; 3],
@@ -204,12 +209,6 @@ s! {
204209
pub mem_unit: ::c_uint,
205210
pub _f: [::c_char; 0],
206211
}
207-
208-
// FIXME this is actually a union
209-
pub struct sem_t {
210-
__size: [::c_char; 32],
211-
__align: [::c_long; 0],
212-
}
213212
}
214213

215214
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
@@ -220,8 +219,3 @@ pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
220219
pub const RLIM_INFINITY: ::rlim_t = 0xffff_ffff_ffff_ffff;
221220

222221
pub const SYS_gettid: ::c_long = 5178; // Valid for n64
223-
224-
#[link(name = "util")]
225-
extern {
226-
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
227-
}

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

+67
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1+
pub type fsblkcnt_t = ::c_ulong;
2+
pub type fsfilcnt_t = ::c_ulong;
3+
pub type rlim_t = c_ulong;
4+
pub type __priority_which_t = ::c_uint;
5+
6+
s! {
7+
pub struct glob64_t {
8+
pub gl_pathc: ::size_t,
9+
pub gl_pathv: *mut *mut ::c_char,
10+
pub gl_offs: ::size_t,
11+
pub gl_flags: ::c_int,
12+
13+
__unused1: *mut ::c_void,
14+
__unused2: *mut ::c_void,
15+
__unused3: *mut ::c_void,
16+
__unused4: *mut ::c_void,
17+
__unused5: *mut ::c_void,
18+
}
19+
20+
// FIXME this is actually a union
21+
pub struct sem_t {
22+
#[cfg(target_pointer_width = "32")]
23+
__size: [::c_char; 16],
24+
#[cfg(target_pointer_width = "64")]
25+
__size: [::c_char; 32],
26+
__align: [::c_long; 0],
27+
}
28+
}
29+
130
pub const CLONE_NEWCGROUP: ::c_int = 0x02000000;
231

332
pub const SFD_CLOEXEC: ::c_int = 0x080000;
@@ -496,6 +525,44 @@ pub const B3000000: ::speed_t = 0o010015;
496525
pub const B3500000: ::speed_t = 0o010016;
497526
pub const B4000000: ::speed_t = 0o010017;
498527

528+
#[link(name = "util")]
529+
extern {
530+
pub fn sysctl(name: *mut ::c_int,
531+
namelen: ::c_int,
532+
oldp: *mut ::c_void,
533+
oldlenp: *mut ::size_t,
534+
newp: *mut ::c_void,
535+
newlen: ::size_t)
536+
-> ::c_int;
537+
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
538+
pub fn backtrace(buf: *mut *mut ::c_void,
539+
sz: ::c_int) -> ::c_int;
540+
pub fn glob64(pattern: *const ::c_char,
541+
flags: ::c_int,
542+
errfunc: ::dox::Option<extern fn(epath: *const ::c_char,
543+
errno: ::c_int)
544+
-> ::c_int>,
545+
pglob: *mut glob64_t) -> ::c_int;
546+
pub fn globfree64(pglob: *mut glob64_t);
547+
pub fn ptrace(request: ::c_uint, ...) -> ::c_long;
548+
pub fn pthread_attr_getaffinity_np(attr: *const ::pthread_attr_t,
549+
cpusetsize: ::size_t,
550+
cpuset: *mut ::cpu_set_t) -> ::c_int;
551+
pub fn pthread_attr_setaffinity_np(attr: *mut ::pthread_attr_t,
552+
cpusetsize: ::size_t,
553+
cpuset: *const ::cpu_set_t) -> ::c_int;
554+
pub fn getpriority(which: ::__priority_which_t, who: ::id_t) -> ::c_int;
555+
pub fn setpriority(which: ::__priority_which_t, who: ::id_t,
556+
prio: ::c_int) -> ::c_int;
557+
pub fn pthread_getaffinity_np(thread: ::pthread_t,
558+
cpusetsize: ::size_t,
559+
cpuset: *mut ::cpu_set_t) -> ::c_int;
560+
pub fn pthread_setaffinity_np(thread: ::pthread_t,
561+
cpusetsize: ::size_t,
562+
cpuset: *const ::cpu_set_t) -> ::c_int;
563+
pub fn sched_getcpu() -> ::c_int;
564+
}
565+
499566
cfg_if! {
500567
if #[cfg(target_arch = "mips")] {
501568
mod mips32;

0 commit comments

Comments
 (0)