-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathioctl.c
75 lines (65 loc) · 1.95 KB
/
ioctl.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/***************************************************************************
*
* Copyright (c) 1997-2022 Jeff V. Merkey
* 7260 SE Tenino St.
* Portland, Oregon 97206
* jeffmerkey@gmail.com
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the Lesser GNU Public License as published by the
* Free Software Foundation, version 2.1, or any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* Original Authorship :
* source code written by Jeff V. Merkey
*
* Original Contributors :
* Jeff V. Merkey
*
*
*
****************************************************************************
*
*
* AUTHOR : Jeff V. Merkey (jeffmerkey@gmail.com)
* FILE : IOCTL.C
* DESCRIP : VFS IOCTL Module for Linux
* DATE : December 6, 1998
*
*
***************************************************************************/
#include "globals.h"
#if (LINUX_20 | LINUX_22 | LINUX_24)
int nwfs_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg)
{
// DOS DOS_S;
// register DOS *dos = &DOS_S;
ULONG Attributes;
#if (VERBOSE)
NWFSPrint("nwfs-ioctl\n");
#endif
switch (cmd)
{
case NWFS_GET_ATTRIBUTES:
if (NWFSCopyToUserSpace((void *)arg, (void *)&Attributes, 4))
return -EFAULT;
return 0;
case NWFS_SET_ATTRIBUTES:
if (NWFSCopyFromUserSpace((void *)&Attributes, (void *)arg, 4))
return -EFAULT;
return 0;
case NWFS_GET_TRUSTEES:
case NWFS_GET_QUOTA:
case NWFS_SET_TRUSTEES:
case NWFS_SET_QUOTA:
return 0;
default:
return -EINVAL;
}
}
#endif