[PATCH] Fix alpha semctl
Jakub Jelinek
jakub@redhat.com
Thu Oct 19 13:13:00 GMT 2000
Hi!
semctl syscall (unlike sys_ipc wrapper) takes union semun argument itself,
not the address of it. We cannot pass *CHECK_SEMCTL() as 4th argument,
because union cannot be converted to long in INLINE_SYSCALL, so we pass one
of the pointers which will have the same value as the union itself.
2000-10-19 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/alpha/semctl.c (__new_semctl): Pass union
semun as 4th argument to semctl syscall, not address of it.
--- libc/sysdeps/unix/sysv/linux/alpha/semctl.c 2000/07/31 20:42:36 1.1.1.4
+++ libc/sysdeps/unix/sysv/linux/alpha/semctl.c 2000/10/19 16:58:19 1.3
@@ -73,7 +73,7 @@ __new_semctl (int semid, int semnum, int
#if __ASSUME_32BITUIDS > 0
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
switch (cmd) {
case SEM_STAT:
@@ -82,7 +82,7 @@ __new_semctl (int semid, int semnum, int
break;
default:
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
/* Unfortunately there is no way how to find out for sure whether
we should use old or new semctl. */
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)
return result;
@@ -113,7 +113,7 @@ __new_semctl (int semid, int semnum, int
}
}
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)
{
memset(buf, 0, sizeof(*buf));
Jakub
More information about the Libc-hacker
mailing list