[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Howto cancel a blocked termios read request (corrected)



Oops, there are typos. Sorry.

Sounds good, Eric. This call will introduce *not* many lines to termios; a 
couple of lines *should* be enough.

I will implement this support in the next few days and we can discuss
afterwards about putting it in or not.


Eric Norum schrieb:
> At the expense of yet more bloat in termios.c perhaps the best thing  
> would be to add support for an FIOCANCEL ioctl request (like vxWorks  
> provides):
> 
>         ioctl(fd, FIOCANCEL, NULL);
> 
> Might be a addition to the network stack, too.
> 
> On May 8, 2007, at 6:19 AM, Joel Sherrill wrote:
> 
>> Wolfram Wadepohl wrote:
>>
>>> 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?
>>
>> Can that semaphore be flushed?  I don't know what the API would be to
>> the user but that should
>> end up returning not satisfied.
>>
>> It would also allow it to be canceled on a signal.
>>
>> --joel
>>
>>> thanks.
>>>
>>> --------------------------------------------------------------------- 
>>> ---
>>>
>>> _______________________________________________
>>> rtems-users mailing list
>>> rtems-users at rtems.com
>>> http://rtems.rtems.org/mailman/listinfo/rtems-users
>>>
>>
>> _______________________________________________
>> rtems-users mailing list
>> rtems-users at rtems.com
>> http://rtems.rtems.org/mailman/listinfo/rtems-users
> 
> 


-- 
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 --------------
An embedded and charset-unspecified text was scrubbed...
Name: file:///D|/TMP/nsmail-1.txt
Url: http://rtems.rtems.org/pipermail/rtems-users/attachments/20070509/35cff2c4/attachment.txt 
-------------- 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://rtems.rtems.org/pipermail/rtems-users/attachments/20070509/35cff2c4/attachment.bin