shithub: sl

Download patch

ref: de467208a68e9c61718b38caeaa2267924e52d8d
parent: 10eda615542dc0e9c419ee91fecebb51d0c42202
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Tue Mar 11 23:41:46 EDT 2025

use posix_madvise

--- a/src/posix/platform.h
+++ b/src/posix/platform.h
@@ -4,7 +4,6 @@
 #include <assert.h>
 #include <ctype.h>
 #if defined(__APPLE__)
-#define _DARWIN_C_SOURCE 1
 #include <machine/endian.h>
 #else
 #include <endian.h>
--- a/src/posix/sys.c
+++ b/src/posix/sys.c
@@ -31,7 +31,7 @@
 	sz = PAGEALIGNED(sz);
 	used = PAGEALIGNED(used);
 	// it's fine if this fails
-	madvise((u8int*)s+used, sz-used, MADV_DONTNEED);
+	posix_madvise((u8int*)s+used, sz-used, POSIX_MADV_DONTNEED);
 }
 
 double