[Top][All Lists]

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

Re: bash sets O_NONBLOCK on pts

From: Andrew Church
Subject: Re: bash sets O_NONBLOCK on pts
Date: Thu, 03 Oct 2019 02:49:36 +0900

>Well, it's not so uncommon, I had it a few times. Reading on internet
>it seems that other users have it but don't notice it.

The fault could be in some other program accessing the terminal.  Bash
does not clear O_NONBLOCK on displaying a prompt, so if a previously
executed program sets O_NONBLOCK on stdin and then exits, that state
will remain until some other program unsets it.  For example:

$ cat >foo.c
#include <fcntl.h>
int main(void) {fcntl(0, F_SETFL, O_NONBLOCK); return 0;}
$ cc foo.c
$ ./a.out
$ cat
cat: -: Resource temporarily unavailable

  --Andrew Church

reply via email to

[Prev in Thread] Current Thread [Next in Thread]