All Forums |
Register |
Login |
Search |
Subscriptions |
My Profile |
Inbox |
Tool Warehouse |
FAQs |
Resources |
Help |
Member List |
Address Book |
Logout |
|
|
ioctl(FIONREAD) doesn't return bytes in pipe
|
Logged in as: Guest |
Users viewing this topic: none |
|
Login |
|
|
ioctl(FIONREAD) doesn't return bytes in pipe - Jul. 12, '06, 3:16:34 PM
|
|
|
gregmb
Posts: 27
Status: offline
|
When I use ioctl(pipefd, FIONREAD, &bytes)
it always returns Zero even though I just wrote x bytes into the write side of the pipe.
Is this a know bug?
Greg
|
|
|
RE: ioctl(FIONREAD) doesn't return bytes in pipe - Jul. 12, '06, 3:36:04 PM
|
|
|
gregmb
Posts: 27
Status: offline
|
further investigate show that the ioctl() returns an error reporting 'Invalid Argument'
which I seems to be the pipe fd.
Is there some other way to get the number of bytes in a pipe?
Greg
|
|
|
RE: ioctl(FIONREAD) doesn't return bytes in pipe - Jul. 12, '06, 3:48:45 PM
|
|
|
Rodney
Posts: 3714
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
The only ioctl() supported for pipes is FIONBIO on 3.5
I don't know if this has changed for later versions.
You can use select() to indicate whether something is available to be read.
|
|
|
RE: ioctl(FIONREAD) doesn't return bytes in pipe - Jul. 12, '06, 10:54:21 PM
|
|
|
markfunk
Posts: 670
Joined: Mar. 31, '03,
Status: offline
|
As far as I remember, there is no way to determine the number of bytes
currently in the pipe.
|
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
|
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts |
|
|
|