On Fri, Mar 19, 2021 at 1:27 PM Omar Sandoval <osan...@osandov.com> wrote: > > For RWF_ENCODED, iov is always used as the entirety of the struct. I > made the helper more generic to support other use cases, but if that's > the main objection I can easily make it specifically use iov.
Honestly, with new interfaces, I'd prefer to always start off as limited as possible. And read/write is not very limited (but O_ALLOW_ENCODED and RWF_ENCODED at least helps with the "fool suid program to do it"). But at least we could make sure that the structure then has to be as strict as humanly possible. So it's not so much a "main objection" as more about trying to make the rules stricter in the hope that that at least makes only one very particular way of doing things valid. I'd hate for user space to start 'streaming" struct data. > > Also I see references to the man-page, but honestly, that's not how > > the kernel UAPI should be defined ("just read the man-page"), plus I > > refuse to live in the 70's, and consider troff to be an atrocious > > format. > > No disagreement here, troff is horrible to read. > > > So make the UAPI explanation for this horror be in a legible format > > that is actually part of the kernel so that I can read what the intent > > is, instead of having to decode hieroglypics. > > I didn't want to document the UAPI in two places that would need to be > kept in sync Honestly, I would suggest that nobody ever write troff format stuff. I don't think it supports UTF-8 properly, for example, which means that you can't even give credit to people properly etc. RST isn't perfect, but at least it's human-legible, and it's obviously what we're encouraging for kernel use. You can use rst2man to convert to bad formats (and yes, you might lose something in the translation, eg proper names etc). Almost anything else(*) is better than troff. But at least I can read the formatted version. Linus (*) With the possible exception of "info" files. Now *there* is a truly pointless format maximally designed to make it inconvenient for users.