Skip to content

Commit 754b888

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 0334b72 commit 754b888

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/unix/linux_like/linux/mod.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//! Linux-specific definitions for linux-like values
2-
32
use crate::prelude::*;
43
use crate::{
54
sock_filter,
@@ -1569,7 +1568,7 @@ pub const RENAME_NOREPLACE: c_uint = 1;
15691568
pub const RENAME_EXCHANGE: c_uint = 2;
15701569
pub const RENAME_WHITEOUT: c_uint = 4;
15711570

1572-
pub const MSG_STAT: c_int = 11;
1571+
pub const MSG_STAT: c_int = 11 | (crate::IPC_STAT & 0x100);
15731572
pub const MSG_INFO: c_int = 12;
15741573
pub const MSG_NOTIFICATION: c_int = 0x8000;
15751574

@@ -1586,9 +1585,9 @@ pub const GETNCNT: c_int = 14;
15861585
pub const GETZCNT: c_int = 15;
15871586
pub const SETVAL: c_int = 16;
15881587
pub const SETALL: c_int = 17;
1589-
pub const SEM_STAT: c_int = 18;
1588+
pub const SEM_STAT: c_int = 18 | (crate::IPC_STAT & 0x100);
15901589
pub const SEM_INFO: c_int = 19;
1591-
pub const SEM_STAT_ANY: c_int = 20;
1590+
pub const SEM_STAT_ANY: c_int = 20 | (crate::IPC_STAT & 0x100);
15921591

15931592
pub const QFMT_VFS_OLD: c_int = 1;
15941593
pub const QFMT_VFS_V0: c_int = 2;

src/unix/linux_like/linux_l4re_shared.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ pub const IPC_NOWAIT: c_int = 0o4000;
976976

977977
pub const IPC_RMID: c_int = 0;
978978
pub const IPC_SET: c_int = 1;
979-
pub const IPC_STAT: c_int = 2;
979+
pub const IPC_STAT: c_int = if cfg!(musl32_time64) { 0x102 } else { 2 };
980980
pub const IPC_INFO: c_int = 3;
981981

982982
pub const SHM_R: c_int = 0o400;

0 commit comments

Comments
 (0)