fcntl设置非阻塞

#include <fcntl.h>
#include <unistd.h>

int fcntl(int fd, int cmd, ... /* arg */ );

/* 样例 */
int flags = fcntl(fd, F_GETFL);
flags |= O_NONBLOACK;
fcntl(fd, F_SETFL, flags);

おすすめ

転載: blog.csdn.net/qq_48322523/article/details/120479089