This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] libio: Avoid dup already opened file descriptor [BZ#21393]



On 22/05/2017 17:04, Siddhesh Poyarekar wrote:
> On Monday 22 May 2017 10:55 PM, Adhemerval Zanella wrote:
>>  If the operation fails, a null pointer is returned; otherwise,
>> -@code{freopen} returns @var{stream}.
>> +@code{freopen} returns @var{stream}.  Also for Linux, due internal dup3
>> +usage, it might fail with errno set to EBUSY during a race condition
>> +with @code{open} and @code{dup}.
> 
> On Linux, @code{freopen} may fail and set @code{errno} to @{EBUSY} when
> the kernel structure for the old file descriptor was not initialized
> completely before @code{freopen} was called.
> 
> OK with that change.
> 
> Siddhesh
> 

Alright, I will change it (I based this doc from freopen(3) btw).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]