2 * linux/arch/parisc/kernel/sys_parisc.c
4 * this implements the missing syscalls.
7 #include <asm/uaccess.h>
8 #include <linux/file.h>
10 #include <linux/linkage.h>
12 #include <linux/mman.h>
13 #include <linux/smp_lock.h>
15 /* for some reason, "old_readdir" is the only syscall which does not begin
16 * with "sys_", which breaks the ENTRY_* macros in syscall.S so I "fixed"
20 int sys_old_readdir(unsigned int fd
, void *dirent
, unsigned int count
)
22 return old_readdir(fd
, dirent
, count
);
25 int sys_pipe(int *fildes
)
34 if (copy_to_user(fildes
, fd
, 2*sizeof(int)))
42 current
->state
= TASK_INTERRUPTIBLE
;
44 return -ERESTARTNOHAND
;
47 int sys_mmap(unsigned long addr
, unsigned long len
,
48 unsigned long prot
, unsigned long flags
, unsigned long fd
,
51 struct file
* file
= NULL
;
54 down(¤t
->mm
->mmap_sem
);
56 if (!(flags
& MAP_ANONYMOUS
)) {
62 flags
&= ~(MAP_EXECUTABLE
| MAP_DENYWRITE
);
63 error
= do_mmap(file
, addr
, len
, prot
, flags
, offset
);
68 up(¤t
->mm
->mmap_sem
);
72 int sys_ioperm(unsigned long from
, unsigned long num
, int on
)
77 long sys_shmat_wrapper(int shmid
, void *shmaddr
, int shmflag
)
79 extern int sys_shmat(int shmid
, char *shmaddr
, int shmflg
,
80 unsigned long * raddr
);
84 r
= sys_shmat(shmid
, shmaddr
, shmflag
, &raddr
);