2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
11 * The lpioctl system call. (pioctl is handled by the rmtsys layer and turned
12 * into either lpioctl or a remote call as appropriate.) It is kept separate
13 * to allow for the creation of the libkopenafs shared library without
14 * including the other system calls.
17 #include <afsconfig.h>
18 #include <afs/param.h>
22 #include <afs/afs_args.h>
24 #include "afssyscalls.h"
25 #include "sys_prototypes.h"
29 * in VRMIX, system calls look just like function calls, so we don't
30 * need to do anything!
34 #if defined(AFS_SGI_ENV)
36 #pragma weak xlpioctl = lpioctl
39 lpioctl(char *path, int cmd, void *cmarg, int follow)
41 return (syscall(AFS_PIOCTL, path, cmd, cmarg, follow));
44 #else /* AFS_SGI_ENV */
47 lpioctl(char *path, int cmd, void *cmarg, int follow)
50 #ifndef AFS_LINUX20_ENV
51 /* As kauth/user.c says, handle smoothly the case where no AFS system call
53 void (*old)(int) = signal(SIGSYS, SIG_IGN);
56 #if defined(AFS_LINUX20_ENV)
57 rval = proc_afs_syscall(AFSCALL_PIOCTL, (long)path, cmd, (long)cmarg,
61 errcode = syscall(AFS_SYSCALL, AFSCALL_PIOCTL, path, cmd, cmarg,
63 #elif defined(AFS_DARWIN80_ENV)
64 rval = ioctl_afs_syscall(AFSCALL_PIOCTL, (long)path, cmd, (long)cmarg,
65 follow, 0, 0, &errcode);
68 #elif defined(AFS_SUN511_ENV)
69 rval = ioctl_sun_afs_syscall(AFSCALL_PIOCTL, (uintptr_t)path, cmd,
70 (uintptr_t)cmarg, follow, 0, 0, &errcode);
75 errcode = syscall(AFS_SYSCALL, AFSCALL_PIOCTL, path, cmd, cmarg, follow);
78 #ifndef AFS_LINUX20_ENV
85 #endif /* !AFS_SGI_ENV */
86 #endif /* !AFS_AIX32_ENV */