File: ioctl.c

package info (click to toggle)
kernel-source-2.0.32 2.0.32-5
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 29,648 kB
  • ctags: 86,850
  • sloc: ansic: 542,141; asm: 26,201; makefile: 3,423; sh: 1,195; perl: 727; tcl: 408; cpp: 277; lisp: 211; awk: 134
file content (35 lines) | stat: -rw-r--r-- 620 bytes parent folder | download | duplicates (7)
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
/*
 *  ioctl.c
 *
 *  Copyright (C) 1995, 1996 by Volker Lendecke
 *
 */

#include <asm/segment.h>
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/smb_fs.h>
#include <linux/ioctl.h>
#include <linux/sched.h>
#include <linux/mm.h>

int
smb_ioctl(struct inode *inode, struct file *filp,
	  unsigned int cmd, unsigned long arg)
{
	int result;

	switch (cmd)
	{
	case SMB_IOC_GETMOUNTUID:
		if ((result = verify_area(VERIFY_WRITE, (uid_t *) arg,
					  sizeof(uid_t))) != 0)
		{
			return result;
		}
		put_fs_word(SMB_SERVER(inode)->m.mounted_uid, (uid_t *) arg);
		return 0;
	default:
		return -EINVAL;
	}
}