Recent

Author Topic: Mac IOCTL function  (Read 9945 times)

bah

  • New Member
  • *
  • Posts: 14
Mac IOCTL function
« on: July 06, 2007, 01:28:59 am »
Hi,
  Does anyone know what unit the fpioctl function resides in?  (i.e which unit to add to the uses clause)
Thanks for your time

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Mac IOCTL function
« Reply #1 on: July 06, 2007, 02:14:21 am »
Quote from: "bah"
Hi,
  Does anyone know what unit the fpioctl function resides in?  (i.e which unit to add to the uses clause)
Thanks for your time


That sounds vaguely unix-y. Did you try the unix unit?

A better question: What are you trying to do?

Thanks.

bah

  • New Member
  • *
  • Posts: 14
RE: Re: Mac IOCTL function
« Reply #2 on: July 06, 2007, 02:55:06 am »
Hi,
   I have an example c program (from Mac OS X Internals) that uses ioctl() to find information about the disk drive.  For example to get the Block Size you call:
ioctl(fd, DKIOGETBLOCKSIZE, @blocksize);
where fd is just a file handle to say '/dev/rdisk0', DKIO.. is just a constant (I can look those up in the Darwin source), and blocksize is just a int64 variable that will contain the block size after the call.  Alll fairly standard stuff.
The question becomes - where is ioctl()?  I know it is in the termiosproc.inc file, but other than that I don't know what unit you should use to be able to access it.  I know it will be somthing simple - but sometimes those are the hardest.
Thanks for any help.

 

TinyPortal © 2005-2018