ioctl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
	I am writing a character device driver similar to that in the book LDD3
by rubini.While undersatnding the code I have got some doubt regarding
the ioctl implemtntation.
In scull.h file it is defined SCULL_IOCTQUANTUM as
#define SCULL_IOCTQUANTUM _IO(SCULL_IOC_MAGIC,   3)
here while defining there is no arguments for this call.
But while implementing that in the ioctl call 

case SCULL_IOCTQUANTUM: /* Tell: arg is the value */
		if (! capable (CAP_SYS_ADMIN))
			return -EPERM;
		scull_quantum = arg;
		break;

but here arg is assigned to scull_quantum.is it the correct?I can nt
understand how it is?

And wht is the use of  capable (CAP_SYS_ADMIN)?
will you please help me.


thanks in advance,
raja


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux