diff options
author | Arnd Bergmann <arnd@arndb.de> | 2018-06-25 22:38:57 +0200 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2019-01-25 13:34:31 +0100 |
commit | 6e836afd9c8e4a403d11df71bfd5b1827c2126a6 (patch) | |
tree | 0c6f2f123aacf2b463e998f666b0e860cfecdb6c | |
parent | 1691b23955590d1eb66a11158fdd91c86337e886 (diff) |
ipc: use 64-bit timestamps
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r-- | arch/generic/bits/msg.h | 27 | ||||
-rw-r--r-- | arch/generic/bits/sem.h | 18 | ||||
-rw-r--r-- | arch/generic/bits/shm.h | 28 | ||||
-rw-r--r-- | arch/mips/bits/msg.h | 63 | ||||
-rw-r--r-- | arch/mips/bits/sem.h | 13 | ||||
-rw-r--r-- | arch/mips/bits/shm.h | 18 | ||||
-rw-r--r-- | arch/mipsn32/bits/msg.h | 63 | ||||
-rw-r--r-- | arch/mipsn32/bits/sem.h | 13 | ||||
-rw-r--r-- | arch/mipsn32/bits/shm.h | 17 | ||||
-rw-r--r-- | arch/or1k/bits/msg.h | 27 | ||||
-rw-r--r-- | arch/powerpc/bits/msg.h | 36 | ||||
-rw-r--r-- | arch/powerpc/bits/sem.h | 24 | ||||
-rw-r--r-- | arch/powerpc/bits/shm.h | 37 | ||||
-rw-r--r-- | arch/sh/bits/shm.h | 27 | ||||
-rw-r--r-- | src/ipc/msgctl.c | 5 | ||||
-rw-r--r-- | src/ipc/semctl.c | 4 | ||||
-rw-r--r-- | src/ipc/shmctl.c | 5 |
17 files changed, 346 insertions, 79 deletions
diff --git a/arch/generic/bits/msg.h b/arch/generic/bits/msg.h index bc8436c4..1e087a46 100644 --- a/arch/generic/bits/msg.h +++ b/arch/generic/bits/msg.h @@ -1,11 +1,26 @@ struct msqid_ds { struct ipc_perm msg_perm; - time_t msg_stime; - int __unused1; - time_t msg_rtime; - int __unused2; - time_t msg_ctime; - int __unused3; + union { + time_t msg_stime; + struct { + unsigned int msg_stime_lo; + unsigned int msg_stime_hi; + }; + }; + union { + time_t msg_rtime; + struct { + unsigned int msg_rtime_lo; + unsigned int msg_rtime_hi; + }; + }; + union { + time_t msg_ctime; + struct { + unsigned int msg_ctime_lo; + unsigned int msg_ctime_hi; + }; + }; unsigned long msg_cbytes; msgqnum_t msg_qnum; msglen_t msg_qbytes; diff --git a/arch/generic/bits/sem.h b/arch/generic/bits/sem.h index c629b81e..ff921f2c 100644 --- a/arch/generic/bits/sem.h +++ b/arch/generic/bits/sem.h @@ -1,9 +1,19 @@ struct semid_ds { struct ipc_perm sem_perm; - time_t sem_otime; - time_t __unused1; - time_t sem_ctime; - time_t __unused2; + union { + time_t sem_otime; + struct { + unsigned int sem_otime_lo; + unsigned int sem_otime_hi; + }; + }; + union { + time_t sem_ctime; + struct { + unsigned int sem_ctime_lo; + unsigned int sem_ctime_hi; + }; + }; #if __BYTE_ORDER == __LITTLE_ENDIAN unsigned short sem_nsems; char __sem_nsems_pad[sizeof(time_t)-sizeof(short)]; diff --git a/arch/generic/bits/shm.h b/arch/generic/bits/shm.h index 45d1d157..c62a321b 100644 --- a/arch/generic/bits/shm.h +++ b/arch/generic/bits/shm.h @@ -3,12 +3,27 @@ struct shmid_ds { struct ipc_perm shm_perm; size_t shm_segsz; - time_t shm_atime; - int __unused1; - time_t shm_dtime; - int __unused2; - time_t shm_ctime; - int __unused3; + union { + time_t shm_atime; + struct { + unsigned int shm_atime_lo; + unsigned int shm_atime_hi; + }; + }; + union { + time_t shm_dtime; + struct { + unsigned int shm_dtime_lo; + unsigned int shm_dtime_hi; + }; + }; + union { + time_t shm_ctime; + struct { + unsigned int shm_ctime_lo; + unsigned int shm_ctime_hi; + }; + }; pid_t shm_cpid; pid_t shm_lpid; unsigned long shm_nattch; @@ -25,4 +40,3 @@ struct shm_info { unsigned long shm_tot, shm_rss, shm_swp; unsigned long __swap_attempts, __swap_successes; }; - diff --git a/arch/mips/bits/msg.h b/arch/mips/bits/msg.h index f28aece8..bcf55098 100644 --- a/arch/mips/bits/msg.h +++ b/arch/mips/bits/msg.h @@ -1,19 +1,58 @@ struct msqid_ds { struct ipc_perm msg_perm; #if _MIPSEL || __MIPSEL || __MIPSEL__ - time_t msg_stime; - int __unused1; - time_t msg_rtime; - int __unused2; - time_t msg_ctime; - int __unused3; + union { + time_t msg_stime; + struct { + unsigned int msg_stime_lo; + unsigned int msg_stime_hi; + }; + }; + union { + time_t msg_rtime; + struct { + unsigned int msg_rtime_lo; + unsigned int msg_rtime_hi; + }; + }; + union { + time_t msg_ctime; + struct { + unsigned int msg_ctime_lo; + unsigned int msg_ctime_hi; + }; + }; #else - int __unused1; - time_t msg_stime; - int __unused2; - time_t msg_rtime; - int __unused3; - time_t msg_ctime; + union { + struct { + char pad1[8 - sizeof(time_t)]; + time_t msg_stime; + }; + struct { + unsigned int msg_stime_hi; + unsigned int msg_stime_lo; + }; + }; + union { + struct { + char pad2[8 - sizeof(time_t)]; + time_t msg_rtime; + }; + struct { + unsigned int msg_rtime_hi; + unsigned int msg_rtime_lo; + }; + }; + union { + struct { + char pad3[8 - sizeof(time_t)]; + time_t msg_ctime; + }; + struct { + unsigned int msg_ctime_hi; + unsigned int msg_ctime_lo; + }; + }; #endif unsigned long msg_cbytes; msgqnum_t msg_qnum; diff --git a/arch/mips/bits/sem.h b/arch/mips/bits/sem.h index e46ced95..afd930eb 100644 --- a/arch/mips/bits/sem.h +++ b/arch/mips/bits/sem.h @@ -1,7 +1,12 @@ struct semid_ds { struct ipc_perm sem_perm; +#ifdef __USE_TIME_BITS64 + unsigned int sem_otime_lo; + unsigned int sem_ctime_lo; +#else time_t sem_otime; time_t sem_ctime; +#endif #if __BYTE_ORDER == __LITTLE_ENDIAN unsigned short sem_nsems; char __sem_nsems_pad[sizeof(time_t)-sizeof(short)]; @@ -9,6 +14,10 @@ struct semid_ds { char __sem_nsems_pad[sizeof(time_t)-sizeof(short)]; unsigned short sem_nsems; #endif - time_t __unused3; - time_t __unused4; + unsigned int sem_otime_hi; + unsigned int sem_ctime_hi; +#ifdef __USE_TIME_BITS64 + time_t sem_otime; + time_t sem_ctime; +#endif }; diff --git a/arch/mips/bits/shm.h b/arch/mips/bits/shm.h index 6652d659..f0478d1f 100644 --- a/arch/mips/bits/shm.h +++ b/arch/mips/bits/shm.h @@ -3,14 +3,27 @@ struct shmid_ds { struct ipc_perm shm_perm; size_t shm_segsz; +#ifdef __USE_TIME_BITS64 + unsigned int shm_atime_lo; + unsigned int shm_dtime_lo; + unsigned int shm_ctime_lo; +#else time_t shm_atime; time_t shm_dtime; time_t shm_ctime; +#endif pid_t shm_cpid; pid_t shm_lpid; unsigned long shm_nattch; - unsigned long __pad1; - unsigned long __pad2; + unsigned short shm_atime_hi; + unsigned short shm_dtime_hi; + unsigned short shm_ctime_hi; + unsigned short __unused1; +#ifdef __USE_TIME_BITS64 + time_t shm_atime; + time_t shm_dtime; + time_t shm_ctime; +#endif }; struct shminfo { @@ -22,4 +35,3 @@ struct shm_info { unsigned long shm_tot, shm_rss, shm_swp; unsigned long __swap_attempts, __swap_successes; }; - diff --git a/arch/mipsn32/bits/msg.h b/arch/mipsn32/bits/msg.h index f28aece8..bcf55098 100644 --- a/arch/mipsn32/bits/msg.h +++ b/arch/mipsn32/bits/msg.h @@ -1,19 +1,58 @@ struct msqid_ds { struct ipc_perm msg_perm; #if _MIPSEL || __MIPSEL || __MIPSEL__ - time_t msg_stime; - int __unused1; - time_t msg_rtime; - int __unused2; - time_t msg_ctime; - int __unused3; + union { + time_t msg_stime; + struct { + unsigned int msg_stime_lo; + unsigned int msg_stime_hi; + }; + }; + union { + time_t msg_rtime; + struct { + unsigned int msg_rtime_lo; + unsigned int msg_rtime_hi; + }; + }; + union { + time_t msg_ctime; + struct { + unsigned int msg_ctime_lo; + unsigned int msg_ctime_hi; + }; + }; #else - int __unused1; - time_t msg_stime; - int __unused2; - time_t msg_rtime; - int __unused3; - time_t msg_ctime; + union { + struct { + char pad1[8 - sizeof(time_t)]; + time_t msg_stime; + }; + struct { + unsigned int msg_stime_hi; + unsigned int msg_stime_lo; + }; + }; + union { + struct { + char pad2[8 - sizeof(time_t)]; + time_t msg_rtime; + }; + struct { + unsigned int msg_rtime_hi; + unsigned int msg_rtime_lo; + }; + }; + union { + struct { + char pad3[8 - sizeof(time_t)]; + time_t msg_ctime; + }; + struct { + unsigned int msg_ctime_hi; + unsigned int msg_ctime_lo; + }; + }; #endif unsigned long msg_cbytes; msgqnum_t msg_qnum; diff --git a/arch/mipsn32/bits/sem.h b/arch/mipsn32/bits/sem.h index e46ced95..afd930eb 100644 --- a/arch/mipsn32/bits/sem.h +++ b/arch/mipsn32/bits/sem.h @@ -1,7 +1,12 @@ struct semid_ds { struct ipc_perm sem_perm; +#ifdef __USE_TIME_BITS64 + unsigned int sem_otime_lo; + unsigned int sem_ctime_lo; +#else time_t sem_otime; time_t sem_ctime; +#endif #if __BYTE_ORDER == __LITTLE_ENDIAN unsigned short sem_nsems; char __sem_nsems_pad[sizeof(time_t)-sizeof(short)]; @@ -9,6 +14,10 @@ struct semid_ds { char __sem_nsems_pad[sizeof(time_t)-sizeof(short)]; unsigned short sem_nsems; #endif - time_t __unused3; - time_t __unused4; + unsigned int sem_otime_hi; + unsigned int sem_ctime_hi; +#ifdef __USE_TIME_BITS64 + time_t sem_otime; + time_t sem_ctime; +#endif }; diff --git a/arch/mipsn32/bits/shm.h b/arch/mipsn32/bits/shm.h index 8d193781..f0478d1f 100644 --- a/arch/mipsn32/bits/shm.h +++ b/arch/mipsn32/bits/shm.h @@ -3,14 +3,27 @@ struct shmid_ds { struct ipc_perm shm_perm; size_t shm_segsz; +#ifdef __USE_TIME_BITS64 + unsigned int shm_atime_lo; + unsigned int shm_dtime_lo; + unsigned int shm_ctime_lo; +#else time_t shm_atime; time_t shm_dtime; time_t shm_ctime; +#endif pid_t shm_cpid; pid_t shm_lpid; unsigned long shm_nattch; - unsigned long __pad1; - unsigned long __pad2; + unsigned short shm_atime_hi; + unsigned short shm_dtime_hi; + unsigned short shm_ctime_hi; + unsigned short __unused1; +#ifdef __USE_TIME_BITS64 + time_t shm_atime; + time_t shm_dtime; + time_t shm_ctime; +#endif }; struct shminfo { diff --git a/arch/or1k/bits/msg.h b/arch/or1k/bits/msg.h index bc8436c4..1e087a46 100644 --- a/arch/or1k/bits/msg.h +++ b/arch/or1k/bits/msg.h @@ -1,11 +1,26 @@ struct msqid_ds { struct ipc_perm msg_perm; - time_t msg_stime; - int __unused1; - time_t msg_rtime; - int __unused2; - time_t msg_ctime; - int __unused3; + union { + time_t msg_stime; + struct { + unsigned int msg_stime_lo; + unsigned int msg_stime_hi; + }; + }; + union { + time_t msg_rtime; + struct { + unsigned int msg_rtime_lo; + unsigned int msg_rtime_hi; + }; + }; + union { + time_t msg_ctime; + struct { + unsigned int msg_ctime_lo; + unsigned int msg_ctime_hi; + }; + }; unsigned long msg_cbytes; msgqnum_t msg_qnum; msglen_t msg_qbytes; diff --git a/arch/powerpc/bits/msg.h b/arch/powerpc/bits/msg.h index 171c11a3..58c1e46e 100644 --- a/arch/powerpc/bits/msg.h +++ b/arch/powerpc/bits/msg.h @@ -1,11 +1,35 @@ struct msqid_ds { struct ipc_perm msg_perm; - int __unused1; - time_t msg_stime; - int __unused2; - time_t msg_rtime; - int __unused3; - time_t msg_ctime; + union { + struct { + char pad1[8 - sizeof(time_t)]; + time_t msg_stime; + }; + struct { + unsigned int msg_stime_hi; + unsigned int msg_stime_lo; + }; + }; + union { + struct { + char pad2[8 - sizeof(time_t)]; + time_t msg_rtime; + }; + struct { + unsigned int msg_rtime_hi; + unsigned int msg_rtime_lo; + }; + }; + union { + struct { + char pad3[8 - sizeof(time_t)]; + time_t msg_ctime; + }; + struct { + unsigned int msg_ctime_hi; + unsigned int msg_ctime_lo; + }; + }; unsigned long msg_cbytes; msgqnum_t msg_qnum; msglen_t msg_qbytes; diff --git a/arch/powerpc/bits/sem.h b/arch/powerpc/bits/sem.h index bc2d6d1f..f7e95d12 100644 --- a/arch/powerpc/bits/sem.h +++ b/arch/powerpc/bits/sem.h @@ -1,9 +1,25 @@ struct semid_ds { struct ipc_perm sem_perm; - int __unused1; - time_t sem_otime; - int __unused2; - time_t sem_ctime; + union { + struct { + unsigned int sem_otime_hi; + unsigned int sem_otime_lo; + }; + struct { + char pad1[8 - sizeof(time_t)]; + time_t sem_otime; + }; + }; + union { + struct { + unsigned int sem_ctime_hi; + unsigned int sem_ctime_lo; + }; + struct { + char pad2[8 - sizeof(time_t)]; + time_t sem_ctime; + }; + }; unsigned short __sem_nsems_pad, sem_nsems; long __unused3; long __unused4; diff --git a/arch/powerpc/bits/shm.h b/arch/powerpc/bits/shm.h index 40e5e8be..c8cd95cd 100644 --- a/arch/powerpc/bits/shm.h +++ b/arch/powerpc/bits/shm.h @@ -2,12 +2,36 @@ struct shmid_ds { struct ipc_perm shm_perm; - int __unused1; - time_t shm_atime; - int __unused2; - time_t shm_dtime; - int __unused3; - time_t shm_ctime; + union { + struct { + unsigned int shm_stime_hi; + unsigned int shm_stime_lo; + }; + struct { + char pad1[8 - sizeof(time_t)]; + time_t shm_atime; + }; + }; + union { + struct { + unsigned int shm_stime_hi; + unsigned int shm_stime_lo; + }; + struct { + char pad2[8 - sizeof(time_t)]; + time_t shm_dtime; + }; + }; + union { + struct { + unsigned int shm_stime_hi; + unsigned int shm_stime_lo; + }; + struct { + char pad3[8 - sizeof(time_t)]; + time_t shm_ctime; + }; + }; int __unused4; size_t shm_segsz; pid_t shm_cpid; @@ -26,4 +50,3 @@ struct shm_info { unsigned long shm_tot, shm_rss, shm_swp; unsigned long __swap_attempts, __swap_successes; }; - diff --git a/arch/sh/bits/shm.h b/arch/sh/bits/shm.h index 6cdac131..9e80bcc9 100644 --- a/arch/sh/bits/shm.h +++ b/arch/sh/bits/shm.h @@ -3,12 +3,27 @@ struct shmid_ds { struct ipc_perm shm_perm; size_t shm_segsz; - time_t shm_atime; - int __unused1; - time_t shm_dtime; - int __unused2; - time_t shm_ctime; - int __unused3; + union { + time_t shm_atime; + struct { + unsigned int shm_atime_lo; + unsigned int shm_atime_hi; + }; + }; + union { + time_t shm_dtime; + struct { + unsigned int shm_dtime_lo; + unsigned int shm_dtime_hi; + }; + }; + union { + time_t shm_ctime; + struct { + unsigned int shm_ctime_lo; + unsigned int shm_ctime_hi; + }; + }; pid_t shm_cpid; pid_t shm_lpid; unsigned long shm_nattch; diff --git a/src/ipc/msgctl.c b/src/ipc/msgctl.c index ea9b2337..5c9fb636 100644 --- a/src/ipc/msgctl.c +++ b/src/ipc/msgctl.c @@ -30,5 +30,10 @@ int msgctl(int q, int cmd, struct msqid_ds *buf) buf->msg_perm.mode >>= 16; } #endif +#ifdef __USE_TIME_BITS64 + buf->msg_stime = (time_t)buf->msg_stime_hi << 32 | buf->msg_stime_lo; + buf->msg_rtime = (time_t)buf->msg_rtime_hi << 32 | buf->msg_rtime_lo; + buf->msg_ctime = (time_t)buf->msg_ctime_hi << 32 | buf->msg_ctime_lo; +#endif return __syscall_ret(r); } diff --git a/src/ipc/semctl.c b/src/ipc/semctl.c index 941e2813..d3de75c4 100644 --- a/src/ipc/semctl.c +++ b/src/ipc/semctl.c @@ -46,5 +46,9 @@ int semctl(int id, int num, int cmd, ...) arg.buf->sem_perm.mode >>= 16; } #endif +#ifdef __USE_TIME_BITS64 + arg.buf->sem_otime = (time_t)arg.buf->sem_otime_hi << 32 | arg.buf->sem_otime_lo; + arg.buf->sem_ctime = (time_t)arg.buf->sem_ctime_hi << 32 | arg.buf->sem_ctime_lo; +#endif return __syscall_ret(r); } diff --git a/src/ipc/shmctl.c b/src/ipc/shmctl.c index c951a581..cc3f9314 100644 --- a/src/ipc/shmctl.c +++ b/src/ipc/shmctl.c @@ -30,5 +30,10 @@ int shmctl(int id, int cmd, struct shmid_ds *buf) buf->shm_perm.mode >>= 16; } #endif +#ifdef __USE_TIME_BITS64 + buf->shm_atime = (time_t)buf->shm_atime_hi << 32 | buf->shm_atime_lo; + buf->shm_dtime = (time_t)buf->shm_dtime_hi << 32 | buf->shm_dtime_lo; + buf->shm_ctime = (time_t)buf->shm_ctime_hi << 32 | buf->shm_ctime_lo; +#endif return __syscall_ret(r); } |