Re: Cygwin madvise(): aliased to posix_madvise() but the error handling should differ
Mark Geisert via Cygwin <[email protected]> Mon, 6 Jul 2026 15:44:35 -0700
| Newsgroups | gmane.os.cygwin |
|---|---|
| Message-ID | <[email protected]> |
Hi Christian, On 7/6/2026 10:08 AM, Christian Franke via Cygwin wrote: > Currently madvise() appears only as an alias in cygwin.din: > > madvise = posix_madvise SIGFE > > But according to the man pages, the error handling should differ: > > https://man7.org/linux/man-pages/man2/madvise.2.html: > "On error, it returns -1 and errno is set to indicate the error." > > https://man7.org/linux/man-pages/man3/posix_madvise.3.html > "On failure, it returns a positive error number." > > https://pubs.opengroup.org/onlinepubs/009695399/functions/ > posix_madvise.html > https://pubs.opengroup.org/onlinepubs/9799919799/functions/ > posix_madvise.html > "... otherwise, an error number shall be returned to indicate the error." > > The POSIX variant implies that 'errno' is left unchanged. > > On Cygwin, only posix_madvise() works as documented. > On Linux, both functions work as documented. Thanks for the report and diagnosis. I'll submit a patch shortly. ..mark -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple