Re: Basic question about IOCTL

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

 



On 19:32 Thu 07 Feb 2008, Mayank Kaushik wrote:
> I am puzzled about what IOCTLs are and what they are used for. I could not
> understand much from the the man page for ioctl.

I was very puzzled about ioctls when I first started using Unix too. :)

In any case, an ioctl is short for "I/O Control" and is used to perform
functions on device entries (/dev/video0 for example). 

> A description of what ioctls are used for (alongwith an example usage) would
> be very helpful.

An example from the video4linux subsystem would be this call to turn off
a video stream:

 enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 ret = ioctl(fd, VIDIOC_STREAMOFF, &type)

Where fd is an open /dev/video* entry.

Hope that helps.

Cheers,

	Brandon

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at 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