Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 12 Mar 2024 14:54:09 +0100
From: Florian Weimer <fweimer@...hat.com>
To: Gabriel Ravier <gabravier@...il.com>
Cc: Rich Felker <dalias@...c.org>,  "Skyler Ferrante (RIT Student)"
 <sjf5462@....edu>,  musl@...ts.openwall.com,  Andreas Schwab
 <schwab@...e.de>,  Alejandro Colomar <alx@...nel.org>,  Thorsten Glaser
 <tg@...bsd.de>,  NRK <nrk@...root.org>,  Guillem Jover
 <guillem@...rons.org>,  libc-alpha@...rceware.org,
  libbsd@...ts.freedesktop.org,  "Serge E. Hallyn" <serge@...lyn.com>,
  Iker Pedrosa <ipedrosa@...hat.com>,  Christian Brauner
 <christian@...uner.io>
Subject: Re: Re: Tweaking the program name for <err.h> functions

* Gabriel Ravier:

> Doing this would break many programs, such as:
> - most of coreutils, e.g. programs like ls, cat or head, since they
>   always `close` their input and output descriptors (when they've
>   written or read something) to make sure to diagnose all errors

A slightly better way to do this is to do fflush (stdout) followed by
error checking on close (dup (fileno (stdout))).  We can't do this
implicitly as part of fflush because it potentially breaks legacy
(non-OFD) POSIX file locking, at least not without parsing /proc and
whatnot.  The close system call is how the Linux NFS client reports
ENOSPC errors without performing a costly fsync on the server.  We don't
have a better interface for this.

Thanks,
Florian

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.