`ioctl` can fail with EACCES; for example: https://github.com/freebsd/freebsd/blob/master/sys/kern/tty.c#L1874 But `man 2 ioctl` only lists EBADF, ENOTTY, EINVAL, and EFAULT.
Created attachment 228974 [details] ioctl(2) patch Document EACCES as a possible return value for ioctl().
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=e2afbc45258f2fa4bdcf126e959ac660e76fc802 commit e2afbc45258f2fa4bdcf126e959ac660e76fc802 Author: Felix Johnson <fjohnson@felix-johnson.com> AuthorDate: 2025-12-29 19:21:26 +0000 Commit: Alexander Ziaee <ziaee@FreeBSD.org> CommitDate: 2025-12-29 19:25:23 +0000 ioctl.2: Mention EACCES ioctls can fail with EACCES, see sys/kern/tty.c PR: 239504 MFC after: 3 days Reviewed by: ziaee Reported by: Brennan Vincent <brennan@umanwizard.com> Differential Revision: https://reviews.freebsd.org/D49072 lib/libsys/ioctl.2 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
A commit in branch stable/15 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=bd6289c06471871dd83285ab9b50c49bc5f74652 commit bd6289c06471871dd83285ab9b50c49bc5f74652 Author: Felix Johnson <fjohnson@felix-johnson.com> AuthorDate: 2025-12-29 19:21:26 +0000 Commit: Alexander Ziaee <ziaee@FreeBSD.org> CommitDate: 2026-01-01 18:05:06 +0000 ioctl.2: Mention EACCES ioctls can fail with EACCES, see sys/kern/tty.c PR: 239504 MFC after: 3 days Reviewed by: ziaee Reported by: Brennan Vincent <brennan@umanwizard.com> Differential Revision: https://reviews.freebsd.org/D49072 (cherry picked from commit e2afbc45258f2fa4bdcf126e959ac660e76fc802) lib/libsys/ioctl.2 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=7fa86256aaca948671c38f462e9ef4692799d8fc commit 7fa86256aaca948671c38f462e9ef4692799d8fc Author: Felix Johnson <fjohnson@felix-johnson.com> AuthorDate: 2025-12-29 19:21:26 +0000 Commit: Alexander Ziaee <ziaee@FreeBSD.org> CommitDate: 2026-01-01 19:04:30 +0000 ioctl.2: Mention EACCES ioctls can fail with EACCES, see sys/kern/tty.c PR: 239504 MFC after: 3 days Reviewed by: ziaee Reported by: Brennan Vincent <brennan@umanwizard.com> Differential Revision: https://reviews.freebsd.org/D49072 (cherry picked from commit e2afbc45258f2fa4bdcf126e959ac660e76fc802) lib/libc/sys/ioctl.2 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)