The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
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

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 03-07-2002
Registered User
 

Join Date: Mar 2002
Posts: 6
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.
Reply With Quote
Forum Sponsor
  #2  
Old 03-07-2002
killerserv's Avatar
Unix Predator
 

Join Date: Dec 2000
Location: Phoenix, AZ
Posts: 670
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.
Reply With Quote
  #3  
Old 03-08-2002
rwb1959's Avatar
Registered User
 

Join Date: Aug 2001
Location: Virginia, USA
Posts: 438
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.
Reply With Quote
  #4  
Old 03-14-2002
Registered User
 

Join Date: Dec 2001
Location: UK
Posts: 23
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.
Reply With Quote
  #5  
Old 03-16-2002
Registered User
 

Join Date: Feb 2002
Location: Brabant, Belgium
Posts: 65
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
Reply With Quote
Google The UNIX and Linux Forums
Reply

« fscanf() | Rpc »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 06:19 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0