Bug 239504 - ioctl(2) man page doesn't mention that it can fail with EACCES
Summary: ioctl(2) man page doesn't mention that it can fail with EACCES
Status: Closed FIXED
Alias: None
Product: Documentation
Classification: Unclassified
Component: Manual Pages (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Alexander Ziaee
URL: https://reviews.freebsd.org/D49072
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2019-07-28 21:04 UTC by Brennan Vincent
Modified: 2026-01-01 19:11 UTC (History)
2 users (show)

See Also:


Attachments
ioctl(2) patch (464 bytes, patch)
2021-10-24 03:11 UTC, Felix Johnson
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brennan Vincent 2019-07-28 21:04:03 UTC
`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.
Comment 1 Felix Johnson 2021-10-24 03:11:08 UTC
Created attachment 228974 [details]
ioctl(2) patch

Document EACCES as a possible return value for ioctl().
Comment 2 commit-hook freebsd_committer freebsd_triage 2025-12-29 19:28:32 UTC
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(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2026-01-01 18:06:37 UTC
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(-)
Comment 4 commit-hook freebsd_committer freebsd_triage 2026-01-01 19:09:51 UTC
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(-)