6

I'm taking a look to the standard Ada POSIX binding, and the Florist implementation for GNAT. The aim is evaluating if a legacy application can be ported from its own use of pragma Import of the C POSIX functions to use the standard binding. The final objective is to be able to recompile the application in Solaris and Linux without source code changes. My doubt is about the several set of interfaces used in the UNIX tradition for Inter Process Communication features, like semaphores, message queues, etc. Florist is importing these C functions:

  • Semaphores: sem_init sem_destroy sem_open sem_close sem_unlink sem_wait sem_trywait sem_post sem_getvalue
  • Message queues: mq_close mq_getattr mq_notify mq_open mq_receive mq_send mq_setattr mq_unlink

While the application is importing these other sets: - Semaphores: semget semop semctl - Message queues: msgctl msgrcv msgsnd

Some sources defines the set used by the application as System V and not POSIX, while in others they are declared as standardized by IEEE Std 1003.1-2001, which apparently is POSIX.

My questions are:

  • Are the "System V" sets really standardized by POSIX?
  • If they are POSIX, why the standard Ada POSIX binding does not provide bindings to them? Are they "less POSIX" than the other interfaces?
  • If I decide to port the application to Florist, what differences in behaviour should I take into account to prevent any regression? Would you recommend against it?
Gneuromante
  • 560
  • 3
  • 12
  • 1
    The text is [online](https://pubs.opengroup.org/onlinepubs/9699919799/), allowing you to investigate the various points. Asking for recommendations is off-topic. – Thomas Dickey Jan 12 '20 at 00:07
  • What I've gathered from opengroup.org and other sources is that System V IPC interfaces are standardized by (modern?) POSIX as an optional extension called XSI. Interface with mq_ and sem_ are also optional extensions, called respectively SEM and MSG. Sources referring to both sets as SysV vs. POSIX are either inaccurate or outdated. – Gneuromante Jan 12 '20 at 19:15
  • But the Ada standard (IEEE Standard 1003.5b-1996 or ISO/IEC 14519:2001) is not online, so I think my question is still unsolved regarding whether the Ada binding supports SEM and MSG and not XSI, and the rationale behind that. Given the rationale, I could decide whether to port the application from its own binding of SysV IPC to the standard binding. – Gneuromante Jan 12 '20 at 19:22

3 Answers3

0

In the ASE collection, there are two POSIX bindings. Posix1, Posix2 are as linked; however, of note is the fact that the ASE collection came out before 2000, and so won't have those revisions.

Shark8
  • 4,095
  • 1
  • 17
  • 31
  • Thanks for your answer, but as you mention they are previous to the standard, so I suppose they are not useful any more. – Gneuromante Jan 19 '20 at 19:24
0

I did some research and found two relevant documents from the ISO working group dedicated to Ada. In document Initial Work Scope Summary for updating Ada POSIX Bindings IS 14519:2001 to POSIX Draft IS 9945:2008 and Ada 2005 there is a list of POSIX functions not currently supported by the Ada standard as possible expansion. The XSI functions (aka SysV IPC) are mentioned there. So they are not currently supported.

But they will not be in the near future, since the document Draft Minutes, Meeting #64 states that the update effort has been cancelled. So users should continue making our own interface to those POSIX C functions, I guess.

Gneuromante
  • 560
  • 3
  • 12
  • 1
    An additional thought: it is really disappointed that the POSIX standard in its original C interface is publicly available, but not the Ada POSIX standard. In the languages themselves, it's the opposite, the Ada standard is public, while the C one is not. The Ada POSIX standard should be also public, and then I am sure it would be more visible and more widely used. – Gneuromante Jan 19 '20 at 21:26
0

The University of cantabria, Spain, has been working with Ada and POSIX for more than 20 years: maybe having a look at their work pays back; for instance: https://ocw.unican.es/pluginfile.php/1398/course/section/1781/Tema%2007%20-%20Ada.pdf