Skip to content

Commit 23ce69b

Browse files
committed
Add missing MIPS syscalls
In addition, move the syscalls to the mips module file because they are all identical in mips32 and mips64.
1 parent b58bf3d commit 23ce69b

File tree

3 files changed

+39
-33
lines changed

3 files changed

+39
-33
lines changed

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

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -232,31 +232,3 @@ pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
232232
pub const RLIM_INFINITY: ::rlim_t = 0x7fffffff;
233233

234234
pub const SYS_gettid: ::c_long = 4222; // Valid for O32
235-
236-
#[link(name = "util")]
237-
extern {
238-
pub fn sysctl(name: *mut ::c_int,
239-
namelen: ::c_int,
240-
oldp: *mut ::c_void,
241-
oldlenp: *mut ::size_t,
242-
newp: *mut ::c_void,
243-
newlen: ::size_t)
244-
-> ::c_int;
245-
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
246-
pub fn backtrace(buf: *mut *mut ::c_void,
247-
sz: ::c_int) -> ::c_int;
248-
pub fn glob64(pattern: *const ::c_char,
249-
flags: ::c_int,
250-
errfunc: ::dox::Option<extern fn(epath: *const ::c_char,
251-
errno: ::c_int)
252-
-> ::c_int>,
253-
pglob: *mut glob64_t) -> ::c_int;
254-
pub fn globfree64(pglob: *mut glob64_t);
255-
pub fn ptrace(request: ::c_uint, ...) -> ::c_long;
256-
pub fn pthread_attr_getaffinity_np(attr: *const ::pthread_attr_t,
257-
cpusetsize: ::size_t,
258-
cpuset: *mut ::cpu_set_t) -> ::c_int;
259-
pub fn pthread_attr_setaffinity_np(attr: *mut ::pthread_attr_t,
260-
cpusetsize: ::size_t,
261-
cpuset: *const ::cpu_set_t) -> ::c_int;
262-
}

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,3 @@ pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
210210
pub const RLIM_INFINITY: ::rlim_t = 0xffff_ffff_ffff_ffff;
211211

212212
pub const SYS_gettid: ::c_long = 5178; // Valid for n64
213-
214-
#[link(name = "util")]
215-
extern {
216-
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
217-
}

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

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
pub type fsblkcnt_t = ::c_ulong;
22
pub type fsfilcnt_t = ::c_ulong;
33
pub type rlim_t = c_ulong;
4+
pub type __priority_which_t = ::c_uint;
45

56
s! {
67
pub struct glob64_t {
@@ -524,6 +525,44 @@ pub const B3000000: ::speed_t = 0o010015;
524525
pub const B3500000: ::speed_t = 0o010016;
525526
pub const B4000000: ::speed_t = 0o010017;
526527

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+
527566
cfg_if! {
528567
if #[cfg(target_arch = "mips")] {
529568
mod mips32;

0 commit comments

Comments
 (0)