return 0;
}
-asmlinkage long
-osf_shmat(int shmid, void __user *shmaddr, int shmflg)
-{
- unsigned long raddr;
- long err;
-
- err = do_shmat(shmid, shmaddr, shmflg, &raddr);
-
- /*
- * This works because all user-level addresses are
- * non-negative longs!
- */
- return err ? err : (long)raddr;
-}
-
-
/*
* The following stuff should move into a header file should it ever
* be labeled "officially supported." Right now, there is just enough
.quad sys_semop
.quad osf_utsname
.quad sys_lchown
- .quad osf_shmat
+ .quad sys_shmat
.quad sys_shmctl /* 210 */
.quad sys_shmdt
.quad sys_shmget
}
}
-asmlinkage long sys_shmat(int shmid, char __user *shmaddr, int shmflg,
- unsigned long __user *addr)
-{
- unsigned long ret;
- long err;
-
- err = do_shmat(shmid, shmaddr, shmflg, &ret);
- if (err == 0)
- err = put_user(ret, addr);
- return err;
-}
-
/* Fork a new task - this creates a new program thread.
* This is called indirectly via a small wrapper
*/
data8 sys_msgrcv
data8 sys_msgctl
data8 sys_shmget
- data8 ia64_shmat
+ data8 sys_shmat
data8 sys_shmdt // 1115
data8 sys_shmctl
data8 sys_syslog
return PAGE_SIZE;
}
-asmlinkage unsigned long
-ia64_shmat (int shmid, void __user *shmaddr, int shmflg)
-{
- unsigned long raddr;
- int retval;
-
- retval = do_shmat(shmid, shmaddr, shmflg, &raddr);
- if (retval < 0)
- return retval;
-
- force_successful_syscall_return();
- return raddr;
-}
-
asmlinkage unsigned long
ia64_brk (unsigned long brk)
{
}
}
-/*
- * Native ABI that is O32 or N64 version
- */
-asmlinkage long sys_shmat(int shmid, char __user *shmaddr,
- int shmflg, unsigned long *addr)
-{
- unsigned long raddr;
- int err;
-
- err = do_shmat(shmid, shmaddr, shmflg, &raddr);
- if (err)
- return err;
-
- return put_user(raddr, addr);
-}
-
/*
* No implemented yet ...
*/
}
}
-long sys_shmat_wrapper(int shmid, char __user *shmaddr, int shmflag)
-{
- unsigned long raddr;
- int r;
-
- r = do_shmat(shmid, shmaddr, shmflag, &raddr);
- if (r < 0)
- return r;
- return raddr;
-}
-
/* Fucking broken ABI */
#ifdef CONFIG_64BIT
ENTRY_DIFF(msgrcv)
ENTRY_SAME(msgget) /* 190 */
ENTRY_SAME(msgctl)
- ENTRY_SAME(shmat_wrapper)
+ ENTRY_SAME(shmat)
ENTRY_SAME(shmdt)
ENTRY_SAME(shmget)
ENTRY_SAME(shmctl) /* 195 */
up_read(&uts_sem);
return err?-EFAULT:0;
}
-
-/* Copy from mips version */
-asmlinkage long sys_shmatcall(int shmid, char __user *shmaddr,
- int shmflg)
-{
- unsigned long raddr;
- int err;
-
- err = do_shmat(shmid, shmaddr, shmflg, &raddr);
- if (err)
- return err;
-
- err = raddr;
- return err;
-}
.long sys_msgrcv
.long sys_msgget
.long sys_msgctl
- .long sys_shmatcall
+ .long sys_shmat
.long sys_shmdt /* 245 */
.long sys_shmget
.long sys_shmctl
extern long old_mmap(unsigned long addr, unsigned long len,
unsigned long prot, unsigned long flags,
unsigned long fd, unsigned long pgoff);
-extern syscall_handler_t wrap_sys_shmat;
extern syscall_handler_t sys_modify_ldt;
extern syscall_handler_t sys_arch_prctl;
#include "asm/prctl.h" /* XXX This should get the constants from libc */
#include "choose-mode.h"
-/* XXX: copied from x86-64: arch/x86_64/kernel/sys_x86_64.c */
-asmlinkage long wrap_sys_shmat(int shmid, char __user *shmaddr, int shmflg)
-{
- unsigned long raddr;
-
- return do_shmat(shmid, shmaddr, shmflg, &raddr) ?: (long) raddr;
-}
-
asmlinkage long sys_uname64(struct new_utsname __user * name)
{
int err;
return err ? -EFAULT : 0;
}
-asmlinkage long wrap_sys_shmat(int shmid, char __user *shmaddr, int shmflg)
-{
- unsigned long raddr;
- return do_shmat(shmid,shmaddr,shmflg,&raddr) ?: (long)raddr;
-}
-
asmlinkage long sys_time64(long __user * tloc)
{
struct timeval now;
#define __NR_shmget 29
__SYSCALL(__NR_shmget, sys_shmget)
#define __NR_shmat 30
-__SYSCALL(__NR_shmat, wrap_sys_shmat)
+__SYSCALL(__NR_shmat, sys_shmat)
#define __NR_shmctl 31
__SYSCALL(__NR_shmctl, sys_shmctl)
asmlinkage long sys_semtimedop(int semid, struct sembuf __user *sops,
unsigned nsops,
const struct timespec __user *timeout);
-asmlinkage long sys_shmat(int shmid, char __user *shmaddr,
- int shmflg, unsigned long __user *addr);
+asmlinkage long sys_shmat(int shmid, char __user *shmaddr, int shmflg);
asmlinkage long sys_shmget(key_t key, size_t size, int flag);
asmlinkage long sys_shmdt(char __user *shmaddr);
asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf);
#include <linux/security.h>
#include <linux/syscalls.h>
#include <linux/audit.h>
+#include <linux/ptrace.h>
+
#include <asm/uaccess.h>
#include "util.h"
return err;
}
+asmlinkage long sys_shmat(int shmid, char __user *shmaddr, int shmflg)
+{
+ unsigned long ret;
+ long err;
+
+ err = do_shmat(shmid, shmaddr, shmflg, &ret);
+ if (err)
+ return err;
+ force_successful_syscall_return();
+ return (long)ret;
+}
+
/*
* detach and kill segment if marked destroyed.
* The work is done in shm_close.
cond_syscall(sys_msgrcv);
cond_syscall(sys_msgctl);
cond_syscall(sys_shmget);
+cond_syscall(sys_shmat);
cond_syscall(sys_shmdt);
cond_syscall(sys_shmctl);
cond_syscall(sys_mq_open);