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
9 * This file contains any necessary C glue to allow programs to communicate
10 * with the AFS kernel module. The necessary lower-level glue is defined in
14 #include <afsconfig.h>
15 #include <afs/param.h>
18 #include <afs/afs_args.h>
20 #include <sys/ioctl.h>
26 #include "afssyscalls.h"
28 #ifdef AFS_LINUX20_ENV
29 int proc_afs_syscall(long syscall, long param1, long param2, long param3,
30 long param4, int *rval) {
31 struct afsprocdata syscall_data;
32 int fd = open(PROC_SYSCALL_FNAME, O_RDWR);
34 fd = open(PROC_SYSCALL_ARLA_FNAME, O_RDWR);
38 syscall_data.syscall = syscall;
39 syscall_data.param1 = param1;
40 syscall_data.param2 = param2;
41 syscall_data.param3 = param3;
42 syscall_data.param4 = param4;
44 *rval = ioctl(fd, VIOC_SYSCALL, &syscall_data);
52 #if defined(AFS_DARWIN80_ENV)
53 int ioctl_afs_syscall(long syscall, long param1, long param2, long param3,
54 long param4, long param5, long param6, int *rval) {
55 struct afssysargs syscall_data;
57 int fd = open(SYSCALL_DEV_FNAME, O_RDWR);
61 syscall_data.syscall = syscall;
62 syscall_data.param1 = param1;
63 syscall_data.param2 = param2;
64 syscall_data.param3 = param3;
65 syscall_data.param4 = param4;
66 syscall_data.param5 = param5;
67 syscall_data.param6 = param6;
69 code = ioctl(fd, VIOC_SYSCALL, &syscall_data);
74 *rval=syscall_data.retval;