Skip to content

Commit 783c075

Browse files
committed
Auto merge of #2252 - devnexen:semctl_api_completion_linu, r=JohnTitor
linux adding semid_ds struct and seminfo incidently. close #2002
2 parents 4123835 + 775f0f2 commit 783c075

File tree

4 files changed

+60
-0
lines changed

4 files changed

+60
-0
lines changed

libc-test/semver/linux-gnu.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,8 @@ pthread_setname_np
566566
pututxline
567567
pwritev2
568568
qsort_r
569+
semid_ds
570+
seminfo
569571
setutxent
570572
setxattr
571573
sgetspent_r

src/unix/linux_like/linux/gnu/b32/mod.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ pub type __u64 = ::c_ulonglong;
1414
pub type __fsword_t = i32;
1515
pub type fsblkcnt64_t = u64;
1616
pub type fsfilcnt64_t = u64;
17+
pub type __syscall_ulong_t = ::c_ulong;
1718

1819
cfg_if! {
1920
if #[cfg(target_arch = "riscv32")] {
@@ -138,6 +139,23 @@ s! {
138139
pub imr_address: ::in_addr,
139140
pub imr_ifindex: ::c_int,
140141
}
142+
143+
pub struct semid_ds {
144+
pub sem_perm: ipc_perm,
145+
#[cfg(target_arch = "powerpc")]
146+
__reserved: ::__syscall_ulong_t,
147+
pub sem_otime: ::time_t,
148+
#[cfg(not(any(target_arch = "mips", target_arch = "powerpc")))]
149+
__reserved: ::__syscall_ulong_t,
150+
#[cfg(target_arch = "powerpc")]
151+
__reserved2: ::__syscall_ulong_t,
152+
pub sem_ctime: ::time_t,
153+
#[cfg(not(any(target_arch = "mips", target_arch = "powerpc")))]
154+
__reserved2: ::__syscall_ulong_t,
155+
pub sem_nsems: ::__syscall_ulong_t,
156+
__glibc_reserved3: ::__syscall_ulong_t,
157+
__glibc_reserved4: ::__syscall_ulong_t,
158+
}
141159
}
142160

143161
pub const POSIX_FADV_DONTNEED: ::c_int = 4;

src/unix/linux_like/linux/gnu/b64/mod.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ pub type msglen_t = u64;
99
pub type fsblkcnt_t = u64;
1010
pub type fsfilcnt_t = u64;
1111
pub type rlim_t = u64;
12+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
13+
pub type __syscall_ulong_t = ::c_ulonglong;
14+
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
15+
pub type __syscall_ulong_t = ::c_ulong;
16+
1217
cfg_if! {
1318
if #[cfg(all(target_arch = "aarch64", target_pointer_width = "32"))] {
1419
pub type clock_t = i32;
@@ -60,6 +65,28 @@ s! {
6065
__glibc_reserved5: u64,
6166
}
6267

68+
pub struct semid_ds {
69+
pub sem_perm: ipc_perm,
70+
pub sem_otime: ::time_t,
71+
#[cfg(not(any(
72+
target_arch = "aarch64",
73+
target_arch = "mips64",
74+
target_arch = "powerpc64",
75+
target_arch = "riscv64",
76+
target_arch = "sparc64")))]
77+
__reserved: ::__syscall_ulong_t,
78+
pub sem_ctime: ::time_t,
79+
#[cfg(not(any(
80+
target_arch = "aarch64",
81+
target_arch = "mips64",
82+
target_arch = "powerpc64",
83+
target_arch = "riscv64",
84+
target_arch = "sparc64")))]
85+
__reserved2: ::__syscall_ulong_t,
86+
pub sem_nsems: ::__syscall_ulong_t,
87+
__glibc_reserved3: ::__syscall_ulong_t,
88+
__glibc_reserved4: ::__syscall_ulong_t,
89+
}
6390
}
6491

6592
pub const RLIM_INFINITY: ::rlim_t = !0;

src/unix/linux_like/linux/gnu/mod.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,19 @@ s! {
313313
pub ch_size: ::Elf32_Word,
314314
pub ch_addralign: ::Elf32_Word,
315315
}
316+
317+
pub struct seminfo {
318+
pub semmap: ::c_int,
319+
pub semmni: ::c_int,
320+
pub semmns: ::c_int,
321+
pub semmnu: ::c_int,
322+
pub semmsl: ::c_int,
323+
pub semopm: ::c_int,
324+
pub semume: ::c_int,
325+
pub semusz: ::c_int,
326+
pub semvmx: ::c_int,
327+
pub semaem: ::c_int,
328+
}
316329
}
317330

318331
impl siginfo_t {

0 commit comments

Comments
 (0)