aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2022-06-29 16:42:58 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2022-06-29 16:42:58 +0000
commit48a55bbfe95bc7b32d37673839edc2f365ffc028 (patch)
treef037254b2c5b0677380dd711daac02d5724681cf /tests
parentbaf8f20a4af43283a1fbee49b0c2ad906074f20f (diff)
downloadsrc-48a55bbfe95bc7b32d37673839edc2f365ffc028.tar.gz
src-48a55bbfe95bc7b32d37673839edc2f365ffc028.zip
unix: change error code for recvmsg() failed due to RLIMIT_NOFILE
Instead of returning EMSGSIZE pass the error code from fdallocn() directly to userland. That would be EMFILE, which makes much more sense. This error code is not listed in the specification[1], but the specification doesn't cover such edge case at all. Meanwhile the specification lists EMSGSIZE as the error code for invalid value of msg_iovlen, and FreeBSD follows that, see sys_recmsg(). Differentiating these two cases will make a developer/admin life much easier when debugging. [1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/recvmsg.html Reviewed by: markj Differential revision: https://reviews.freebsd.org/D35640
Diffstat (limited to 'tests')
-rw-r--r--tests/sys/kern/unix_passfd_test.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/sys/kern/unix_passfd_test.c b/tests/sys/kern/unix_passfd_test.c
index bbd298f9a26f..dc017db4f1ce 100644
--- a/tests/sys/kern/unix_passfd_test.c
+++ b/tests/sys/kern/unix_passfd_test.c
@@ -428,8 +428,8 @@ ATF_TC_BODY(send_a_lot, tc)
msghdr.msg_controllen = CMSG_LEN(sizeof(int));
ATF_REQUIRE(sendmsg(fd[0], &msghdr, 0) == 1);
ATF_REQUIRE(recvmsg(fd[1], &msghdr, 0) == -1);
- /* Such attempt shall fail with EMSGSIZE. */
- ATF_REQUIRE(errno == EMSGSIZE);
+ /* Such attempt shall fail with EMFILE. */
+ ATF_REQUIRE(errno == EMFILE);
ATF_REQUIRE(getnfds() == nfds);
#if TEST_PROTO == SOCK_STREAM
/*