Re: pragma importing sem_init gives me a segmentation fault



On Feb 24, 4:01 pm, Jeffrey Creem <j...@xxxxxxxxxxxxx> wrote:
laforge2...@xxxxxxxxx wrote:
Hi,

I'm an ADA noob so please be gentle :) Anyways, I am trying to use
POSIX semaphores by pragma importing sem_init, sem_post, sem_wait,
etc. and it seems everytime I hit sem_init, the program seg faults.
Has anyone ever tried doing this before with any success ?

These semaphores are in shared memory and I believe I'm allocating the
same space in memory as a sem_t type. We are actually trying to
convert from an SGI platform to a Linux based platform, so all the
previous semaphore calls were SGI specific and we were looking to move
to POSIX based semaphores. Does anyone have any ideas how to go about
this ?

Thanks,
Eric

POSIX.5 specifies a standard Ada binding to many of the services of POSIX.

IBM Ada Developer (formally Rational Apex) comes with a POSIX.5 interface.

There is a package available for GNAT called florist. You don't mention
what compiler you are using but since you are coming from SGI it is
probably a fairly safe bet that it is GNAT based.

In any case, florist does have an existing binding to sem_init so you
can either look to it for guidance or actually consider using it.


Hello,

Thanks for your response. It looks like FLORIST is exactly what I'm
looking for. Does anyone know if using the FLORIST library listed
here:

http://www.cs.fsu.edu/~baker/florist.html

Will work with GNAT version 3.4.6 ?

Thanks,
Eric

.



Relevant Pages

  • Re: pragma importing sem_init gives me a segmentation fault
    ... based platform, so all the previous semaphore calls were SGI ... specific and we were looking to move to POSIX based semaphores. ...
    (comp.lang.ada)
  • POSIX semaphores in JNI?
    ... Can POSIX semaphores be used in Java 1.4.2 JNI code? ... Is it OK to use POSIX recursive semaphores to control threading? ...
    (comp.lang.java.programmer)
  • Re: POSIX semaphores in JNI?
    ... > rendering library that is I/O, memory, and CPU intensive. ... Are the vxWorks semaphores posix compliant? ... > Is it OK to use POSIX recursive semaphores to control threading? ...
    (comp.lang.java.programmer)
  • Re: process safe communication
    ... My first task is to port a queue ... > System V (named semaphores, ... > My goal is to use POSIX as I see that as the most high level and easy ...
    (comp.unix.programmer)
  • Re: Fixing Posix semaphores
    ... >> the semaphores directly in the file system, ... my only experience with POSIX semaphores on a system other than ... portable programs should only depend on a flat namespace, ...
    (freebsd-arch)