Implement the extattr(3) family of syscalls.

XXX However, those remain untested as there are currently no backend for
XXX extattr(9) in NetBSD.
This commit is contained in:
cube 2005-07-08 21:39:39 +00:00
parent 3429324371
commit dfc332d6df
2 changed files with 281 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_netbsd.c,v 1.90 2005/07/04 00:26:06 cube Exp $ */
/* $NetBSD: netbsd32_netbsd.c,v 1.91 2005/07/08 21:39:39 cube Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.90 2005/07/04 00:26:06 cube Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.91 2005/07/08 21:39:39 cube Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ddb.h"
@ -2286,3 +2286,245 @@ netbsd32_uuidgen(struct lwp *l, void *v, register_t *retval)
NETBSD32TO64_UAP(count);
return (sys_uuidgen(l, &ua, retval));
}
int
netbsd32_extattrctl(struct lwp *l, void *v, register_t *retval)
{
struct netbsd32_extattrctl_args /* {
syscallarg(const netbsd32_charp) path;
syscallarg(int) cmd;
syscallarg(const netbsd32_charp) filename;
syscallarg(int) attrnamespace;
syscallarg(const netbsd32_charp) attrname;
} */ *uap = v;
struct sys_extattrctl_args ua;
NETBSD32TOP_UAP(path, const char);
NETBSD32TO64_UAP(cmd);
NETBSD32TOP_UAP(filename, const char);
NETBSD32TO64_UAP(attrnamespace);
NETBSD32TOP_UAP(attrname, const char);
return sys_extattrctl(l, &ua, retval);
}
int
netbsd32_extattr_set_fd(struct lwp *l, void *v, register_t *retval)
{
struct netbsd32_extattr_set_fd_args /* {
syscallarg(int) fd;
syscallarg(int) attrnamespace;
syscallarg(const netbsd32_charp) attrname;
syscallarg(const netbsd32_voidp) data;
syscallarg(netbsd32_size_t) nbytes;
} */ *uap = v;
struct sys_extattr_set_fd_args ua;
NETBSD32TO64_UAP(fd);
NETBSD32TO64_UAP(attrnamespace);
NETBSD32TOP_UAP(attrname, const char);
NETBSD32TOP_UAP(data, const void);
NETBSD32TOX_UAP(nbytes, size_t);
return sys_extattr_set_fd(l, &ua, retval);
}
int
netbsd32_extattr_set_file(struct lwp *l, void *v, register_t *retval)
{
struct netbsd32_extattr_set_file_args /* {
syscallarg(const netbsd32_charp) path;
syscallarg(int) attrnamespace;
syscallarg(const netbsd32_charp) attrname;
syscallarg(const netbsd32_voidp) data;
syscallarg(netbsd32_size_t) nbytes;
} */ *uap = v;
struct sys_extattr_set_file_args ua;
NETBSD32TOP_UAP(path, const char);
NETBSD32TO64_UAP(attrnamespace);
NETBSD32TOP_UAP(attrname, const char);
NETBSD32TOP_UAP(data, const void);
NETBSD32TOX_UAP(nbytes, size_t);
return sys_extattr_set_file(l, &ua, retval);
}
int
netbsd32_extattr_set_link(struct lwp *l, void *v, register_t *retval)
{
struct netbsd32_extattr_set_link_args /* {
syscallarg(const netbsd32_charp) path;
syscallarg(int) attrnamespace;
syscallarg(const netbsd32_charp) attrname;
syscallarg(const netbsd32_voidp) data;
syscallarg(netbsd32_size_t) nbytes;
} */ *uap = v;
struct sys_extattr_set_link_args ua;
NETBSD32TOP_UAP(path, const char);
NETBSD32TO64_UAP(attrnamespace);
NETBSD32TOP_UAP(attrname, const char);
NETBSD32TOP_UAP(data, const void);
NETBSD32TOX_UAP(nbytes, size_t);
return sys_extattr_set_link(l, &ua, retval);
}
int
netbsd32_extattr_get_fd(struct lwp *l, void *v, register_t *retval)
{
struct netbsd32_extattr_get_fd_args /* {
syscallarg(int) fd;
syscallarg(int) attrnamespace;
syscallarg(const netbsd32_charp) attrname;
syscallarg(netbsd32_voidp) data;
syscallarg(netbsd32_size_t) nbytes;
} */ *uap = v;
struct sys_extattr_get_fd_args ua;
NETBSD32TO64_UAP(fd);
NETBSD32TO64_UAP(attrnamespace);
NETBSD32TOP_UAP(attrname, const char);
NETBSD32TOP_UAP(data, void);
NETBSD32TOX_UAP(nbytes, size_t);
return sys_extattr_get_fd(l, &ua, retval);
}
int
netbsd32_extattr_get_file(struct lwp *l, void *v, register_t *retval)
{
struct netbsd32_extattr_get_file_args /* {
syscallarg(const netbsd32_charp) path;
syscallarg(int) attrnamespace;
syscallarg(const netbsd32_charp) attrname;
syscallarg(netbsd32_voidp) data;
syscallarg(netbsd32_size_t) nbytes;
} */ *uap = v;
struct sys_extattr_get_file_args ua;
NETBSD32TOP_UAP(path, const char);
NETBSD32TO64_UAP(attrnamespace);
NETBSD32TOP_UAP(attrname, const char);
NETBSD32TOP_UAP(data, void);
NETBSD32TOX_UAP(nbytes, size_t);
return sys_extattr_get_file(l, &ua, retval);
}
int
netbsd32_extattr_get_link(struct lwp *l, void *v, register_t *retval)
{
struct netbsd32_extattr_get_link_args /* {
syscallarg(const netbsd32_charp) path;
syscallarg(int) attrnamespace;
syscallarg(const netbsd32_charp) attrname;
syscallarg(netbsd32_voidp) data;
syscallarg(netbsd32_size_t) nbytes;
} */ *uap = v;
struct sys_extattr_get_link_args ua;
NETBSD32TOP_UAP(path, const char);
NETBSD32TO64_UAP(attrnamespace);
NETBSD32TOP_UAP(attrname, const char);
NETBSD32TOP_UAP(data, void);
NETBSD32TOX_UAP(nbytes, size_t);
return sys_extattr_get_link(l, &ua, retval);
}
int
netbsd32_extattr_delete_fd(struct lwp *l, void *v, register_t *retval)
{
struct netbsd32_extattr_delete_fd_args /* {
syscallarg(int) fd;
syscallarg(int) attrnamespace;
syscallarg(const netbsd32_charp) attrname;
} */ *uap = v;
struct sys_extattr_delete_fd_args ua;
NETBSD32TO64_UAP(fd);
NETBSD32TO64_UAP(attrnamespace);
NETBSD32TOP_UAP(attrname, const char);
return sys_extattr_delete_fd(l, &ua, retval);
}
int
netbsd32_extattr_delete_file(struct lwp *l, void *v, register_t *retval)
{
struct netbsd32_extattr_delete_file_args /* {
syscallarg(const netbsd32_charp) path;
syscallarg(int) attrnamespace;
syscallarg(const netbsd32_charp) attrname;
} */ *uap = v;
struct sys_extattr_delete_file_args ua;
NETBSD32TOP_UAP(path, const char);
NETBSD32TO64_UAP(attrnamespace);
NETBSD32TOP_UAP(attrname, const char);
return sys_extattr_delete_file(l, &ua, retval);
}
int
netbsd32_extattr_delete_link(struct lwp *l, void *v, register_t *retval)
{
struct netbsd32_extattr_delete_link_args /* {
syscallarg(const netbsd32_charp) path;
syscallarg(int) attrnamespace;
syscallarg(const netbsd32_charp) attrname;
} */ *uap = v;
struct sys_extattr_delete_link_args ua;
NETBSD32TOP_UAP(path, const char);
NETBSD32TO64_UAP(attrnamespace);
NETBSD32TOP_UAP(attrname, const char);
return sys_extattr_delete_link(l, &ua, retval);
}
int
netbsd32_extattr_list_fd(struct lwp *l, void *v, register_t *retval)
{
struct netbsd32_extattr_list_fd_args /* {
syscallarg(int) fd;
syscallarg(int) attrnamespace;
syscallarg(netbsd32_voidp) data;
syscallarg(netbsd32_size_t) nbytes;
} */ *uap = v;
struct sys_extattr_list_fd_args ua;
NETBSD32TO64_UAP(fd);
NETBSD32TO64_UAP(attrnamespace);
NETBSD32TOP_UAP(data, void);
NETBSD32TOX_UAP(nbytes, size_t);
return sys_extattr_list_fd(l, &ua, retval);
}
int
netbsd32_extattr_list_file(struct lwp *l, void *v, register_t *retval)
{
struct netbsd32_extattr_list_file_args /* {
syscallarg(const netbsd32_charp) path;
syscallarg(int) attrnamespace;
syscallarg(netbsd32_voidp) data;
syscallarg(netbsd32_size_t) nbytes;
} */ *uap = v;
struct sys_extattr_list_file_args ua;
NETBSD32TOP_UAP(path, const char);
NETBSD32TO64_UAP(attrnamespace);
NETBSD32TOP_UAP(data, void);
NETBSD32TOX_UAP(nbytes, size_t);
return sys_extattr_list_file(l, &ua, retval);
}
int
netbsd32_extattr_list_link(struct lwp *l, void *v, register_t *retval)
{
struct netbsd32_extattr_list_link_args /* {
syscallarg(const netbsd32_charp) path;
syscallarg(int) attrnamespace;
syscallarg(netbsd32_voidp) data;
syscallarg(netbsd32_size_t) nbytes;
} */ *uap = v;
struct sys_extattr_list_link_args ua;
NETBSD32TOP_UAP(path, const char);
NETBSD32TO64_UAP(attrnamespace);
NETBSD32TOP_UAP(data, void);
NETBSD32TOX_UAP(nbytes, size_t);
return sys_extattr_list_link(l, &ua, retval);
}

View File

@ -1,4 +1,4 @@
$NetBSD: syscalls.master,v 1.28 2005/07/04 00:26:07 cube Exp $
$NetBSD: syscalls.master,v 1.29 2005/07/08 21:39:39 cube Exp $
; from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp
; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
@ -561,3 +561,39 @@
int flags); }
359 STD { int netbsd32_fhstatvfs1(const netbsd32_fhandlep_t fhp, \
netbsd32_statvfsp_t buf, int flags); }
360 STD { int netbsd32_extattrctl(const netbsd32_charp path, \
int cmd, const netbsd32_charp filename, int attrnamespace, \
const netbsd32_charp attrname); }
361 STD { int netbsd32_extattr_set_file(const netbsd32_charp path, \
int attrnamespace, const netbsd32_charp attrname, \
const netbsd32_voidp data, netbsd32_size_t nbytes); }
362 STD { int netbsd32_extattr_get_file(const netbsd32_charp path, \
int attrnamespace, const netbsd32_charp attrname, \
netbsd32_voidp data, netbsd32_size_t nbytes); }
363 STD { int netbsd32_extattr_delete_file(const netbsd32_charp path, \
int attrnamespace, const netbsd32_charp attrname); }
364 STD { int netbsd32_extattr_set_fd(int fd, \
int attrnamespace, const netbsd32_charp attrname, \
const netbsd32_voidp data, netbsd32_size_t nbytes); }
365 STD { int netbsd32_extattr_get_fd(int fd, \
int attrnamespace, const netbsd32_charp attrname, \
netbsd32_voidp data, netbsd32_size_t nbytes); }
366 STD { int netbsd32_extattr_delete_fd(int fd, \
int attrnamespace, const netbsd32_charp attrname); }
367 STD { int netbsd32_extattr_set_link(const netbsd32_charp path, \
int attrnamespace, const netbsd32_charp attrname, \
const netbsd32_voidp data, netbsd32_size_t nbytes); }
368 STD { int netbsd32_extattr_get_link(const netbsd32_charp path, \
int attrnamespace, const netbsd32_charp attrname, \
netbsd32_voidp data, netbsd32_size_t nbytes); }
369 STD { int netbsd32_extattr_delete_link(const netbsd32_charp path, \
int attrnamespace, const netbsd32_charp attrname); }
370 STD { int netbsd32_extattr_list_fd(int fd, \
int attrnamespace, netbsd32_voidp data, \
netbsd32_size_t nbytes); }
371 STD { int netbsd32_extattr_list_file(const netbsd32_charp path, \
int attrnamespace, netbsd32_voidp data, \
netbsd32_size_t nbytes); }
372 STD { int netbsd32_extattr_list_link(const netbsd32_charp path, \
int attrnamespace, netbsd32_voidp data, \
netbsd32_size_t nbytes); }