c - How to return from read function in Non-Canonical mode and VMIN and TIME not equal to ZERO -


i working in project in need read data usb port of linux (ubuntu 12.04 lts) computer.

i using read function read data terminal in non-canonical mode , vtime = 5 (0.5 sec) , vmin = 255, means block until first char arrives , timer start stated here:

in case of both time , min nonzero. in case, time specifies how long wait after each input character see if more input arrives. after first character received, read keeps waiting until either min bytes have arrived in all, or time elapses no further input. read blocks until first character arrives.

what want force return read function if doesn't receive character more 5 seconds.

what should ?!

as read here : http://www.gnu.org/software/libc/manual/html_node/noncanonical-input.html

vtime = 50 

will do.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -