tech-kern archive

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

Re: Closing a serial device takes one second

On 6 Feb, 2014, at 08:18 , Marc Balmer <> wrote:
> Closing a serial port (e.g. /dev/dtyXX) takes almost exactly one second.
> Why is that so?  Why does the call not return immediately?
> int fd;
> fd = open("/dev/dty03", O_RDWR);  /* returns immediately */
> close(fd); /* returns after one second */

The com driver (at least) sometimes pauses for a second after DTR is
deasserted in the last close to make sure the thing it is talking to
notices the hangup before the next open asserts DTR again.

I can't remember the last time I used a serial port to talk to something
that cared much about DTR.

Dennis Ferguson

Home | Main Index | Thread Index | Old Index