Howto cancel a blocked termios read request

Wolfram Wadepohl Wolfram.Wadepohl at ek-automation.com
Tue May 8 06:35:35 UTC 2007


i need to cancel a blocked termios read request.

the request blocks at the tty->rawInBuf.Semaphore in fillBufferQueue():

...
	/*
	 * Wait for characters
	 */
	if ( wait ) {
		sc = rtems_semaphore_obtain (tty->rawInBuf.Semaphore,
			tty->rawInBufSemaphoreOptions,
			timeout);
		if (sc != RTEMS_SUCCESSFUL)
			break;
	}
...

using ioctl to set c_cc[VMIN] = c_cc[VTIME] = 0 does not help, because it 
changes only tty->rawInBufSemaphoreOptions, which will be in effect for the 
*next* call to rtems_semaphore_obtain().

should we put an extra rtems_semaphore_release() call in the code, when we 
set tty->rawInBufSemaphoreOptions to RTEMS_NO_WAIT (line 571) in case of 
c_cc[VMIN] = c_cc[VTIME] = 0?

any other suggestions to cancel a blocked read?
thanks.

-- 
Schöne Grüße aus Reutlingen

Wolfram Wadepohl
Forschung & Entwicklung

E&K AUTOMATION
Indumat GmbH & Co. KG
Siemensstraße 3
72766 Reutlingen
Deutschland

Tel.  +49 7121 514-289
Fax   +49 7121 514-299
eMail Wolfram.Wadepohl at ek-automation.com
       W.Wadepohl at ieee.org
WWW   http://www.ek-automation.com
       http://www.indumat.de

Diese Nachricht ist keine geschäftliche Mitteilung i. S. des EHUG.

Bitte senden Sie mir keine Word- oder PowerPoint- (tm Microsoft) Anhänge.
Senden Sie mir einfachen Text, HTML oder PDF.
Siehe http://www.gnu.org/philosophy/no-word-attachments.de.html

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3210 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.rtems.org/pipermail/users/attachments/20070508/2c1ead8c/attachment.bin>


More information about the users mailing list