Fix return type of process_madvise().
Noticed this from
https://man7.org/linux/man-pages/man2/process_madvise.2.html but
independently confirmed by checking the kernel source.
Also fix the documentation.
Test: treehugger
Change-Id: I6beeeeb2178a58a22a36532e634917b3ae8767ee
diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT
index d263508..ec34828 100644
--- a/libc/SYSCALLS.TXT
+++ b/libc/SYSCALLS.TXT
@@ -113,7 +113,7 @@
int msync(const void*, size_t, int) all
int mprotect(const void*, size_t, int) all
int madvise(void*, size_t, int) all
-int process_madvise(int, const struct iovec*, size_t, int, unsigned int) all
+ssize_t process_madvise(int, const struct iovec*, size_t, int, unsigned int) all
int mlock(const void* addr, size_t len) all
int mlock2(const void* addr, size_t len, int flags) all
int munlock(const void* addr, size_t len) all
diff --git a/libc/include/sys/mman.h b/libc/include/sys/mman.h
index 3b44dab..6ef0c12 100644
--- a/libc/include/sys/mman.h
+++ b/libc/include/sys/mman.h
@@ -167,9 +167,9 @@
* works just like madvise(2) but applies to the process specified by the given
* PID file descriptor.
*
- * Returns 0 on success, and returns -1 and sets `errno` on failure.
+ * Returns the number of bytes advised on success, and returns -1 and sets `errno` on failure.
*/
-int process_madvise(int __pid_fd, const struct iovec* __iov, size_t __count, int __advice, unsigned int __flags);
+ssize_t process_madvise(int __pid_fd, const struct iovec* __iov, size_t __count, int __advice, unsigned __flags);
#if defined(__USE_GNU)