[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 05/12] linux-user: Conditionally Pass Attribute Pointe
From: |
Tom Musta |
Subject: |
[Qemu-ppc] [PATCH 05/12] linux-user: Conditionally Pass Attribute Pointer to mq_open() |
Date: |
Mon, 4 Aug 2014 11:45:32 -0500 |
The mq_open system call takes an optional struct mq_attr pointer
argument in the fourth position. This pointer is used when O_CREAT
is specified in the flags (second) argument. It may be NULL, in
which case the queue is created with implementation defined attributes.
Change the code to properly handle the case when NULL is passed in the
arg4 position.
Signed-off-by: Tom Musta <address@hidden>
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index bf6dd1e..c0c0434 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -9078,12 +9078,16 @@ abi_long do_syscall(void *cpu_env, int num, abi_long
arg1,
#if defined(TARGET_NR_mq_open) && defined(__NR_mq_open)
case TARGET_NR_mq_open:
{
- struct mq_attr posix_mq_attr;
+ struct mq_attr posix_mq_attr, *attrp;
p = lock_user_string(arg1 - 1);
- if (arg4 != 0)
+ if (arg4 != 0) {
copy_from_user_mq_attr (&posix_mq_attr, arg4);
- ret = get_errno(mq_open(p, arg2, arg3, &posix_mq_attr));
+ attrp = &posix_mq_attr;
+ } else {
+ attrp = 0;
+ }
+ ret = get_errno(mq_open(p, arg2, arg3, attrp));
unlock_user (p, arg1, 0);
}
break;
--
1.7.1
- [Qemu-ppc] [PATCH 00/12] target-ppc: Linux-User Mode Bug Fixes for Power, Tom Musta, 2014/08/04
- [Qemu-ppc] [PATCH 01/12] linux-user: PPC64 semid_ds Doesnt Include _unused1 and _unused2, Tom Musta, 2014/08/04
- [Qemu-ppc] [PATCH 02/12] linux-user: Dereference Pointer Argument to ipc/semctl Sys Call, Tom Musta, 2014/08/04
- [Qemu-ppc] [PATCH 03/12] linux-user: Properly Handle semun Structure In Cross-Endian Situations, Tom Musta, 2014/08/04
- [Qemu-ppc] [PATCH 04/12] linux-user: Make ipc syscall's third argument an abi_long, Tom Musta, 2014/08/04
- [Qemu-ppc] [PATCH 05/12] linux-user: Conditionally Pass Attribute Pointer to mq_open(),
Tom Musta <=
- [Qemu-ppc] [PATCH 06/12] linux-user: Detect Negative Message Sizes in msgsnd System Call, Tom Musta, 2014/08/04
- [Qemu-ppc] [PATCH 07/12] linux-user: Handle NULL argument to sched_{get, set}param, Tom Musta, 2014/08/04
- [Qemu-ppc] [PATCH 08/12] linux-user: Detect fault in sched_rr_get_interval, Tom Musta, 2014/08/04
- [Qemu-ppc] [PATCH 09/12] linux-user: Minimum Sig Handler Stack Size for PPC64 ELF V2, Tom Musta, 2014/08/04