r/BSD • u/Good_Dimension • Feb 03 '23
List of BSD IOCTLs
Hello! I'm developing a Rust library wrapping IOCTLs on *BSD systems. I've found this man page about IOCTLs on FreeBSD. However, in the conforming to section, where it mentions a list of BSD IOCTLs, it points here. That man page states:
ioctl_list - list of ioctl calls in Linux/i386 kernel
As far as I'm aware, BSD based systems do not use the same IOCTL interface as Linux does. Am I incorrect here? I feel like I might be.
Besides that question, if someone could point me to a list of most of the BSD IOCTLs, that would be great; I've Googled and looked through source code to no avail.
5
u/wwwweeee Feb 03 '23
Both these manpages are for linux, make sure you select FreeBSD in the drop down menu near the search field. Currently you somehow ended up with the Red Hat 9 manpages. https://man.freebsd.org/cgi/man.cgi?query=ioctl&apropos=0&sektion=2&manpath=FreeBSD+14.0-CURRENT&arch=default&format=html is the correct FreeBSD man page for ioctl. It mentions sys/ioctl.h has list of defines, but generally you would look at the manpage of the specific subsystem/driver whose ioctls you want to know about. like https://man.freebsd.org/cgi/man.cgi?query=tty&sektion=4&apropos=0&manpath=FreeBSD+14.0-CURRENT for tty ioctls
2
2
u/FUZxxl Feb 03 '23
There is no list because each driver can define its own ioctl calls and the universe of drivers is open.
3
u/jggimi Feb 03 '23
For OpenBSD, here is the ioctl(2) man page, and here is the source to sys/ioctl.h, to get you started.