socketpair: Add SOCK_NONBLOCK support into type field

behavior alignment to Linux

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu 2022-10-19 17:14:53 +08:00 committed by Xiang Xiao
parent 85ffa4bcf3
commit 2be529121a

View file

@ -150,6 +150,11 @@ int socketpair(int domain, int type, int protocol, int sv[2])
oflags |= O_CLOEXEC;
}
if (type & SOCK_NONBLOCK)
{
oflags |= O_NONBLOCK;
}
/* Allocate a socket descriptor */
for (; j < 2; j++)