ichinose9372 / 42-webserv

c++でnginxを作る課題
2 stars 0 forks source link

fcntl(fd, F_SETFL, O_NONBLOCK, FD_CLOEXEC); #188

Closed snemoto-42 closed 7 months ago

snemoto-42 commented 7 months ago

下記は課題に沿って修正する必要があるのか

III.2 For MacOS only

Since MacOS doesn’t implement write() the same way as other Unix OSes, you are allowed to use fcntl(). You must use file descriptors in non-blocking mode in order to get a behavior similar to the one of other Unix OSes. However, you are allowed to use fcntl() only as follows: fcntl(fd, F_SETFL, O_NONBLOCK, FD_CLOEXEC); Any other flag is forbidden.

snemoto-42 commented 7 months ago

下記で使用している Server::initializeServerSocket Server::acceptNewConnection ExecCgi::executeCommonCgiScript

snemoto-42 commented 7 months ago

cmdがF_SETFLの時、成功時は0が返る。エラー時は-1が返る