Skip to content

Commit b58bf3d

Browse files
committed
Move types common to mips32 and mips64 into the main mips module
As a result of this commit, glob64_t will be added to mips64.
1 parent c25d657 commit b58bf3d

File tree

3 files changed

+28
-34
lines changed

3 files changed

+28
-34
lines changed

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

Lines changed: 0 additions & 25 deletions
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

1714
s! {
1815
pub struct aiocb {
@@ -107,19 +104,6 @@ s! {
107104
pub _pad: [::c_int; 29],
108105
}
109106

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

252227
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;

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

Lines changed: 0 additions & 9 deletions
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;
@@ -203,12 +200,6 @@ s! {
203200
pub mem_unit: ::c_uint,
204201
pub _f: [::c_char; 0],
205202
}
206-
207-
// FIXME this is actually a union
208-
pub struct sem_t {
209-
__size: [::c_char; 32],
210-
__align: [::c_long; 0],
211-
}
212203
}
213204

214205
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;

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

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

331
pub const SFD_CLOEXEC: ::c_int = 0x080000;

0 commit comments

Comments
 (0)