fileno(3): set errno when returning -1
as required by IEEE Std 1003.1™-2024.
PR: 283014
Reported by: Graham Percival <gperciva@tarsnap.com>
Reviewed by: emaste, imp
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D47834