Skip to content

Commit 2ff312b

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 2ff312b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/unix/linux_like/linux/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//! Linux-specific definitions for linux-like values
2+
use core::cfg;
23

34
use crate::prelude::*;
45
use crate::{
@@ -1569,7 +1570,7 @@ pub const RENAME_NOREPLACE: c_uint = 1;
15691570
pub const RENAME_EXCHANGE: c_uint = 2;
15701571
pub const RENAME_WHITEOUT: c_uint = 4;
15711572

1572-
pub const MSG_STAT: c_int = 11;
1573+
pub const MSG_STAT: c_int = 11 | (crate::IPC_STAT & 0x100);
15731574
pub const MSG_INFO: c_int = 12;
15741575
pub const MSG_NOTIFICATION: c_int = 0x8000;
15751576

@@ -1586,9 +1587,9 @@ pub const GETNCNT: c_int = 14;
15861587
pub const GETZCNT: c_int = 15;
15871588
pub const SETVAL: c_int = 16;
15881589
pub const SETALL: c_int = 17;
1589-
pub const SEM_STAT: c_int = 18;
1590+
pub const SEM_STAT: c_int = 18 | (crate::IPC_STAT & 0x100);
15901591
pub const SEM_INFO: c_int = 19;
1591-
pub const SEM_STAT_ANY: c_int = 20;
1592+
pub const SEM_STAT_ANY: c_int = 20 | (crate::IPC_STAT & 0x100);
15921593

15931594
pub const QFMT_VFS_OLD: c_int = 1;
15941595
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)