LibBSD | rtemsbsd/libio: Give a duplicated descriptor an identity of its own (!153)

Sang Woo Kim (@physwkim) gitlab at rtems.org
Thu Jul 30 12:14:16 UTC 2026




Sang Woo Kim commented on a discussion on testsuite/pipe01/test_main.c: https://gitlab.rtems.org/rtems/pkg/rtems-libbsd/-/merge_requests/153#note_155910

 > +
 > +	rv = pipe2(fd, O_NONBLOCK);
 > +	assert(rv == 0);
 > +
 > +	errno = 0;
 > +	n = read(fd[0], &buf[0], sizeof(buf));
 > +	assert(n == -1);
 > +	assert(errno == EAGAIN);
 > +
 > +	rv = close(fd[0]);
 > +	assert(rv == 0);
 > +	rv = close(fd[1]);
 > +	assert(rv == 0);
 > +
 > +	errno = 0;
 > +	rv = pipe2(fd, 0x40000000);

An arbitrary bit that maps to no O_ flag — the intent was to exercise the unknown-flag EINVAL path. Changed to `~(O_NONBLOCK | O_CLOEXEC)` so the test states that intent.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/pkg/rtems-libbsd/-/merge_requests/153#note_155910
You're receiving this email because of your account on gitlab.rtems.org. Unsubscribe from this thread: https://gitlab.rtems.org/-/sent_notifications/4-0k3zw3muf41iw3klhsqi1vvfb-k/unsubscribe | Manage all notifications: https://gitlab.rtems.org/-/profile/notifications | Help: https://gitlab.rtems.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260730/6b85bedb/attachment-0001.htm>


More information about the bugs mailing list