Skip to content

Commit 61bc587

Browse files
committed
musl: time64: update {IPC,MSG,SEM}_STAT definitions
This is primarily based on a small part of bminor/musl@3814333. This also integrates bminor/musl@3c02bac, which update MSG_STAT, SEM_STAT, SEM_STAT_ANY. These are based on the value of IPC_STAT, however we can just use `cfg` as it is effectively the same.
1 parent 26448a5 commit 61bc587

File tree

1 file changed

+21
-4
lines changed
  • src/unix/linux_like/linux

1 file changed

+21
-4
lines changed

src/unix/linux_like/linux/mod.rs

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! Linux-specific definitions for linux-like values
22
3+
use core::cfg;
34
use core::mem::size_of;
45

56
use crate::prelude::*;
@@ -2851,9 +2852,17 @@ pub const IPC_NOWAIT: c_int = 0o4000;
28512852

28522853
pub const IPC_RMID: c_int = 0;
28532854
pub const IPC_SET: c_int = 1;
2854-
pub const IPC_STAT: c_int = 2;
2855+
pub const IPC_STAT: c_int = if cfg!(musl32_time64) {
2856+
0x102
2857+
} else {
2858+
2
2859+
};
28552860
pub const IPC_INFO: c_int = 3;
2856-
pub const MSG_STAT: c_int = 11;
2861+
pub const MSG_STAT: c_int = if cfg!(musl32_time64) {
2862+
0x10b
2863+
} else {
2864+
11
2865+
};
28572866
pub const MSG_INFO: c_int = 12;
28582867
pub const MSG_NOTIFICATION: c_int = 0x8000;
28592868

@@ -2870,9 +2879,17 @@ pub const GETNCNT: c_int = 14;
28702879
pub const GETZCNT: c_int = 15;
28712880
pub const SETVAL: c_int = 16;
28722881
pub const SETALL: c_int = 17;
2873-
pub const SEM_STAT: c_int = 18;
2882+
pub const SEM_STAT: c_int = if cfg!(musl32_time64) {
2883+
0x112
2884+
} else {
2885+
18
2886+
};
28742887
pub const SEM_INFO: c_int = 19;
2875-
pub const SEM_STAT_ANY: c_int = 20;
2888+
pub const SEM_STAT_ANY: c_int = if cfg!(musl32_time64) {
2889+
0x114
2890+
} else {
2891+
20
2892+
};
28762893

28772894
pub const SHM_R: c_int = 0o400;
28782895
pub const SHM_W: c_int = 0o200;

0 commit comments

Comments
 (0)