News for hackers. Stuff that matters.
Re:Debugging an Ioctl Problem on OpenBSD by loeg on Thursday February 17, 2022 @11:19PM (#30382093)
I believe FreeBSD intentionally truncates provided ioctls to the low 32-bit space because of exactly this kind of bogus assumption in userspace:

https://github.com/freebsd/freebsd-src/blob/main/sys/kern/sy...

It's a relatively recent change (2020). Here's the corresponding place OpenBSD doesn't do that:

https://github.com/openbsd/src/blob/master/sys/kern/sys_gene...

Re:Debugging an Ioctl Problem on OpenBSD by kevin_b_er on Thursday February 17, 2022 @10:56AM (#30374433)
I'm annoyed ktrace wasn't revisited. If the integer was getting truncated, why did ktrace print that the request was still VIDIOC_S_FMT? Shouldn't it have printed some goofy number that didn't match?
Re:Debugging an Ioctl Problem on OpenBSD by loeg on Thursday February 17, 2022 @11:25PM (#30382129)
Re:Debugging an Ioctl Problem on OpenBSD by tedunangst on Thursday February 17, 2022 @11:40PM (#30382200)
Oh! That's dumb. The printer correctly uses unsigned long.

https://github.com/openbsd/src/blob/master/usr.bin/kdump/mki...

Re:Debugging an Ioctl Problem on OpenBSD by tedunangst on Thursday February 17, 2022 @03:11PM (#30378039)
That is weird. I don't see an easy explanation. kdump uses unsigned long.
Re:Debugging an Ioctl Problem on OpenBSD by adamrt on Thursday February 17, 2022 @09:29AM (#30373406)
Jcs is always doing something cool. Thanks for the write up!
Re:Debugging an Ioctl Problem on OpenBSD by CyberRabbi on Thursday February 17, 2022 @09:39AM (#30373489)
Indeed. As a programmer desperate for technical edutainment to consume after work, he’s a gem.
Re:Debugging an Ioctl Problem on OpenBSD by anthk on Thursday February 17, 2022 @11:03AM (#30374562)
As an OpenBSD and retro protocol user (gopher, irc, MUDs, and so on) JCS is amazing.
Re:Debugging an Ioctl Problem on OpenBSD by elvis70 on Thursday February 17, 2022 @01:14PM (#30376534)
More people should pay attention to this OS. The source code is so clean and simple compared to Linux.