Re: g_serial hangs on write when the cable is disconnected

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

 



On Wed, Aug 5, 2015 at 6:09 PM, Peter Stuge <peter@xxxxxxxx> wrote:
> Greg KH wrote:
>> > >>     int fd = open("/dev/ttyGS0", O_RDWR | O_NONBLOCK);
>> > >
>> > > This line discipline is very different from the "traditional" tty
>> > > line discipline
> ..
>> this is a character device, with a very specific line discipline
>> that works in a very specific way and assumes you know exactly how
>> to talk to it and communicate with it properly.
>
> If the character device is called tty* then I think it is appropriate
> to expect that it (by default) behaves like a "traditional" tty device.
>
> How the kernel implements this device internally (ldisc or no)
> shouldn't matter to the user, and if it does I'd consider that a bug.
> (Sadly unfixable, because public API.)
>
> => Rather than defending unexpected behavior, why not admit that the
> name was poorly chosen and point to the device-specific requirements?

I see. Yes, if it is not supposed to behave like a traditional "tty"
device, then the name was indeed poorly chosen. Unfortunately, there
is not much that can be done about that now for compatibility reasons
as you are writing. So I just need to find how not to block then while
doing it properly. Apparently, O_NONBLOCK is not the right thing for
that as I am being told.

Thank you for your answer.

>
>
> Thanks
>
> //Peter
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux