diff options
| author | Andrew Morton <akpm@osdl.org> | 2004-04-11 22:55:45 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-04-11 22:55:45 -0700 |
| commit | 87c22e8470366e81aa82bcbadaf147c4ecdfb182 (patch) | |
| tree | 0c1e56a6b0f73b476f0c5ceeca9512a5c206a04b /include/linux | |
| parent | 34b98f223bb21673f4cab2f5079a763c34a67946 (diff) | |
[PATCH] compat emulation for posix message queues
From: Arnd Bergmann <arnd@arndb.de>
I have tested the code with the open posix test suite and found the same
four failures for both 64-bit and compat mode, most tests pass. The patch
is against -mc1, but I guess it also applies to the other trees around.
What worries me more than mq_attr compatibility is the conversion of struct
sigevent, which might turn out really hard when more fields in there are
used. AFAICS, the only other part in the kernel ABI is sys_timer_create(),
so maybe it's not too late to deprecate the current structure and create a
structure that can be used properly for compat syscalls.
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/compat.h | 17 | ||||
| -rw-r--r-- | include/linux/mqueue.h | 4 | ||||
| -rw-r--r-- | include/linux/posix_types.h | 1 | ||||
| -rw-r--r-- | include/linux/syscalls.h | 1 | ||||
| -rw-r--r-- | include/linux/types.h | 1 |
5 files changed, 21 insertions, 3 deletions
diff --git a/include/linux/compat.h b/include/linux/compat.h index 7b82209ab4ab..796204f59bd9 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -13,6 +13,7 @@ #include <linux/sem.h> #include <asm/compat.h> +#include <asm/siginfo.h> #define compat_jiffies_to_clock_t(x) \ (((unsigned long)(x) * COMPAT_USER_HZ) / HZ) @@ -90,6 +91,22 @@ typedef union compat_sigval { compat_uptr_t sival_ptr; } compat_sigval_t; +typedef struct compat_sigevent { + compat_sigval_t sigev_value; + compat_int_t sigev_signo; + compat_int_t sigev_notify; + union { + compat_int_t _pad[SIGEV_PAD_SIZE]; + compat_int_t _tid; + + struct { + compat_uptr_t _function; + compat_uptr_t _attribute; + } _sigev_thread; + } _sigev_un; +} compat_sigevent_t; + + long compat_sys_semctl(int first, int second, int third, void __user *uptr); long compat_sys_msgsnd(int first, int second, int third, void __user *uptr); long compat_sys_msgrcv(int first, int second, int msgtyp, int third, diff --git a/include/linux/mqueue.h b/include/linux/mqueue.h index fdab3b8ee242..fc40b774b913 100644 --- a/include/linux/mqueue.h +++ b/include/linux/mqueue.h @@ -18,9 +18,9 @@ #ifndef _LINUX_MQUEUE_H #define _LINUX_MQUEUE_H -#define MQ_PRIO_MAX 32768 +#include <linux/types.h> -typedef int mqd_t; +#define MQ_PRIO_MAX 32768 struct mq_attr { long mq_flags; /* message queue flags */ diff --git a/include/linux/posix_types.h b/include/linux/posix_types.h index 3ee2ed9de1db..f04c98cf44f3 100644 --- a/include/linux/posix_types.h +++ b/include/linux/posix_types.h @@ -42,6 +42,7 @@ typedef void (*__kernel_sighandler_t)(int); /* Type of a SYSV IPC key. */ typedef int __kernel_key_t; +typedef int __kernel_mqd_t; #include <asm/posix_types.h> diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 7ee5f67abb5f..89ffe55898f2 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -48,7 +48,6 @@ struct timex; struct timezone; struct tms; struct utimbuf; -typedef int mqd_t; struct mq_attr; #include <linux/config.h> diff --git a/include/linux/types.h b/include/linux/types.h index 3b407b06b48f..93f5f3653561 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -31,6 +31,7 @@ typedef __kernel_key_t key_t; typedef __kernel_suseconds_t suseconds_t; typedef __kernel_timer_t timer_t; typedef __kernel_clockid_t clockid_t; +typedef __kernel_mqd_t mqd_t; #ifdef __KERNEL__ typedef __kernel_uid32_t uid_t; |
