Fix madvise() on Windows

This commit is contained in:
Justine Tunney 2023-12-27 22:39:41 -08:00
parent f51fd97644
commit ce0143e2a1
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
5 changed files with 121 additions and 35 deletions

View file

@ -23,6 +23,10 @@
* Advises kernel about memory intentions, the POSIX way.
*
* @return 0 on success, or errno on error
* @raise EINVAL if `advice` isn't valid or supported by system
* @raise EINVAL on Linux if addr/length isn't page size aligned with
* respect to `getauxval(AT_PAGESZ)`
* @raise ENOMEM on Linux if addr/length overlaps unmapped regions
* @returnserrno
*/
errno_t posix_madvise(void *addr, uint64_t len, int advice) {