git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/5] autoconf: Preliminary check for working mmap

From
Jakub Narebski <jnareb@gmail.com>
Date
Sep 4, 2006, 22:56 UTC
Message-ID
<200609050056.52590.jnareb@gmail.com>
In-Reply-To
<200609050054.24279.jnareb@gmail.com>

Use AC_FUNC_MMAP check to check if the `mmap' function exists and works correctly. (It only checks private fixed mapping of already-mapped memory.)

Still it is better than having no mmap check at all.
Attention: uses implementation detail of AC_FUNC_MMAP!
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This patch sent earlier in other patch series and dropped,
as git uses private mapping, not private fixed. I think
that this check is better than no check at all...
 config.mak.in |    2 +-
 configure.ac  |    7 +++++++
 2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/config.mak.in b/config.mak.in
index 2947560..2c8fd2c 100644
--- a/config.mak.in
+++ b/config.mak.in
@@ -37,6 +37,6 @@ NO_C99_FORMAT=@NO_C99_FORMAT@
 NO_STRCASESTR=@NO_STRCASESTR@
 NO_STRLCPY=@NO_STRLCPY@
 NO_SETENV=@NO_SETENV@
-#NO_MMAP=@NO_MMAP@
+NO_MMAP=@NO_MMAP@
 #NO_ICONV=@NO_ICONV@
 
diff --git a/configure.ac b/configure.ac
index fc5b813..799321e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -249,6 +249,13 @@ AC_CHECK_FUNC(setenv,
 AC_SUBST(NO_SETENV)
 #
 # Define NO_MMAP if you want to avoid mmap.
+AC_FUNC_MMAP
+if test $ac_cv_func_mmap_fixed_mapped != yes; then
+	NO_MMAP=YesPlease
+else
+	NO_MMAP=
+fi
+AC_SUBST(NO_MMAP)
 #
 # Define NO_ICONV if your libc does not properly support iconv.
 
-- 
1.4.1.1
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 19 in “Some autoconf patches”
  1. 0/5 Some autoconf patchesJakub Narebski, Sep 4, 2006
  2. 1/5 autoconf: Add some commented out variables to config.mak.inJakub Narebski, Sep 4, 2006
  3. 2/5 autoconf: Add -liconv to LIBS when NEEDS_LIBICONVJakub Narebski, Sep 4, 2006
  4. Jonas FonsecaSep 5, 2006
  5. autoconf: Fix copy'n'paste errorJakub Narebski, Sep 5, 2006
  6. Junio C HamanoSep 5, 2006
  7. 3/5 autoconf: Preliminary check for working mmapJakub Narebski, Sep 4, 2006
  8. Junio C HamanoSep 4, 2006
  9. Jakub NarebskiSep 4, 2006
  10. Shawn PearceSep 5, 2006
  11. Junio C HamanoSep 5, 2006
  12. Shawn PearceSep 5, 2006
  13. Junio C HamanoSep 5, 2006
  14. Shawn PearceSep 6, 2006
  15. Junio C HamanoSep 6, 2006
  16. Junio C HamanoSep 6, 2006
  17. Shawn PearceSep 7, 2006
  18. 4/5 autoconf: Check for subprocess.pyJakub Narebski, Sep 4, 2006
  19. 5/5 autoconf: Quote AC_CACHE_CHECK argumentsJakub Narebski, Sep 4, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.