Index: sys/kern/vfs_vnops.c =================================================================== RCS file: /cvsroot/src/sys/kern/vfs_vnops.c,v retrieving revision 1.217 diff -u -p -r1.217 vfs_vnops.c --- sys/kern/vfs_vnops.c 30 Jun 2021 11:20:32 -0000 1.217 +++ sys/kern/vfs_vnops.c 30 Jun 2021 17:40:27 -0000 @@ -332,9 +332,13 @@ out: case EDUPFD: case EMOVEFD: /* if the caller isn't prepared to handle fds, fail for them */ - KASSERTMSG(ret_domove && ret_fd, - "caller did not supply ret_domove and ret_fd for %d", - error); + if (ret_fd == NULL) { + KASSERT(ret_domove == NULL); + error = EOPNOTSUPP; + break; + } + KASSERT(ret_domove != NULL); + error = 0; *ret_vp = NULL; *ret_domove = error == EMOVEFD; *ret_fd = l->l_dupfd;