News for hackers. Stuff that matters.
Re:Linux /proc/pid/stat parsing bugs by the8472 on Thursday December 22, 2022 @03:11PM (#34098004)
Having C functions isn't all that much better. You have replaced a crufty text format with crufty data structures full of paddings, unions, bitfields, VLAs, unaligned nested structs and other crazy stuff. Look at ioctls or cmsg. With C structs + 3rd-party kernel drivers you can even get UB because the driver returns data that is invalid under the struct definition (e.g. incorrect alignment, invalid bools).
Re:Linux /proc/pid/stat parsing bugs by touisteur on Thursday December 22, 2022 @03:58PM (#34098581)
I think a proper formal grammar would do the trick, with maybe a canonical implementation...