Make shmctl + {IPC,SHM}_STAT work an amd64, by forcing use of IPC_64.
Following the Linux kernel behaviour.
This commit is contained in:
parent
717e1785a5
commit
4eecf433ec
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: linux_machdep.h,v 1.10 2007/12/04 18:40:13 dsl Exp $ */
|
||||
/* $NetBSD: linux_machdep.h,v 1.11 2008/01/28 14:31:35 njoly Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved.
|
||||
|
@ -116,6 +116,7 @@ __END_DECLS
|
|||
#define LINUX_UNAME_ARCH MACHINE_ARCH
|
||||
#define LINUX_NPTL
|
||||
#define LINUX_LARGEFILE64
|
||||
#define LINUX_SHMCTL_FORCEIPC64
|
||||
|
||||
/*
|
||||
* Used in ugly patch to fake device numbers.
|
||||
|
@ -126,5 +127,4 @@ __END_DECLS
|
|||
/* Major device numbers of VT device on both Linux and NetBSD. */
|
||||
#define LINUX_CONS_MAJOR 4
|
||||
|
||||
|
||||
#endif /* _AMD64_LINUX_MACHDEP_H */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: linux_ipc.c,v 1.43 2008/01/28 14:05:32 njoly Exp $ */
|
||||
/* $NetBSD: linux_ipc.c,v 1.44 2008/01/28 14:31:35 njoly Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_ipc.c,v 1.43 2008/01/28 14:05:32 njoly Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_ipc.c,v 1.44 2008/01/28 14:31:35 njoly Exp $");
|
||||
|
||||
#if defined(_KERNEL_OPT)
|
||||
#include "opt_sysv.h"
|
||||
|
@ -66,6 +66,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_ipc.c,v 1.43 2008/01/28 14:05:32 njoly Exp $")
|
|||
#include <compat/linux/linux_syscall.h>
|
||||
|
||||
#include <compat/linux/common/linux_ipccall.h>
|
||||
#include <compat/linux/common/linux_machdep.h>
|
||||
|
||||
/*
|
||||
* Note: Not all linux architechtures have explicit versions
|
||||
|
@ -485,6 +486,10 @@ linux_sys_shmctl(struct lwp *l, const struct linux_sys_shmctl_args *uap, registe
|
|||
|
||||
shmid = SCARG(uap, shmid);
|
||||
cmd = SCARG(uap, cmd);
|
||||
#ifdef LINUX_SHMCTL_FORCEIPC64
|
||||
if (cmd == LINUX_IPC_STAT || cmd == LINUX_SHM_STAT)
|
||||
cmd |= LINUX_IPC_64;
|
||||
#endif
|
||||
|
||||
switch (cmd) {
|
||||
case LINUX_IPC_STAT:
|
||||
|
|
Loading…
Reference in New Issue