Re: Modify buffering of standard streams via environment variables (not LD_PRELOAD)?

2024-04-28 Thread Zachary Santer
> On Sun, 21 Apr 2024, wrotycz wrote: > > > > It seems that it's 'interleaved' when buffer is written to a file or > > pipe, and because stdout is buffered it waits until buffer is full or > > flushed, while stderr is not and it doesn't wait and write immediately. > > Right; my point was just that

Re: Modify buffering of standard streams via environment variables (not LD_PRELOAD)?

2024-04-27 Thread Carl Edquist
On Sat, 20 Apr 2024, Zachary Santer wrote: I don't know how buffering works when stdout and stderr get redirected to the same pipe. You'd think, whatever it is, it would have to be smart enough to keep them interleaved in the same order they were printed to in. That in mind, I would assume

Re: Modify buffering of standard streams via environment variables (not LD_PRELOAD)?

2024-04-20 Thread wrotycz
Sat, Apr 20, 2024 at 16:45 Carl Edquist wrote:However, stdout and stderr are still separate streams even if they refer to the same output file/pipe/device, so partial lines are not interleaved in the order that they were printed. will output abc\n123\n instead of a1b2c3\n\n, even if

Re: Modify buffering of standard streams via environment variables (not LD_PRELOAD)?

2024-04-20 Thread Carl Edquist
On Sat, 20 Apr 2024, Zachary Santer wrote: This was actually in RHEL 7. Oh. In that case it might be worth looking into ... I don't know how buffering works when stdout and stderr get redirected to the same pipe. You'd think, whatever it is, it would have to be smart enough to keep them

Re: Modify buffering of standard streams via environment variables (not LD_PRELOAD)?

2024-04-20 Thread Zachary Santer
On Sat, Apr 20, 2024 at 11:58 AM Carl Edquist wrote: > > On Thu, 18 Apr 2024, Zachary Santer wrote: > > > > Finally had a chance to try to build with 'stdbuf --output=L --error=L > > --' in front of the build script, and it caused some crazy problems. > > For what it's worth, when I was trying

Re: Modify buffering of standard streams via environment variables (not LD_PRELOAD)?

2024-04-20 Thread Carl Edquist via GNU coreutils General Discussion
On Thu, 18 Apr 2024, Zachary Santer wrote: On Wed, Mar 20, 2024 at 4:54 AM Carl Edquist wrote: However, if stdbuf's magic env vars are exported in your shell (either by doing a trick like 'export $(env -i stdbuf -oL env)', or else more simply by first starting a new shell with 'stdbuf -oL

Re: Modify buffering of standard streams via environment variables (not LD_PRELOAD)?

2024-04-19 Thread Zachary Santer
On Fri, Apr 19, 2024 at 8:26 AM Pádraig Brady wrote: > > Perhaps at this stage we should consider stdbuf ubiquitous enough to suffice, > noting that it's also supported on FreeBSD. Alternatively, if glibc were modified to act on these hypothetical environment variables, it would be trivial to

Re: Modify buffering of standard streams via environment variables (not LD_PRELOAD)?

2024-04-19 Thread Pádraig Brady
On 19/04/2024 12:36, Zachary Santer wrote: On Fri, Apr 19, 2024 at 5:32 AM Pádraig Brady wrote: env variables are what I proposed 18 years ago now: https://sourceware.org/bugzilla/show_bug.cgi?id=2457 And the "resistance to that" from the Red Hat people 24 years ago is listed on a website

Re: Modify buffering of standard streams via environment variables (not LD_PRELOAD)?

2024-04-19 Thread Zachary Santer
On Fri, Apr 19, 2024 at 5:32 AM Pádraig Brady wrote: > > env variables are what I proposed 18 years ago now: > https://sourceware.org/bugzilla/show_bug.cgi?id=2457 And the "resistance to that" from the Red Hat people 24 years ago is listed on a website that doesn't exist anymore. If I'm to

Re: Modify buffering of standard streams via environment variables (not LD_PRELOAD)?

2024-04-19 Thread Pádraig Brady
On 19/04/2024 01:16, Zachary Santer wrote: Was "RFE: enable buffering on null-terminated data" On Wed, Mar 20, 2024 at 4:54 AM Carl Edquist wrote: However, if stdbuf's magic env vars are exported in your shell (either by doing a trick like 'export $(env -i stdbuf -oL env)', or else more

Modify buffering of standard streams via environment variables (not LD_PRELOAD)?

2024-04-18 Thread Zachary Santer
Was "RFE: enable buffering on null-terminated data" On Wed, Mar 20, 2024 at 4:54 AM Carl Edquist wrote: > > However, if stdbuf's magic env vars are exported in your shell (either by > doing a trick like 'export $(env -i stdbuf -oL env)', or else more simply > by first starting a new shell with