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
10 #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS)
13 * /usr/include/sys/vice.h
15 * Definitions required by user processes needing extended vice facilities
18 * NOTE: /usr/include/sys/remote.h contains definitions common between
19 * Venus and the kernel.
20 * /usr/local/include/viceioctl.h contains ioctl definitions common
21 * between user processes and Venus.
23 #include <afs/param.h>
25 #include <sys/ioccom.h>
29 /* a fixed size, whether the kernel uses the ILP32 or LP64 data models */
31 unsigned int in, out; /* Data to be transferred in, or out */
32 short in_size; /* Size of input buffer <= 2K */
33 short out_size; /* Maximum size of output buffer, <= 2K */
37 #ifndef AFS_NT40_ENV /* NT decl in sys/pioctl_nt.h with pioctl() decl */
39 caddr_t in, out; /* Data to be transferred in, or out */
40 short in_size; /* Size of input buffer <= 2K */
41 short out_size; /* Maximum size of output buffer, <= 2K */
45 /* The 2K limits above are a consequence of the size of the kernel buffer
46 used to buffer requests from the user to venus--2*MAXPATHLEN.
47 The buffer pointers may be null, or the counts may be 0 if there
48 are no input or output parameters
51 * The structure argument to _IOW() is used to add a structure
52 * size component to the _IOW() value, to help the kernel code identify
53 * how big a structure the calling process is passing into a system
56 * In user space, struct ViceIoctl32 and struct ViceIoctl are the same
57 * except on Digital Unix, where user space code is compiled in 64-bit
60 * So, in kernel space, regardless whether it is compiled in 32-bit
61 * mode or 64-bit mode, the kernel code can use the struct ViceIoctl32
62 * version of _IOW() to check the size of user space arguments -- except
65 #if defined(KERNEL) && !defined(AFS_OSF_ENV) && !defined(AFS_ALPHA_LINUX20_ENV)
66 #define _VICEIOCTL(id) ((unsigned int ) _IOW('V', id, struct ViceIoctl32))
68 #define _VICEIOCTL(id) ((unsigned int ) _IOW('V', id, struct ViceIoctl))
71 /* Use this macro to define up to 256 vice ioctl's. These ioctl's
72 all potentially have in/out parameters--this depends upon the
73 values in the ViceIoctl structure. This structure is itself passed
74 into the kernel by the normal ioctl parameter passing mechanism.
77 #define _VALIDVICEIOCTL(com) (com >= _VICEIOCTL(0) && com <= _VICEIOCTL(255))