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 * /usr/include/sys/vice.h
13 * Definitions required by user processes needing extended vice facilities
16 * NOTE: /usr/include/sys/remote.h contains definitions common between
17 * Venus and the kernel.
18 * /usr/local/include/viceioctl.h contains ioctl definitions common
19 * between user processes and Venus.
21 #include <afs/param.h>
23 #include <sys/ioccom.h>
27 /* a fixed size, whether the kernel uses the ILP32 or LP64 data models */
29 unsigned int in, out; /* Data to be transferred in, or out */
30 short in_size; /* Size of input buffer <= 2K */
31 short out_size; /* Maximum size of output buffer, <= 2K */
35 #ifndef AFS_NT40_ENV /* NT decl in sys/pioctl_nt.h with pioctl() decl */
37 caddr_t in, out; /* Data to be transferred in, or out */
38 short in_size; /* Size of input buffer <= 2K */
39 short out_size; /* Maximum size of output buffer, <= 2K */
43 /* The 2K limits above are a consequence of the size of the kernel buffer
44 used to buffer requests from the user to venus--2*MAXPATHLEN.
45 The buffer pointers may be null, or the counts may be 0 if there
46 are no input or output parameters
49 * The structure argument to _IOW() is used to add a structure
50 * size component to the _IOW() value, to help the kernel code identify
51 * how big a structure the calling process is passing into a system
54 * In user space, struct ViceIoctl32 and struct ViceIoctl are the same
55 * except on Digital Unix, where user space code is compiled in 64-bit
58 * So, in kernel space, regardless whether it is compiled in 32-bit
59 * mode or 64-bit mode, the kernel code can use the struct ViceIoctl32
60 * version of _IOW() to check the size of user space arguments -- except
63 #if defined(KERNEL) && !defined(AFS_OSF_ENV) && !defined(AFS_ALPHA_LINUX20_ENV)
64 #define _VICEIOCTL(id) ((unsigned int ) _IOW('V', id, struct ViceIoctl32))
65 #define _VICEIOCTL2(dev, id) ((unsigned int ) _IOW(dev, id, struct ViceIoctl32))
67 #define _VICEIOCTL(id) ((unsigned int ) _IOW('V', id, struct ViceIoctl))
68 #define _VICEIOCTL2(dev, id) ((unsigned int ) _IOW(dev, id, struct ViceIoctl))
70 #define _CVICEIOCTL(id) _VICEIOCTL2('C', id)
71 #define _OVICEIOCTL(id) _VICEIOCTL2('O', id)
73 /* Use this macro to define up to 256 vice ioctl's. These ioctl's
74 all potentially have in/out parameters--this depends upon the
75 values in the ViceIoctl structure. This structure is itself passed
76 into the kernel by the normal ioctl parameter passing mechanism.