Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading comment? #24

Open
peter-mogensen opened this issue Mar 17, 2016 · 0 comments
Open

Misleading comment? #24

peter-mogensen opened this issue Mar 17, 2016 · 0 comments

Comments

@peter-mogensen
Copy link

I was wondering about the comment in line 529:
"// returns a dup(2) - FD_CLOEXEC flag not set"

Is that strictly correct? If I call syscall.Syscall to GETFD , the value is 1

Isn't what happens that .File() actually returns a os.File with an FD with FD_CLOEXEC set (using dupCloseOnExec() in net/fd_unix.go )
And then... when you call
cmd := exec.Command(path, args...)
err = cmd.Start()
... the Go stdlib clears CLOEXEC on the files you put in cmd.ExtraFiles as a part of forkAndExecInChild() when it shuffles file descriptors around ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant