Skip to content

Commit 9427fd9

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 c9fd181 commit 9427fd9

File tree

1 file changed

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

1 file changed

+5
-4
lines changed

src/unix/linux_like/linux/mod.rs

Lines changed: 5 additions & 4 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::{
@@ -2506,9 +2507,9 @@ pub const IPC_NOWAIT: c_int = 0o4000;
25062507

25072508
pub const IPC_RMID: c_int = 0;
25082509
pub const IPC_SET: c_int = 1;
2509-
pub const IPC_STAT: c_int = 2;
2510+
pub const IPC_STAT: c_int = if cfg!(musl32_time64) { 0x102 } else { 2 };
25102511
pub const IPC_INFO: c_int = 3;
2511-
pub const MSG_STAT: c_int = 11;
2512+
pub const MSG_STAT: c_int = 11 | (IPC_STAT & 0x100);
25122513
pub const MSG_INFO: c_int = 12;
25132514
pub const MSG_NOTIFICATION: c_int = 0x8000;
25142515

@@ -2525,9 +2526,9 @@ pub const GETNCNT: c_int = 14;
25252526
pub const GETZCNT: c_int = 15;
25262527
pub const SETVAL: c_int = 16;
25272528
pub const SETALL: c_int = 17;
2528-
pub const SEM_STAT: c_int = 18;
2529+
pub const SEM_STAT: c_int = 18 | (IPC_STAT & 0x100);
25292530
pub const SEM_INFO: c_int = 19;
2530-
pub const SEM_STAT_ANY: c_int = 20;
2531+
pub const SEM_STAT_ANY: c_int = 20 | (IPC_STAT & 0x100);
25312532

25322533
pub const SHM_R: c_int = 0o400;
25332534
pub const SHM_W: c_int = 0o200;

0 commit comments

Comments
 (0)