Re: configure option to specify mmap/shm

2002-02-07 Thread Aaron Bannert

On Thu, Feb 07, 2002 at 09:06:40AM -0800, MATHIHALLI,MADHUSUDAN (HP-Cupertino,ex1) 
wrote:
> Hi,
> Question :
>   What option(s) should I pass to the configure to enable/disable the
> various SHM options (MMAP, SHMGET)..(sorry if it's a dumb question)
> 
> Problem :
> On a HPUX 11i system (worker MPM, 2.0.31), I'm seeing the following in
> srclib/apr/include/apr.h :
> #define APR_USE_SHMEM_MMAP_TMP 0
> #define APR_USE_SHMEM_MMAP_SHM 0
> #define APR_USE_SHMEM_MMAP_ZERO1
> #define APR_USE_SHMEM_SHMGET_ANON  0
> #define APR_USE_SHMEM_SHMGET   1
> #define APR_USE_SHMEM_MMAP_ANON0
> #define APR_USE_SHMEM_BEOS 0
> 
> I want to build using APR_USE_SHMEM_SHMGET_ANON rather than
> APR_USE_SHMEM_MMAP_ZERO.. I'm currently doing the ugly method of manually
> editing it after the configure is run.

Does MMAP_ZERO not work on your platform? If so we should probably improve
our autoconf test instead of provide override options.

-aaron



RE: configure option to specify mmap/shm

2002-02-07 Thread MATHIHALLI,MADHUSUDAN (HP-Cupertino,ex1)

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.. 

-Madhu

-Original Message-
From: Aaron Bannert [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 07, 2002 9:12 AM
To: [EMAIL PROTECTED]
Subject: Re: configure option to specify mmap/shm


On Thu, Feb 07, 2002 at 09:06:40AM -0800, MATHIHALLI,MADHUSUDAN
(HP-Cupertino,ex1) wrote:
> Hi,
> Question :
>   What option(s) should I pass to the configure to enable/disable the
> various SHM options (MMAP, SHMGET)..(sorry if it's a dumb question)
> 
> Problem :
> On a HPUX 11i system (worker MPM, 2.0.31), I'm seeing the following in
> srclib/apr/include/apr.h :
> #define APR_USE_SHMEM_MMAP_TMP 0
> #define APR_USE_SHMEM_MMAP_SHM 0
> #define APR_USE_SHMEM_MMAP_ZERO1
> #define APR_USE_SHMEM_SHMGET_ANON  0
> #define APR_USE_SHMEM_SHMGET   1
> #define APR_USE_SHMEM_MMAP_ANON0
> #define APR_USE_SHMEM_BEOS 0
> 
> I want to build using APR_USE_SHMEM_SHMGET_ANON rather than
> APR_USE_SHMEM_MMAP_ZERO.. I'm currently doing the ugly method of manually
> editing it after the configure is run.

Does MMAP_ZERO not work on your platform? If so we should probably improve
our autoconf test instead of provide override options.

-aaron



Re: configure option to specify mmap/shm

2002-02-07 Thread Aaron Bannert

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



Re: configure option to specify mmap/shm

2002-02-07 Thread Jim Jagielski

Aaron Bannert wrote:
> 
> For anonymous shared memory, it prefers MMAP_ZERO over SHMGET_ANON.

Which is good because then you don't have to worry so much about the
shared mem segment sizes configured in the kernel.

-- 
===
   Jim Jagielski   [|]   [EMAIL PROTECTED]   [|]   http://www.jaguNET.com/
  "A society that will trade a little liberty for a little order
 will lose both and deserve neither" - T.Jefferson



RE: configure option to specify mmap/shm

2002-02-07 Thread MATHIHALLI,MADHUSUDAN (HP-Cupertino,ex1)

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 binsys  3 0x04 Jul 17  2001 /dev/zero

#include 
#include 
#include 

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



Re: configure option to specify mmap/shm

2002-02-07 Thread Aaron Bannert

On Thu, Feb 07, 2002 at 01:19:45PM -0500, MATHIHALLI,MADHUSUDAN (HP-Cupertino,ex1) 
wrote:
> I wrote a small test program - attached is the program and the output.. 

This discussion has moved to [EMAIL PROTECTED]

-aaron