Howto cancel a blocked termios read request

Eric Norum norume at aps.anl.gov
Tue May 8 14:55:37 UTC 2007


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

-- 
Eric Norum <norume at aps.anl.gov>
Advanced Photon Source
Argonne National Laboratory
(630) 252-4793





More information about the users mailing list