SYS_FUNC(msgget)
{
- if (tcp->u_arg[0])
- tprintf("%#lx, ", tcp->u_arg[0]);
+ const int key = (int) tcp->u_arg[0];
+ if (key)
+ tprintf("%#x", key);
else
- tprints("IPC_PRIVATE, ");
+ tprints("IPC_PRIVATE");
+ tprints(", ");
if (printflags(resource_flags, tcp->u_arg[1] & ~0777, NULL) != 0)
tprints("|");
print_numeric_umode_t(tcp->u_arg[1] & 0777);
SYS_FUNC(semget)
{
- if (tcp->u_arg[0])
- tprintf("%#lx", tcp->u_arg[0]);
+ const int key = (int) tcp->u_arg[0];
+ if (key)
+ tprintf("%#x", key);
else
tprints("IPC_PRIVATE");
tprintf(", %lu, ", tcp->u_arg[1]);
SYS_FUNC(shmget)
{
- if (tcp->u_arg[0])
- tprintf("%#lx", tcp->u_arg[0]);
+ const int key = (int) tcp->u_arg[0];
+ if (key)
+ tprintf("%#x", key);
else
tprints("IPC_PRIVATE");
tprintf(", %lu, ", tcp->u_arg[1]);
int
main(void)
{
+ static const key_t private_key =
+ (key_t) (0xffffffff00000000ULL | IPC_PRIVATE);
int rc;
struct msqid_ds ds;
- id = msgget(IPC_PRIVATE, 0600);
+ id = msgget(private_key, 0600);
if (id < 0)
perror_msg_and_skip("msgget");
printf("msgget\\(IPC_PRIVATE, 0600\\) += %d\n", id);
int
main(void)
{
+ static const key_t private_key =
+ (key_t) (0xffffffff00000000ULL | IPC_PRIVATE);
int rc;
union semun un;
struct semid_ds ds;
struct seminfo info;
- id = semget(IPC_PRIVATE, 1, 0600);
+ id = semget(private_key, 1, 0600);
if (id < 0)
perror_msg_and_skip("semget");
printf("semget\\(IPC_PRIVATE, 1, 0600\\) += %d\n", id);
int
main(void)
{
+ static const key_t private_key =
+ (key_t) (0xffffffff00000000ULL | IPC_PRIVATE);
int rc;
struct shmid_ds ds;
- id = shmget(IPC_PRIVATE, 1, 0600);
+ id = shmget(private_key, 1, 0600);
if (id < 0)
perror_msg_and_skip("shmget");
printf("shmget\\(IPC_PRIVATE, 1, 0600\\) += %d\n", id);