![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Inappropriate ioctl for device | RishiPahuja | Shell Programming and Scripting | 11 | 03-19-2008 07:47 PM |
| Inappropriate ioctl for device at | contactme | UNIX for Dummies Questions & Answers | 0 | 03-26-2007 07:22 AM |
| Inappropriate ioctl for device | steelrose | UNIX for Dummies Questions & Answers | 4 | 08-23-2006 07:08 AM |
| Inappropriate ioctl for device | tojaiganesh | Filesystems, Disks and Memory | 4 | 03-17-2005 02:23 PM |
| Warning message ioctl | Diana | UNIX Desktop for Dummies Questions & Answers | 1 | 05-01-2002 05:59 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
ioctl()
UNIX, gnu cc compiler, SUN Ultra 60
Hello, this is my first post, so please bear with me. I'm currently developing a test environment for a network subsystem that, when live, accesses databases and other network elements. However, my test environment will be run offline, so I need to fake the compiler out on several instances. I was wondering if anyone knew the details of the ioctl() command. I have already written a dummy function in its place, but right now the compiler gets confused because there are two definitions of ioctl(), but I need to have it see the one I wrote... Anyone have an idea? Thanks a lot. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
This page might be usefull for you check it out.
http://www.mkssoftware.com/docs/man3/ioctl.3.asp its a brief explanation of ioctl() and some examples also from the explanation i figured it out something similar with what you are looking for. Might help. |
|
#3
|
||||
|
||||
|
I'm not exactly sure what you're asking about
but you probably do NOT want to create your own "ioctl()". Since "ioctl()" is a UNIX system call, it may be easier to just define it out something like... #ifndef TESTRUN ioctl(...); #else ...do some dummy thing #endif Then when you "make" the program just use... make .... -DTESTRUN ...to build the "test" program. |
|
#4
|
|||
|
|||
|
Briefly the ioctl function is called with three arguments. The first is a file descriptor, a socket in the case of network programming. The second argument is the request, e.g. what you want to do, there are many of them like SIOCGIFADDR which returns to you the protocol address assigned to your interface. The third argument is a pointer and it depends of the request, for instance if you want to get interface configuration parameters the pointer is of struct ifconf type. You can check the manual page of ioctl_list so as to get a list of the available requests.
The problem is that ioctl is not the same for all unix like os, it may vary. Last week I was trying to configure a proxy arp server with ioctl but the damn thing was not working properly. I posted a mail to the linux kernel mailing list but anfortunately nobody answered. Last edited by developer; 03-18-2002 at 05:05 AM. |
|
#5
|
|||
|
|||
|
On Solaris, you may want to check out
man streamio It lists ioctls for Solaris. From your post it looks as if you are writing a distributed system, so you may want want to check out man rpc Atle
__________________
PS All of the above is to be read as '... unless I am wrong' ENDPS |
|||
| Google The UNIX and Linux Forums |