[llvm] r297661 - Bring back r297624.

Joerg Sonnenberger via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 30 11:58:21 PDT 2017


On Thu, Mar 30, 2017 at 01:44:25PM -0400, Rafael EspĂ­ndola via llvm-commits wrote:
> On 30 March 2017 at 13:38, Yaron Keren <yaron.keren at gmail.com> wrote:
> > stdout is special since getFD (pre-commit) always returns the same file
> > descriptor, STDOUT_FILENO (1) whereas for regular files openFileForWrite
> > will return new (unique) file descriptor and then there is no problem of
> > closing one of them.
> 
> With the current code we also get an unique file descriptor for each
> call to get a stream to stdout.

Actually, no. You get a reference to the same kernel file. Many/most of the
properties of the file handle will persist and/or be shared. This is
different from (re)opening the same regular file multiple times.

Joerg


More information about the llvm-commits mailing list