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>
20 #include <afs/afs_args.h>
22 #include <sys/ioctl.h>
23 #if defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)
31 #include "afssyscalls.h"
33 #ifdef AFS_LINUX20_ENV
34 int proc_afs_syscall(long syscall, long param1, long param2, long param3,
35 long param4, int *rval) {
36 struct afsprocdata syscall_data;
37 int fd = open(PROC_SYSCALL_FNAME, O_RDWR);
39 fd = open(PROC_SYSCALL_ARLA_FNAME, O_RDWR);
43 syscall_data.syscall = syscall;
44 syscall_data.param1 = param1;
45 syscall_data.param2 = param2;
46 syscall_data.param3 = param3;
47 syscall_data.param4 = param4;
49 *rval = ioctl(fd, VIOC_SYSCALL, &syscall_data);
57 #if defined(AFS_DARWIN80_ENV)
58 int ioctl_afs_syscall(long syscall, long param1, long param2, long param3,
59 long param4, long param5, long param6, int *rval) {
60 struct afssysargs syscall_data;
62 int fd = open(SYSCALL_DEV_FNAME, O_RDWR);
66 syscall_data.syscall = syscall;
67 syscall_data.param1 = param1;
68 syscall_data.param2 = param2;
69 syscall_data.param3 = param3;
70 syscall_data.param4 = param4;
71 syscall_data.param5 = param5;
72 syscall_data.param6 = param6;
74 code = ioctl(fd, VIOC_SYSCALL, &syscall_data);
79 *rval=syscall_data.retval;