kern: poll: tap out the pollfd array on successful return

We do this in kern_poll() to include freebsd32 but exclude the linux
compat layer.  The ABI should be the same, but the POLL constants are
probably different or should be assumed so.

Reviewed by:	bapt, jhb
Differential Revision:	https://reviews.freebsd.org/D44158
This commit is contained in:
Kyle Evans 2024-03-04 22:14:06 -06:00
parent 291079d0eb
commit b5d2165b90

View File

@ -1606,6 +1606,11 @@ kern_poll(struct thread *td, struct pollfd *ufds, u_int nfds,
error = kern_poll_kfds(td, kfds, nfds, tsp, set);
if (error == 0)
error = pollout(td, kfds, ufds, nfds);
#ifdef KTRACE
if (error == 0 && KTRPOINT(td, KTR_STRUCT_ARRAY))
ktrstructarray("pollfd", UIO_USERSPACE, ufds, nfds,
sizeof(*ufds));
#endif
out:
if (nfds > nitems(stackfds))