Re: Availability of netshm/POSIX shared memory under Ubuntu 9.10

Gerd Stolpmann <[email protected]> Mon, 15 Mar 2010 23:23:45 +0100
Newsgroups gmane.comp.lang.ocaml.lib.net.devel
Message-ID <1268691825.19968.148.camel@thinkpad>
On Mo, 2010-03-15 at 18:33 +0100, Johan Mazel wrote:
> Hi
> I'm trying to use ocamlnet to access to POSIX shared memory.
> 
> I wrote this little piece of code:
> 
> let _ =    
>     Printf.printf("Test shared memory\n");    
>     if (Netsys.have_posix_shm () = false) then        
>         Printf.printf("No POSIX SHM\n")
>     else
>         (            
>             Printf.printf("POSIX SHM OK\n");
>         )
> 
> It is displaying me "No POSIX SHM".
> 
> I also tried to run some code like :
>     let my_shm_name = `POSIX "my_shm" in    
>     let sd = Netshm.open_shm my_shm_name [Unix.O_CREAT; Unix.O_RDWR]
> 0o666 in
> 
> The result is an error:
> Fatal error: exception Invalid_argument("Netsys.shm_open not
> available")
> 
> I am running this code on a Ubuntu 9.10 64 bits.
> This page
> "http://manpages.ubuntu.com/manpages/karmic/man7/shm_overview.7.html"
> specifies that "POSIX shared memory is supported since Linux 2.4 and
> glibc 2.2."
> I do not see any reason why I obtain this behaviour.
> 
> Thanks in advance for your time.
> Regards.
> Johan Mazel

Where did you get your ocamlnet package from? Apparently, this is a
configuration issue. I'm developing on Ubuntu 9.10 and posix shm is
definitely there. Problems can arise when headers were missing at build
time.

Gerd

> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________ Ocamlnet-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ocamlnet-devel


-- 
------------------------------------------------------------
Gerd Stolpmann, Bad Nauheimer Str.3, 64289 Darmstadt,Germany 
[email protected]          http://www.gerd-stolpmann.de
Phone: +49-6151-153855                  Fax: +49-6151-997714
------------------------------------------------------------


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev