Skip to content

Commit 3c02bac

Browse files
committed
allow archs to define IPC_STAT, propagate time64 bit to other macros
to make use of {sem,shm,msg}ctl IPC_STAT functionality to provide 64-bit time_t on 32-bit archs, IPC_STAT and related macros must be defined with bit 8 (0x100) set. allow archs to define IPC_STAT in bits/ipc.h, and define the other macros in terms of it so that they all get the same value of the time64 bit.
1 parent 72f5024 commit 3c02bac

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

include/sys/ipc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ extern "C" {
2929

3030
#define IPC_RMID 0
3131
#define IPC_SET 1
32+
#ifndef IPC_STAT
3233
#define IPC_STAT 2
34+
#endif
3335
#define IPC_INFO 3
3436

3537
#define IPC_PRIVATE ((key_t) 0)

include/sys/msg.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ typedef unsigned long msglen_t;
2525
#define MSG_NOERROR 010000
2626
#define MSG_EXCEPT 020000
2727

28-
#define MSG_STAT 11
28+
#define MSG_STAT (11 | (IPC_STAT & 0x100))
2929
#define MSG_INFO 12
30-
#define MSG_STAT_ANY 13
30+
#define MSG_STAT_ANY (13 | (IPC_STAT & 0x100))
3131

3232
struct msginfo {
3333
int msgpool, msgmap, msgmax, msgmnb, msgmni, msgssz, msgtql;

include/sys/sem.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ extern "C" {
3131

3232
#define _SEM_SEMUN_UNDEFINED 1
3333

34-
#define SEM_STAT 18
34+
#define SEM_STAT (18 | (IPC_STAT & 0x100))
3535
#define SEM_INFO 19
36-
#define SEM_STAT_ANY 20
36+
#define SEM_STAT_ANY (20 | (IPC_STAT & 0x100))
3737

3838
struct seminfo {
3939
int semmap;

include/sys/shm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ extern "C" {
3333

3434
#define SHM_LOCK 11
3535
#define SHM_UNLOCK 12
36-
#define SHM_STAT 13
36+
#define SHM_STAT (13 | (IPC_STAT & 0x100))
3737
#define SHM_INFO 14
38-
#define SHM_STAT_ANY 15
38+
#define SHM_STAT_ANY (15 | (IPC_STAT & 0x100))
3939
#define SHM_DEST 01000
4040
#define SHM_LOCKED 02000
4141
#define SHM_HUGETLB 04000

0 commit comments

Comments
 (0)