Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux HostsFree MagazinesJobs
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > Linux Programming & Scripting
Reload this Page read : I/O possible
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Linux Programming & Scripting C, Perl, PHP, Bash Scripts, anything programming or script related post in here!

Reply
 
Thread Tools Display Modes
Old 07-21-2008   #1 (permalink)
Just Joined!
 
Join Date: Jul 2008
Location: Toulouse-France
Posts: 7
Send a message via MSN to Galadrin
Exclamation read : I/O possible

Hi, sorry for my english

I try to get data from a serial port on /dev/ttyS*.
my serial port is open and all is good but when the data arrived on the input, i have te following message and my application down.

"I/O possible"

I have configured my serial port in asynchronous, VMIN = 100, VTIME=0.
have you any idea about my problem?

(my application get GPS data on this serial port)

thank's a lot for your answer
Galadrin is offline   Reply With Quote
Old 07-21-2008   #2 (permalink)
Linux Engineer
 
wje_lf's Avatar
 
Join Date: Sep 2007
Location: Mariposa
Posts: 1,018
What language are you programming in? C?
__________________
--
Bill

Old age and treachery will overcome youth and skill.
wje_lf is offline   Reply With Quote
Old 07-21-2008   #3 (permalink)
Just Joined!
 
Join Date: Jul 2008
Location: Toulouse-France
Posts: 7
Send a message via MSN to Galadrin
my programmation language is the C, I have test on a linux Debian distibution and on the target, cross compillation with arm-linux-gcc.

my EDI is Eclipse
Galadrin is offline   Reply With Quote
Old 07-21-2008   #4 (permalink)
Linux Engineer
 
wje_lf's Avatar
 
Join Date: Sep 2007
Location: Mariposa
Posts: 1,018
When you say you have the message "I/O possible", do you mean that your program is outputting that message? If so, it's because you put the code there to do that. So the next question is: how do you get to that point in your code? Can you show us a relevant piece of your code?

(To make it easy to read, when you've pasted it in your edit buffer, please highlight the code and click the octothorpe (the # icon) at the top of your edit window.)

But if your program is not itself outputting "I/O possible", I don't know what to say.
__________________
--
Bill

Old age and treachery will overcome youth and skill.
wje_lf is offline   Reply With Quote
Old 07-21-2008   #5 (permalink)
Just Joined!
 
Join Date: Jul 2008
Location: Toulouse-France
Posts: 7
Send a message via MSN to Galadrin
Quote:
When you say you have the message "I/O possible", do you mean that your program is outputting that message? If so, it's because you put the code there to do that.
I don't say that from my program, in my program I have et simple
Code:
read (my_file_descriptor_not_NULL, My_buffer, 100);
the read on my file descriptor is not O_NONBLOCK so while i have no data in my serial port input, all is ok, I'm stoped.

but when I have data, I have the line "I/O possible" and the program is exited!!
I WOULD MY DATA lol, not the information about they are here

I put my code tomorow morning (I'm french, it's 10h pm).

Last edited by Galadrin; 07-21-2008 at 09:52 PM. Reason: a little fault of english
Galadrin is offline   Reply With Quote
Old 07-21-2008   #6 (permalink)
Linux Engineer
 
wje_lf's Avatar
 
Join Date: Sep 2007
Location: Mariposa
Posts: 1,018
The message "I/O possible" has to come from somewhere: if not in your C program, then in some library you call.

Please know that VMIN = 100, VTIME=0 means don't return until 100 bytes have been input. Is that your intent?
__________________
--
Bill

Old age and treachery will overcome youth and skill.
wje_lf is offline   Reply With Quote
Old 07-21-2008   #7 (permalink)
Just Joined!
 
Join Date: Jul 2008
Location: Toulouse-France
Posts: 7
Send a message via MSN to Galadrin
yes I would this fonctionnement, I receive a lot of GPS data from my receiver, and I don't have a continuous iteration of read for keep some times for my other thread (she print GPS statistic on the screen).

my issue is realy in the read return, I don't know why he kill my application after "I/O possible" print.... it's not documented
Galadrin is offline   Reply With Quote
Old 07-21-2008   #8 (permalink)
Linux Engineer
 
wje_lf's Avatar
 
Join Date: Sep 2007
Location: Mariposa
Posts: 1,018
Quote:
my issue is realy in the read return, I don't know why he kill my application after "I/O possible" print
If you write a small program which does nothing but this:
  1. open the serial port
  2. read one byte
  3. print out that byte in hexadecimal ("%X\n" format)
  4. exit your program
it would be interesting to see whether you get "I/O possible". It's almost certain you won't get that message.

Then input 100 bytes instead of one byte. See whether the message appears.

Continue to make the program more and more like your original program. When the "I/O possible" message appears after changing your program, it's probably your most recent change that causes that message to appear.

I know this isn't terribly helpful, but there's more going on here than just the read(), and this will help isolate the problem.
__________________
--
Bill

Old age and treachery will overcome youth and skill.
wje_lf is offline   Reply With Quote
Old 07-21-2008   #9 (permalink)
Just Joined!
 
Join Date: Jul 2008
Location: Toulouse-France
Posts: 7
Send a message via MSN to Galadrin
I have make a test of the errno value only but kill of my program => no print

I will make a little test following your plan, and if I have no result, I have a big issue

with my first test program, all is good, but I havn't touch the serial port part (open, read)
Galadrin is offline   Reply With Quote
Old 07-31-2008   #10 (permalink)
Just Joined!
 
Join Date: Jul 2008
Posts: 5
I am getting the same condition on a TS-7800 ARM board running Debian flavor of Linux. Simply doing a read() on an open port. I can transmit from it just fine ... but get an character in and the program aborts with the "I/O possible" error. Researching this now. Thinking there is a 'signal' being generated and not caught, but I am looking. Just letting you know you are no alone with this problem!
rclark is offline   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
 

Free Magazines
Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe
Systems Management News, the newspaper for IT systems administration and data center managers!
Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe
The Enterprise Newsweekly
eWeek is the essential technology information source for builders of e-business.
subscribe
Oracle Magazine
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe
Total Telecom
Total Telecom is "The Economist of the communications industry".
subscribe
More free magazines »



All times are GMT. The time now is 03:08 AM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.2.0