On Tuesday 16 May 2006 16:18, Alain Michaud wrote:

> Do I need open a "file deccriptor" in order to communicate using
> IOCTL?

Yes, you have to open the device before talking to it. Or what the hell 
do you think, the "Handle" parameter of

|Function  FpIOCtl      (Handle:cint;Ndx: culong;Data: Pointer):cint;

is for?

As always: RTFM, reading the man page (man 2 ioctl) actually might help 
too:

|DESCRIPTION
|       [...] The arguĀ­ment d must be an open file descriptor.
|
|RETURN VALUE
|       Usually, on success zero is returned.  A  few  ioctls  use
|       the  return value as an output parameter and return a nonĀ­
|       negative value on success.  On error, -1 is returned,  and
|       errno is set appropriately.

BTW, I agree - writing device drivers sucks. I know. :-)

But checking out

http://www.freesoftwaremagazine.com/articles/drivers_linux

may be worth a try.


Regards,

Vinzent.

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to