* [gentoo-commits] proj/sandbox:stable-2.x commit in: libsandbox/, /
@ 2025-01-08 2:12 Mike Gilbert
2025-01-14 4:38 ` [gentoo-commits] proj/sandbox:master commit in: /, libsandbox/ Mike Gilbert
0 siblings, 1 reply; 2+ messages in thread
From: Mike Gilbert @ 2025-01-08 2:12 UTC (permalink / raw
To: gentoo-commits
commit: e03c865b4837f0f3699499a77b31fbae21b19b77
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 7 19:52:39 2025 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Tue Jan 7 20:06:25 2025 +0000
URL: https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=e03c865b
libsandbox: use mmap64 when available
We build libsandbox with _FILE_OFFSET_BITS=64, so we need to call
dlsym("mmap64") to get the right function from glibc.
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
configure.ac | 1 +
libsandbox/memory.c | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/configure.ac b/configure.ac
index 2835794..0ada7d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -211,6 +211,7 @@ AC_CHECK_FUNCS_ONCE(m4_flatten([
mkstemp64
mkstemps
mkstemps64
+ mmap64
open64
openat
openat64
diff --git a/libsandbox/memory.c b/libsandbox/memory.c
index a8f4d4b..69aa972 100644
--- a/libsandbox/memory.c
+++ b/libsandbox/memory.c
@@ -25,7 +25,11 @@ static void *(*_sb_mmap)(void *addr, size_t length, int prot, int flags, int fd,
static void *sb_mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset)
{
if (!_sb_mmap)
+#ifdef HAVE_MMAP64
+ _sb_mmap = get_dlsym("mmap64", NULL);
+#else
_sb_mmap = get_dlsym("mmap", NULL);
+#endif
return _sb_mmap(addr, length, prot, flags, fd, offset);
}
#define mmap sb_mmap
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] proj/sandbox:master commit in: /, libsandbox/
2025-01-08 2:12 [gentoo-commits] proj/sandbox:stable-2.x commit in: libsandbox/, / Mike Gilbert
@ 2025-01-14 4:38 ` Mike Gilbert
0 siblings, 0 replies; 2+ messages in thread
From: Mike Gilbert @ 2025-01-14 4:38 UTC (permalink / raw
To: gentoo-commits
commit: e03c865b4837f0f3699499a77b31fbae21b19b77
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 7 19:52:39 2025 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Tue Jan 7 20:06:25 2025 +0000
URL: https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=e03c865b
libsandbox: use mmap64 when available
We build libsandbox with _FILE_OFFSET_BITS=64, so we need to call
dlsym("mmap64") to get the right function from glibc.
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
configure.ac | 1 +
libsandbox/memory.c | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/configure.ac b/configure.ac
index 2835794..0ada7d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -211,6 +211,7 @@ AC_CHECK_FUNCS_ONCE(m4_flatten([
mkstemp64
mkstemps
mkstemps64
+ mmap64
open64
openat
openat64
diff --git a/libsandbox/memory.c b/libsandbox/memory.c
index a8f4d4b..69aa972 100644
--- a/libsandbox/memory.c
+++ b/libsandbox/memory.c
@@ -25,7 +25,11 @@ static void *(*_sb_mmap)(void *addr, size_t length, int prot, int flags, int fd,
static void *sb_mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset)
{
if (!_sb_mmap)
+#ifdef HAVE_MMAP64
+ _sb_mmap = get_dlsym("mmap64", NULL);
+#else
_sb_mmap = get_dlsym("mmap", NULL);
+#endif
return _sb_mmap(addr, length, prot, flags, fd, offset);
}
#define mmap sb_mmap
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-01-14 4:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-08 2:12 [gentoo-commits] proj/sandbox:stable-2.x commit in: libsandbox/, / Mike Gilbert
2025-01-14 4:38 ` [gentoo-commits] proj/sandbox:master commit in: /, libsandbox/ Mike Gilbert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox