🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: org.kernel.vger.linux-c-programming
1 messages
1 total messages Started by Yuri Edward Mon, 22 Jun 2020 17:09
Re: Issue with fcntl FD_CLOEXEC and execve
#1
Author: Yuri Edward
Date: Mon, 22 Jun 2020 17:09
23 lines
1903 bytes
Hello,

Thanks a lot for the tip; I changed my fcntl call to the following: 
"fcntl(myfd, F_SETFD, FD_CLOEXEC)" and that fixed the problem.

I can now run and control external processes using the same API across 
most platforms!

I wish the man pages of fcntl could have been clearer about how you were 
supposed to apply the FD_CLOEXEC flag...

Yuri Edward


On 6/21/20 9:57 PM, Florian Weimer wrote:
> * Yuri Edward:
>
>> https://github.com/BlockProject3D/Framework/blob/ProcessManagement/Base/src/Framework/System/Process.cpp
>>   > This is the main class that performs fork, pipe, read, write and
>      if (fcntl(commonfd[PIPE_WRITE], FD_CLOEXEC, 1) != 0)
>
> That's not how fcntl works.  You need to use F_GETFD and F_SETFD to
> set the FD_CLOEXEC flag.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads