Re: style: clean up mentions of old-style C

2023-04-16 Thread Roland Illig
Am 17.04.2023 um 02:55 schrieb David Holland: On Sat, Apr 15, 2023 at 11:47:08AM +0200, Roland Illig wrote: > Since C90, function prototypes are available. They have become so common > now that mentioning them is more confusing than helpful. I suggest > removing these two lines: > > >

Re: flock(2): locking against itself?

2023-04-16 Thread Mouse
>> (1) [libcurses] does not get along with input and/or output being >> set non-blocking. > Bug. Well...see below. > While, in principle, when you're using curses it owns both the input > and the output, in practice because curses input can't cope with > select loops it's common for curses appli

Re: style: clean up mentions of old-style C

2023-04-16 Thread David Holland
On Mon, Apr 17, 2023 at 03:06:53AM +0200, Joerg Sonnenberger wrote: > > The second point is an important part of the traditional layout, and I > > think the first is still worth stating. You _still_ see K&R-style > > code, 35-odd years notwithstanding. > > I'd suggest to also explicitly call

Re: style: clean up mentions of old-style C

2023-04-16 Thread Joerg Sonnenberger
On Mon, Apr 17, 2023 at 12:55:13AM +, David Holland wrote: > On Sat, Apr 15, 2023 at 11:47:08AM +0200, Roland Illig wrote: > > Since C90, function prototypes are available. They have become so common > > now that mentioning them is more confusing than helpful. I suggest > > removing these tw

Re: style: clean up mentions of old-style C

2023-04-16 Thread David Holland
On Sat, Apr 15, 2023 at 11:47:08AM +0200, Roland Illig wrote: > Since C90, function prototypes are available. They have become so common > now that mentioning them is more confusing than helpful. I suggest > removing these two lines: > > > * Use ANSI function declarations. ANSI function bra

Re: flock(2): locking against itself?

2023-04-16 Thread David Holland
On Mon, Apr 17, 2023 at 12:19:19AM +, David Holland wrote: > However, I'd expect that getting a second open of the same tty for the > output would work around this. (dup isn't enough, but a new open > should work, because non-blocking I/O is a file-handle-level mode, not > a tty driver mode

Re: flock(2): locking against itself?

2023-04-16 Thread David Holland
On Sun, Apr 16, 2023 at 12:28:03AM -0400, Mouse wrote: > Back on 2023-03-30, I posted to tech-kern on a thread that had drifted > off-topic for tech-kern, into tech-userlevel territory. I was writing > about bad interactions between libcurses and nonblocking I/O. > > [...] > > It seems to

Re: flock(2): locking against itself?

2023-04-16 Thread Mouse
>>> [...]. I have a program that uses curses for output but wants to >>> do non-blocking input. So I set stdin nonblocking and threw fd 0 >>> into the poll() loop. >>> But, in normal use, stdin and stdout come from the same open on the >>> session's tty, so setting stdin nonblocking also sets st

Re: flock(2): locking against itself?

2023-04-16 Thread RVP
On Sun, 16 Apr 2023, Mouse wrote: In particular, I wrote [...]. I have a program that uses curses for output but wants to do non-blocking input. So I set stdin nonblocking and threw fd 0 into the poll() loop. But, in normal use, stdin and stdout come from the same open on the session's tt