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.
下記は課題に沿って修正する必要があるのか
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.