Can anyone point me in the direction of some documentation for the 'select' statement in C. Checked my reference books and google but can't find anything. Cheers!
Can anyone point me in the direction of some documentation for the 'select' statement in C. Checked my reference books and google but can't find anything. Cheers!
I don't believe I've ever seen a select statement in C. While the absence of evidence is not in and of itself evidence, are you sure there IS a select statement in C? If so, where did you hear about it?
select statement? Perhaps you could give some context of what you are referring to with a little snippet of code..?
Last edited by kermit; 09-11-2004 at 10:24 AM.
OK, I posted a question about serial port programming on www.linuxforum.com/forums. They suggested the use of ther select statement for something I want to do.
I managed to compile the example he gave in gcc under fedore core 2 so it must exist. Would just like to understand it before I proceed any further. Thanks.Code:select(fd+1, &rdfs, NULL, NULL, &tv);
i still got no idea what you mean.
where is this select function from and what does it do?
There is no such function in standard C. You can either post the example code they gave you and we'd be able to see if it's a user defined function or some other API and send you in the right direction. Do you know C?
Yes I know C. This is not a user defined function and it compiles under gcc / I thought gcc was pretty much standard c but maybe it's specific to it. The select statement is used to wait for data to be available on the serial port and to set a timeout. That's as much information as I can provide on it. Thanks.
In case you don't already have these resources:
Serial HOWTO
Serial Programming HOWTO
Modem-HOWTO
SELECT(2)
gg
Thanks, didn't think to do a man select!! yes have the serial resources. Thanks to all!
You could always try the FAQ:
http://faq.cprogramming.com/cgi-bin/...=1045780608#03
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]