Add readdir syscall.

This commit is contained in:
njoly 2007-12-26 13:50:48 +00:00
parent a09fc3498a
commit 3a6c84afbc
2 changed files with 26 additions and 4 deletions

View File

@ -1,4 +1,4 @@
$NetBSD: syscalls.master,v 1.24 2007/12/24 15:56:20 njoly Exp $
$NetBSD: syscalls.master,v 1.25 2007/12/26 13:50:48 njoly Exp $
; NetBSD i386 COMPAT_LINUX32 system call name/number "master" file.
; (See syscalls.conf to see what it is processed into.)
@ -179,7 +179,8 @@
87 STD { int linux32_sys_swapon(netbsd32_charp name); }
88 STD { int linux32_sys_reboot(int magic1, int magic2, int cmd, \
netbsd32_voidp arg); }
89 UNIMPL readdir
89 STD { int linux32_sys_readdir(int fd, netbsd32_voidp dent, \
unsigned int count); }
90 STD { int linux32_sys_old_mmap(linux32_oldmmapp lmp); }
91 NOARGS { int netbsd32_munmap(netbsd32_caddr_t addr, int len); }
92 STD { int linux32_sys_truncate(const netbsd32_charp path, \

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux32_dirent.c,v 1.4 2007/12/20 23:02:57 dsl Exp $ */
/* $NetBSD: linux32_dirent.c,v 1.5 2007/12/26 13:50:48 njoly Exp $ */
/*-
* Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@ -33,7 +33,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux32_dirent.c,v 1.4 2007/12/20 23:02:57 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux32_dirent.c,v 1.5 2007/12/26 13:50:48 njoly Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -104,3 +104,24 @@ linux32_sys_getdents64(struct lwp *l, const struct linux32_sys_getdents64_args *
return linux_sys_getdents64(l, &ua, retval);
}
int
linux32_sys_readdir(struct lwp *l, const struct linux32_sys_readdir_args *uap, register_t *retval)
{
/* {
syscallarg(int) fd;
syscallarg(struct linux32_direntp_t) dent;
syscallarg(unsigned int) count;
} */
int error;
struct linux32_sys_getdents_args da;
SCARG(&da, fd) = SCARG(uap, fd);
SCARG(&da, dent) = SCARG(uap, dent);
SCARG(&da, count) = 1;
error = linux32_sys_getdents(l, &da, retval);
if (error == 0 && *retval > 1)
*retval = 1;
return error;
}