FD_CLOEXEC
CATCH_EINTR(err = fcntl(fd, F_SETFD, FD_CLOEXEC));
err = get_close_on_exec(fd) ? FD_CLOEXEC : 0;
set_close_on_exec(fd, argi & FD_CLOEXEC);
if (fcntl(fd, F_SETFD, FD_CLOEXEC)) {
if (fcntl(fd, F_SETFD, FD_CLOEXEC)) {
P_FLAG(FD_CLOEXEC);
fcntl(go_pipe[0], F_SETFD, FD_CLOEXEC);
fcntl(go_pipe[1], F_SETFD, FD_CLOEXEC);
EXPECT_EQ(flags & FD_CLOEXEC, FD_CLOEXEC);
EXPECT_EQ(flags & FD_CLOEXEC, 0);
EXPECT_EQ(flags & FD_CLOEXEC, FD_CLOEXEC);
EXPECT_EQ(flags & FD_CLOEXEC, FD_CLOEXEC);
EXPECT_EQ(flags & FD_CLOEXEC, FD_CLOEXEC);
EXPECT_EQ(flags & FD_CLOEXEC, 0);
EXPECT_EQ(flags & FD_CLOEXEC, FD_CLOEXEC);
EXPECT_EQ(flags & FD_CLOEXEC, FD_CLOEXEC);
EXPECT_EQ(flags & FD_CLOEXEC, FD_CLOEXEC);
EXPECT_EQ(flags & FD_CLOEXEC, FD_CLOEXEC);
EXPECT_EQ(flags & FD_CLOEXEC, 0);
EXPECT_EQ(flags & FD_CLOEXEC, FD_CLOEXEC);
EXPECT_EQ(flags & FD_CLOEXEC, FD_CLOEXEC);
EXPECT_EQ(flags & FD_CLOEXEC, 0);
EXPECT_EQ(flags & FD_CLOEXEC, FD_CLOEXEC);
EXPECT_EQ(flags & FD_CLOEXEC, FD_CLOEXEC);
EXPECT_EQ(flags & FD_CLOEXEC, 0);
EXPECT_EQ(flags & FD_CLOEXEC, 0);
EXPECT_EQ(flags & FD_CLOEXEC, 0);
EXPECT_EQ(flags & FD_CLOEXEC, 0);
EXPECT_EQ(flags, FD_CLOEXEC);
EXPECT_EQ(flags, FD_CLOEXEC);
if (fcntl(sd, F_SETFD, FD_CLOEXEC) < 0)
if (otherflags & FD_CLOEXEC)
EXPECT_GE(ret & FD_CLOEXEC, 0);