bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bash: Correct usage of F_SETFD


From: Sukadev Bhattiprolu
Subject: bash: Correct usage of F_SETFD
Date: Mon, 22 Nov 2010 12:16:20 -0800
User-agent: Mutt/1.5.18 (2008-05-17)

include/filecntl.h in bash-4.1 has following:

#define SET_CLOSE_ON_EXEC(fd)  (fcntl ((fd), F_SETFD, FD_CLOEXEC))

Is that really the correct/intended usage of F_SETFD ?

If kernel ever adds a new flag to the fd, this would end up clearing the
other new flag right ?

Shouldn't bash use F_GETFD to get the current flags and set/clear just
the FD_CLOEXEC bit ?

Sukadev



reply via email to

[Prev in Thread] Current Thread [Next in Thread]