News for hackers. Stuff that matters.
Re:OpenBSD – pinning all system calls by trealira on Monday December 11, 2023 @11:55PM (#38609698)
> Then `SYS_kbind` seems to be a signed int. So this comparison will be signed and "fix" the negative `npins` to `SYS_kbind`:

  npins = MAX(npins, SYS_kbind)
No, the comparison is unsigned here. They're integers of the same "conversion rank", so the unsigned type wins and the signed integer is interpreted as unsigned.

https://en.cppreference.com/w/c/language/conversion

I can never remember the integer conversion rules and end up looking up this link whenever necessary.

Re:OpenBSD – pinning all system calls by qzzi on Tuesday December 12, 2023 @02:09AM (#38610529)
No.
Re:OpenBSD – pinning all system calls by piss_n_chips on Tuesday December 12, 2023 @07:42AM (#38611426)
This isn't correct, as npins is a signed int and SYS_kbind is just a macro for the integer 86 (as defined in sys/syscall.h). So it will be a signed comparison between the value of npins and 86.
Re:OpenBSD – pinning all system calls by trealira on Tuesday December 12, 2023 @08:20AM (#38611725)
My bad, I thought npins was unsigned.