(disclaimer: I am not a Debian developer)
(note: this bug is already in the Debian bug database since April
4th).
On Fri, 13 Apr 2001, Joerg Schilling wrote:
> So your non working binary has been compiled on a machine with a 2.4 Linux kernel.
Not necessarily. In Debian unstable, the kernel headers in
/usr/include/linux correspond to the kernel version glibc was compiled
against. And that's always 2.4, to enable support for the features of
2.4 (like large file support).
I can think of three solutions:
a) do the mmap() checking at runtime (just try it and if it doesn't
work, fall back to SysV shm).
b) make it possible to override the compile-time autodetection (so
that mmap() will not be used for shared memory even if it seems to
be supported). In that case, Debian's cdrecord would always use
SysV shm.
c) patch 'conf/configure' to disable/override the test. This solution
doesn't require changes in the cdrtools upstream package.
I attached a patch for solution c). But I think in the long run a) or
b) are better solutions.
Eric
--- cdrecord-1.10a18.orig.orig/conf/configure Sun Mar 4 16:43:45 2001
+++ cdrecord-1.10a18.orig/conf/configure Tue Apr 24 22:02:28 2001
@@ -5781,108 +5781,6 @@
fi
-echo $ac_n "checking if mmap works to get shared memory""... $ac_c" 1>&6
-echo "configure:5786: checking if mmap works to get shared memory" >&5
-if eval "test \"`echo '$''{'ac_cv_func_smmap'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test "$cross_compiling" = yes; then
- ac_cv_func_smmap=no
-else
- cat > conftest.$ac_ext <<EOF
-#line 5794 "configure"
-#include "confdefs.h"
-
-#include <sys/types.h>
-#include <sys/mman.h>
-
-#ifndef MAP_ANONYMOUS
-# ifdef MAP_ANON
-# define MAP_ANONYMOUS MAP_ANON
-# endif
-#endif
-
-/*
- * Needed for Apollo Domain/OS and may be for others?
- */
-#ifdef _MMAP_WITH_SIZEP
-# define mmap_sizeparm(s) (&(s))
-#else
-# define mmap_sizeparm(s) (s)
-#endif
-
-char *
-mkshare()
-{
- int size = 8192;
- int f;
- char *addr;
-
-#ifdef MAP_ANONYMOUS /* HP/UX */
- f = -1;
- addr = mmap(0, mmap_sizeparm(size), PROT_READ|PROT_WRITE,
MAP_SHARED|MAP_ANONYMOUS, f, 0);
-#else
- if ((f = open("/dev/zero", 2)) < 0)
- exit(1);
- addr = mmap(0, mmap_sizeparm(size), PROT_READ|PROT_WRITE, MAP_SHARED, f, 0);
-#endif
- if (addr == (char *)-1)
- exit(1);
- close(f);
-
- return (addr);
-}
-
-int
-main()
-{
- char *addr;
-
- addr = mkshare();
- *addr = 'I';
-
- switch (fork()) {
-
- case -1:
- printf("help\n"); exit(1);
-
- case 0: /* child */
- *addr = 'N';
- _exit(0);
- break;
- default: /* parent */
- wait(0);
- sleep(1);
- break;
- }
-
- if (*addr != 'N')
- exit(1);
- exit(0);
-}
-
-EOF
-if { (eval echo configure:5866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test
-s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
- ac_cv_func_smmap=yes
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_func_smmap=no
-fi
-rm -fr conftest*
-fi
-
-fi
-
-echo "$ac_t""$ac_cv_func_smmap" 1>&6
-if test $ac_cv_func_smmap = yes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_SMMAP 1
-EOF
-
-fi
echo $ac_n "checking if quotactl is an ioctl""... $ac_c" 1>&6
echo "configure:5888: checking if quotactl is an ioctl" >&5
if eval "test \"`echo '$''{'ac_cv_func_quotaioctl'+set}'`\" = set"; then