LinuxQuestions.org
Review your favorite Linux distribution.
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 11-03-2004, 08:08 PM   #1
bstark
LQ Newbie
 
Registered: Nov 2004
Posts: 4

Rep: Reputation: 0
Poll with nonblocking file descriptors


I would like to use poll on regular file descriptors to achieve some asynchronous behavior in file IO. I use poll to detect whether or not a file may be written to or read from without blocking. Taking the write example, what happens if only a subset of the data may be written without blocking. I would assume the write function would return the number of bytes actually written, but I have not found any documentation to confirm that. I was also told that there was a problem with this method because of the behavior of non blocking file descriptors on regular files, but the "problem" given was vague, something to the effect that poll always returns that IO may be performed on non-blocking regular file descriptors even when it is not the case?

Brian
 
Old 11-03-2004, 08:27 PM   #2
Dave Kelly
Member
 
Registered: Aug 2004
Location: Todd Mission Texas
Distribution: Linspire
Posts: 215

Rep: Reputation: 31
If you're using C, consult your K&R book, section 8.2 Low Level I/O - Read and Write.
 
  


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
Increasing File Descriptors Geoffrey_Firmin Slackware 5 04-21-2008 09:48 AM
how to make nonblocking FILE *fp? Thinking Programming 1 09-14-2005 05:07 AM
file descriptors node047 Linux - Newbie 1 03-29-2005 05:47 AM
unix file descriptors versus c FILE pointers nodger Programming 9 11-25-2004 07:02 AM
File descriptors odd question ferreter Linux - General 2 02-13-2003 10:21 AM

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

All times are GMT -5. The time now is 06:07 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