(__new_semctl): Pass union semun as 4th argument to semctl syscall, not
address of it.
This commit is contained in:
parent
d9c1416a4a
commit
d0168cc099
|
@ -73,7 +73,7 @@ __new_semctl (int semid, int semnum, int cmd, ...)
|
||||||
|
|
||||||
#if __ASSUME_32BITUIDS > 0
|
#if __ASSUME_32BITUIDS > 0
|
||||||
return INLINE_SYSCALL (semctl, 4, semid, semnum, cmd | __IPC_64,
|
return INLINE_SYSCALL (semctl, 4, semid, semnum, cmd | __IPC_64,
|
||||||
CHECK_SEMCTL (&arg, semid, cmd | __IPC_64));
|
CHECK_SEMCTL (&arg, semid, cmd | __IPC_64)->array);
|
||||||
#else
|
#else
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SEM_STAT:
|
case SEM_STAT:
|
||||||
|
@ -82,7 +82,7 @@ __new_semctl (int semid, int semnum, int cmd, ...)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return INLINE_SYSCALL (semctl, 4, semid, semnum, cmd,
|
return INLINE_SYSCALL (semctl, 4, semid, semnum, cmd,
|
||||||
CHECK_SEMCTL (&arg, semid, cmd));
|
CHECK_SEMCTL (&arg, semid, cmd)->array);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -93,7 +93,7 @@ __new_semctl (int semid, int semnum, int cmd, ...)
|
||||||
/* Unfortunately there is no way how to find out for sure whether
|
/* Unfortunately there is no way how to find out for sure whether
|
||||||
we should use old or new semctl. */
|
we should use old or new semctl. */
|
||||||
result = INLINE_SYSCALL (semctl, 4, semid, semnum, cmd | __IPC_64,
|
result = INLINE_SYSCALL (semctl, 4, semid, semnum, cmd | __IPC_64,
|
||||||
CHECK_SEMCTL (&arg, semid, cmd | __IPC_64));
|
CHECK_SEMCTL (&arg, semid, cmd | __IPC_64)->array);
|
||||||
if (result != -1 || errno != EINVAL)
|
if (result != -1 || errno != EINVAL)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ __new_semctl (int semid, int semnum, int cmd, ...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result = INLINE_SYSCALL (semctl, 4, semid, semnum, cmd,
|
result = INLINE_SYSCALL (semctl, 4, semid, semnum, cmd,
|
||||||
CHECK_SEMCTL (&arg, semid, cmd));
|
CHECK_SEMCTL (&arg, semid, cmd)->array);
|
||||||
if (result != -1 && cmd != IPC_SET)
|
if (result != -1 && cmd != IPC_SET)
|
||||||
{
|
{
|
||||||
memset(buf, 0, sizeof(*buf));
|
memset(buf, 0, sizeof(*buf));
|
||||||
|
|
Loading…
Reference in New Issue