Unix Programming - ioctls in linux

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > November 2004 > ioctls in linux





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author ioctls in linux
Russell Shaw

2004-11-26, 7:50 am

Hi,
I'm using debian 2.6.8.1 kernel on a pc.

I want to use:

#include <sys/ioctl.h>
int ioctl(int d, int request, ...);

to monitor lines on a pc serial port.

/usr/include/asm/ioctls.h has a list of ioctl() commands.

How do i find out what they do and what parameters they use?
I've looked thru the kernel sources, but nothing is obvious.
Ulrich Eckhardt

2004-11-28, 5:49 pm

Russell Shaw wrote:
> I want to use:
>
> #include <sys/ioctl.h>
> int ioctl(int d, int request, ...);
>
> to monitor lines on a pc serial port.
>
> /usr/include/asm/ioctls.h has a list of ioctl() commands.
>
> How do i find out what they do and what parameters they use?
> I've looked thru the kernel sources, but nothing is obvious.


Just an advice: read the 'serial programming howto'. It was a bit outdate,
but the gist is that you don't use ioctls but the termios library.

Uli

--
http://www.erlenstar.demon.co.uk/unix/
Floyd L. Davidson

2004-11-28, 5:49 pm

Ulrich Eckhardt <doomster@knuut.de> wrote:
>Russell Shaw wrote:
>
>Just an advice: read the 'serial programming howto'. It was a bit outdate,
>but the gist is that you don't use ioctls but the termios library.
>
>Uli


The 'serial programming howto' does not cover accessing the
modem control lines on a serial port. There is no termios
functionality to do so either.

Actually the "Serial-Programming-HOWTO" is not the best (an may
be the worst) howto ever written. It is both filled with buggy
code and missing much information. A much better tutorial is

"Serial programming Guide for POSIX Operating Systems"

http://www.easysw.com/~mike/serial/

See chapter 4, "Advanced Serial Programming", where there is a
section on "Serial Port IOCTLs".

--
Floyd L. Davidson <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) floyd@barrow.com
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com