Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31346 )
Change subject: libpayload/sys/types.h: Add definition for off_t ......................................................................
Patch Set 1:
I don't mind adding the type, but I'm not sure why we need a whole new header file for it.
It's not a new file, I just realized...
Why not just throw it into stddef.h or something? I don't think libpayload ever intended to be fully POSIX-compliant in terms of which definitions are in which headers (rather, all the standard stuff is supposed to be included as some part of libpayload.h).
I don't know the original intention. Having a single `libpayload.h` works for code that is solely written for libpayload. But I have a lot of code around that is not. Most famous example would be libflashrom which makes use of off_t somewhere now.
Generally, implementing standard things in non-standard headers can only lead to one thing, IMHO: At some point, you'll realize that you have to use the standard headers (like in this case, to be able to compile code that doesn't target libpayload explicitly) and when you try to fix the mess too late, you'll cause breakage in the code that does target the non-standard environment explicitly.
Also, why not define it to ssize_t?
Good question, have to look that ones definition up... ok, nothing special. I see no reason against it, also no reason to use it. May I ask why?