On 2/13/21 7:10 PM, Michael Kerrisk (man-pages) wrote: > On 2/13/21 7:06 PM, Michael Kerrisk (man-pages) wrote: >> Hi Alex, >> >> On 2/13/21 5:40 PM, Alejandro Colomar (man-pages) wrote: >>> Hi Michael, >>> >>> openat2(2) is documented differently in openat2.2 and open.2 (without >>> and with const for its 3rd parameter, respectively). The return type is >>> also different. >>> >>> Do you know which one is correct? Else, I could read the source... >> >> Good spotting! The openat() page is correct. And POSIX says: >> >> int openat(int fd, const char *path, int oflag, ...); > > Ignore what I just said. I was misreading your mail. > I'm not sure of the answer. The source says: > > SYSCALL_DEFINE4(openat2, int, dfd, const char __user *, filename, > struct open_how __user *, how, size_t, usize) > > Thanks, > > Michael > Hi Michael, How about documenting raw kernel syscalls as 'syscall(__NR_xxx, ...);', instead of using a hypothetical wrapper that the user should write? In those functions with glibc wrappers, I'd document both the raw syscall and the glibc wrapper. I mean something in the line of keyctl(2). This would end with the thing that glibc documentation "hides" kernel documentation (as the manual pages (usually) only document glibc wrappers when they exist). It would also avoid some confusion, and would be clearer than the "glibc doesn't provide a wrapper..." notes (we could remove them or keep them for even more clarity). What do you think about it? If we do that, I'd leave it for 5.12. Cheers, Alex -- Alejandro Colomar Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/ http://www.alejandro-colomar.es/