I wrote a small test program - attached is the program and the output..
-Madhu
$ ./xx
mmap: No such device
$
$
$ ls -ld /dev/zero
crw-rw-rw- 1 bin sys 3 0x000004 Jul 17 2001 /dev/zero
#include <stdio.h>
#include <fcntl.h>
#include <sys/mman.h>
int main(int argc, char *argv[])
{
void *m;
int tmpfd;
char *filename = NULL;
if (filename == NULL) {
if ((tmpfd = open("/dev/zero", O_RDWR, 0666)) < 0) {
perror("open");
return -1;
}
m = mmap(NULL, 256000, PROT_READ|PROT_WRITE, MAP_SHARED, tmpfd, 0);
if (m == MAP_FAILED) {
perror("mmap");
return -1;
}
if (munmap(m, 256000) == -1) {
perror("munmap");
return -1;
}
}
return 0;
}
-----Original Message-----
From: Aaron Bannert [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 07, 2002 9:47 AM
To: [EMAIL PROTECTED]
Subject: Re: configure option to specify mmap/shm
On Thu, Feb 07, 2002 at 09:21:20AM -0800, MATHIHALLI,MADHUSUDAN
(HP-Cupertino,ex1) wrote:
> Nope.. It does not work (for me).. That's the reason I need to change to
to
> use SHMGET_ANON.. I was thinking that there'a already a option available
to
> do such things..
>
> BTW, is it not strange that it picks up APR_USE_SHMEM_SHMGET, but not
> APR_USE_SHMEM_SHMGET_ANON and rather decides to select
> APR_USE_SHMEM_MMAP_ZERO..
For anonymous shared memory, it prefers MMAP_ZERO over SHMGET_ANON.
You probably have these on your system:
header:sys/mman.h
func:mmap()
func:munmap()
file:/dev/zero
Is there anything else we could test to see if it's not working? Is it
possible that MMAP_ZERO's implementation is simple broken? Send me
the error you are seeing, and optionally a truss output also.
-aaron