struct kernel_shmid64_ds
{
struct ipc_perm shm_perm; /* operation permission struct */
- unsigned long int shm_atime_high;
+ unsigned long int __shm_atime_high;
unsigned long int shm_atime; /* time of last shmat() */
- unsigned long int shm_dtime_high;
+ unsigned long int __shm_dtime_high;
unsigned long int shm_dtime; /* time of last shmdt() */
- unsigned long int shm_ctime_high;
+ unsigned long int __shm_ctime_high;
unsigned long int shm_ctime; /* time of last change by shmctl() */
unsigned long int __pad;
size_t shm_segsz; /* size of segment in bytes */
struct ipc_perm shm_perm;
size_t shm_segsz;
unsigned long int shm_atime;
- unsigned long int shm_atime_high;
+ unsigned long int __shm_atime_high;
unsigned long int shm_dtime;
- unsigned long int shm_dtime_high;
+ unsigned long int __shm_dtime_high;
unsigned long int shm_ctime;
- unsigned long int shm_ctime_high;
+ unsigned long int __shm_ctime_high;
__pid_t shm_cpid;
__pid_t shm_lpid;
unsigned long int shm_nattch;
#if (__WORDSIZE == 32 \
&& (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32))
# define __IPC_TIME64 1
+/* Left-shift using unsigned int, since __time64_t is signed. */
+# define IPC_HILO(__buf, __member) \
+ ((__buf)->__member | (0ULL + (__buf)->__##__member##_high) << 32)
#else
# define __IPC_TIME64 0
#endif
unsigned long int __unused1;
unsigned long int __unused2;
#else
- unsigned short int shm_atime_high;
- unsigned short int shm_dtime_high;
- unsigned short int shm_ctime_high;
+ unsigned short int __shm_atime_high;
+ unsigned short int __shm_dtime_high;
+ unsigned short int __shm_ctime_high;
unsigned short int __ununsed1;
#endif
};
msqid_to_msqid64 (struct __msqid64_ds *mq64, const struct msqid_ds *mq)
{
mq64->msg_perm = mq->msg_perm;
- mq64->msg_stime = mq->msg_stime
- | ((__time64_t) mq->__msg_stime_high << 32);
- mq64->msg_rtime = mq->msg_rtime
- | ((__time64_t) mq->__msg_rtime_high << 32);
- mq64->msg_ctime = mq->msg_ctime
- | ((__time64_t) mq->__msg_ctime_high << 32);
+ mq64->msg_stime = IPC_HILO (mq, msg_stime);
+ mq64->msg_rtime = IPC_HILO (mq, msg_rtime);
+ mq64->msg_ctime = IPC_HILO (mq, msg_ctime);
mq64->msg_cbytes = mq->msg_cbytes;
mq64->msg_qnum = mq->msg_qnum;
mq64->msg_qbytes = mq->msg_qbytes;
struct kernel_shmid64_ds
{
struct ipc_perm shm_perm;
- unsigned long int shm_atime_high;
+ unsigned long int __shm_atime_high;
unsigned long int shm_atime;
- unsigned long int shm_dtime_high;
+ unsigned long int __shm_dtime_high;
unsigned long int shm_dtime;
- unsigned long int shm_ctime_high;
+ unsigned long int __shm_ctime_high;
unsigned long int shm_ctime;
unsigned long int __ununsed1;
size_t shm_segsz;
semid_to_semid64 (struct __semid64_ds *ds64, const struct semid_ds *ds)
{
ds64->sem_perm = ds->sem_perm;
- ds64->sem_otime = ds->sem_otime
- | ((__time64_t) ds->__sem_otime_high << 32);
- ds64->sem_ctime = ds->sem_ctime
- | ((__time64_t) ds->__sem_ctime_high << 32);
+ ds64->sem_otime = IPC_HILO (ds, sem_otime);
+ ds64->sem_ctime = IPC_HILO (ds, sem_ctime);
ds64->sem_nsems = ds->sem_nsems;
}
kshmid->shm_perm = shmid64->shm_perm;
kshmid->shm_segsz = shmid64->shm_segsz;
kshmid->shm_atime = shmid64->shm_atime;
- kshmid->shm_atime_high = shmid64->shm_atime >> 32;
+ kshmid->__shm_atime_high = shmid64->shm_atime >> 32;
kshmid->shm_dtime = shmid64->shm_dtime;
- kshmid->shm_dtime_high = shmid64->shm_dtime >> 32;
+ kshmid->__shm_dtime_high = shmid64->shm_dtime >> 32;
kshmid->shm_ctime = shmid64->shm_ctime;
- kshmid->shm_ctime_high = shmid64->shm_ctime >> 32;
+ kshmid->__shm_ctime_high = shmid64->shm_ctime >> 32;
kshmid->shm_cpid = shmid64->shm_cpid;
kshmid->shm_lpid = shmid64->shm_lpid;
kshmid->shm_nattch = shmid64->shm_nattch;
{
shmid64->shm_perm = kshmid->shm_perm;
shmid64->shm_segsz = kshmid->shm_segsz;
- shmid64->shm_atime = kshmid->shm_atime
- | ((__time64_t) kshmid->shm_atime_high << 32);
- shmid64->shm_dtime = kshmid->shm_dtime
- | ((__time64_t) kshmid->shm_dtime_high << 32);
- shmid64->shm_ctime = kshmid->shm_ctime
- | ((__time64_t) kshmid->shm_ctime_high << 32);
+ shmid64->shm_atime = IPC_HILO (kshmid, shm_atime);
+ shmid64->shm_dtime = IPC_HILO (kshmid, shm_dtime);
+ shmid64->shm_ctime = IPC_HILO (kshmid, shm_ctime);
shmid64->shm_cpid = kshmid->shm_cpid;
shmid64->shm_lpid = kshmid->shm_lpid;
shmid64->shm_nattch = kshmid->shm_nattch;
{
shm64->shm_perm = shm->shm_perm;
shm64->shm_segsz = shm->shm_segsz;
- shm64->shm_atime = shm->shm_atime
- | ((__time64_t) shm->__shm_atime_high << 32);
- shm64->shm_dtime = shm->shm_dtime
- | ((__time64_t) shm->__shm_dtime_high << 32);
- shm64->shm_ctime = shm->shm_ctime
- | ((__time64_t) shm->__shm_ctime_high << 32);
+ shm64->shm_atime = IPC_HILO (shm, shm_atime);
+ shm64->shm_dtime = IPC_HILO (shm, shm_dtime);
+ shm64->shm_ctime = IPC_HILO (shm, shm_ctime);
shm64->shm_cpid = shm->shm_cpid;
shm64->shm_lpid = shm->shm_lpid;
shm64->shm_nattch = shm->shm_nattch;
struct kernel_shmid64_ds
{
struct ipc_perm shm_perm;
- unsigned long int shm_atime_high;
+ unsigned long int __shm_atime_high;
unsigned long int shm_atime;
- unsigned long int shm_dtime_high;
+ unsigned long int __shm_dtime_high;
unsigned long int shm_dtime;
- unsigned long int shm_ctime_high;
+ unsigned long int __shm_ctime_high;
unsigned long int shm_ctime;
size_t shm_segsz;
__pid_t shm_cpid;
struct ipc_perm shm_perm;
size_t shm_segsz;
unsigned long int shm_atime;
- unsigned long int shm_atime_high;
+ unsigned long int __shm_atime_high;
unsigned long int shm_dtime;
- unsigned long int shm_dtime_high;
+ unsigned long int __shm_dtime_high;
unsigned long int shm_ctime;
- unsigned long int shm_ctime_high;
+ unsigned long int __shm_ctime_high;
__pid_t shm_cpid;
__pid_t shm_lpid;
unsigned long int shm_nattch;