LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-13-2010, 06:51 AM   #1
rohandreamworld
LQ Newbie
 
Registered: Dec 2010
Posts: 2

Rep: Reputation: Disabled
Question problem with ioctl command


I am porting some of code from solaris to linux..
The following code compiles fine on linux
Code:
int parentinputfd;
int bytestoread = 0;
...

result = ioctl (parentinputfd, I_NREAD, &bytestoread);
...
But when i run my program i get errorno = 22..
which is present in errorno.h as
Quote:
#define EINVAL 22 /* Invalid argument */
And program print error as
ioctl: Invalid argument

I am not getting that why its working properly on solaris but not on linux ..

Is I_NREAD worls on linux..??
And what are the alternatives for I_NREAD
 
Old 12-13-2010, 09:25 AM   #2
Vermidias
Member
 
Registered: Dec 2010
Location: GERMANY
Posts: 32

Rep: Reputation: 2
I dont know where I_NREAD is defined but i think that could be your problem. you can define the ioctl commands in a header like this one.

http://lxr.free-electrons.com/source...linux/cs5535.h

or like in this example

http://people.ee.ethz.ch/~arkeller/l...e_howto-4.html

i hope that helps you
 
1 members found this post helpful.
Old 12-15-2010, 05:19 AM   #3
rohandreamworld
LQ Newbie
 
Registered: Dec 2010
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks Vermidias...
Thats link were very useful indeed..
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Command failed: device-mapper: reload ioctl failed: Invalid argument azza Programming 2 01-10-2011 03:16 AM
IOCTL problem in kernel, does not load root fs beli0135 Linux - General 11 07-22-2010 07:37 AM
[SOLVED] Return error from ioctl command wybourn Programming 2 07-22-2010 02:22 AM
ioctl(ATM_SETBACKEND) No such device - Speedtouch 330 problem RAFAL Linux - Software 1 05-25-2010 02:21 AM
How to pass IOCTL arguments from usespace ioctl call devkpict Linux - Kernel 1 12-07-2007 06:45 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration