Skip to content

Commit

Permalink
OS-2870 lx brand add stubs for *xattr()
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Perkin committed Mar 31, 2014
1 parent 75c15d4 commit 0e920d1
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 10 deletions.
3 changes: 2 additions & 1 deletion usr/src/lib/brand/lx/lx_brand/Makefile.com
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ COBJS = clock.o \
sysv_ipc.o \
time.o \
truncate.o \
wait.o
wait.o \
xattr.o

CMNOBJS = lx_signum.o
ASOBJS = lx_handler.o lx_runexe.o lx_crt.o
Expand Down
18 changes: 9 additions & 9 deletions usr/src/lib/brand/lx/lx_brand/common/lx_brand.c
Original file line number Diff line number Diff line change
Expand Up @@ -1142,15 +1142,15 @@ static struct lx_sysent sysents[] = {
{"setxattr", NULL, NOSYS_NO_EQUIV, 0}, /* 226 */
{"lsetxattr", NULL, NOSYS_NO_EQUIV, 0}, /* 227 */
{"fsetxattr", NULL, NOSYS_NO_EQUIV, 0}, /* 228 */
{"getxattr", NULL, NOSYS_NO_EQUIV, 0}, /* 229 */
{"lgetxattr", NULL, NOSYS_NO_EQUIV, 0}, /* 230 */
{"fgetxattr", NULL, NOSYS_NO_EQUIV, 0}, /* 231 */
{"listxattr", NULL, NOSYS_NO_EQUIV, 0}, /* 232 */
{"llistxattr", NULL, NOSYS_NO_EQUIV, 0}, /* 233 */
{"flistxattr", NULL, NOSYS_NO_EQUIV, 0}, /* 234 */
{"removexattr", NULL, NOSYS_NO_EQUIV, 0}, /* 235 */
{"lremovexattr", NULL, NOSYS_NO_EQUIV, 0}, /* 236 */
{"fremovexattr", NULL, NOSYS_NO_EQUIV, 0}, /* 237 */
{"getxattr", lx_xattr4, 0, 4}, /* 229 */
{"lgetxattr", lx_xattr4, 0, 4}, /* 230 */
{"fgetxattr", lx_xattr4, 0, 4}, /* 231 */
{"listxattr", lx_xattr3, 0, 3}, /* 232 */
{"llistxattr", lx_xattr3, 0, 3}, /* 233 */
{"flistxattr", lx_xattr3, 0, 3}, /* 234 */
{"removexattr", lx_xattr2, 0, 2}, /* 235 */
{"lremovexattr", lx_xattr2, 0, 2}, /* 236 */
{"fremovexattr", lx_xattr2, 0, 2}, /* 237 */
{"tkill", lx_tkill, 0, 2}, /* 238 */
{"sendfile64", lx_sendfile64, 0, 4}, /* 239 */
{"futex", lx_futex, EBP_HAS_ARG6, 6}, /* 240 */
Expand Down
57 changes: 57 additions & 0 deletions usr/src/lib/brand/lx/lx_brand/common/xattr.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/

/*
* Copyright 2014 Joyent, Inc. All rights reserved.
*/

/*
* *xattr() family of functions.
*
* These are currently unimplemented. We return EOPNOTSUPP for now, rather
* than using NOSYS_NO_EQUIV to avoid unwanted stderr output from ls(1).
*/

#include <errno.h>
#include <sys/types.h>
#include <sys/lx_types.h>
#include <sys/lx_syscall.h>

int
lx_xattr2(uintptr_t p1, uintptr_t p2)
{

return (-EOPNOTSUPP);
}

int
lx_xattr3(uintptr_t p1, uintptr_t p2, uintptr_t p3)
{

return (-EOPNOTSUPP);
}

int
lx_xattr4(uintptr_t p1, uintptr_t p2, uintptr_t p3, uintptr_t p4)
{

return (-EOPNOTSUPP);
}
4 changes: 4 additions & 0 deletions usr/src/lib/brand/lx/lx_brand/sys/lx_syscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ extern int lx_sched_setscheduler(uintptr_t, uintptr_t, uintptr_t);
extern int lx_sched_get_priority_min(uintptr_t);
extern int lx_sched_get_priority_max(uintptr_t);

extern int lx_xattr2(uintptr_t, uintptr_t);
extern int lx_xattr3(uintptr_t, uintptr_t, uintptr_t);
extern int lx_xattr4(uintptr_t, uintptr_t, uintptr_t, uintptr_t);

extern int lx_keyctl(void);

extern int lx_ipc(uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t);
Expand Down

0 comments on commit 0e920d1

Please sign in to comment.