8

From APUE

The Single UNIX Specification, a superset of the POSIX.1 standard, specifies additional interfaces that extend the functionality provided by the POSIX.1 specification. POSIX.1 is equivalent to the Base Specifications portion of the Single UNIX Specification.

The X/Open System Interfaces (XSI) option in POSIX.1 describes optional interfaces and defines which optional portions of POSIX.1 must be supported for an implementation to be deemed XSI conforming. These include file synchronization, thread stack address and size attributes, thread process-shared synchronization, and the _XOPEN_UNIX symbolic constant (marked ‘‘SUS mandatory’’ in Figure 2.5). Only XSI-conforming implementations can be called UNIX systems.

Is it correct that SUS consists exactly of POSIX and XSI?

Is it correct that Linux (or Ubuntu, Debian in particular) is POSIX compliant?

Is Linux (or Ubuntu, Debian in particular) considered XSI compliant or largely so? I ask this because then I will know whether the parts in APUE labelled for XSI apply to Linux (or Ubuntu, Debian in particular).

I am mainly interested in API, so does that mean Linux kernel suffices?

9
  • 3
    Re your first question, see Is Posix a subset of Single UNIX Specification? Commented Sep 5, 2018 at 12:46
  • 2
    Re the second question, see Why isn't GNU/Linux SUS v3+ compliant?.
    – Kusalananda
    Commented Sep 5, 2018 at 12:47
  • @Kusalananda: Your pointer points to a wrong answer: Linux had an offer to get a full (assisted by Andrew Josey) certificaton for one Dollar but after a while told the OpenGroup that they are not willing to become fully compliant.
    – schily
    Commented Sep 5, 2018 at 12:58
  • 1
    @schily was that for Linux in general (and if so, how was it defined), or a specific distribution? (Or perhaps several distributions...) Commented Sep 5, 2018 at 13:00
  • 1
    AFAIR, this was at the end mainly caused by the people behind the GNU tools.
    – schily
    Commented Sep 5, 2018 at 13:01

2 Answers 2

5

Linux is not fully POSIX compliant. There are e.g. system calls that behave differently (sorry I currently do not remember what the differences are exactly; I'll describe them here when I remember again).

One problem is e.g. that Linux does not include a correct waitid() system call (that delivers all 32 bits from the exit() parameter) and the Linux kernel people do not like to fix this. (waitid() has existed since AT&T System V Release 4..)

Some of the XSI features are implemented in Linux but not all of them.

bash (the way it is compiled for Linux distros) comes e.g. with a non XSI compliant echo builtin, dash does not support multi byte chars which is required by XSI. This happened after some time of POSIX adoptions after Linux got the offer to get an assisted certification for one Dollar.

If you like to get a correct overview, you might be interested to search the net for the final paper of POSIX non-compliances in Linux from Andrew Josey that has been written after the Linux people told the Opengroup that they are no longer interested in becomming POSIX compliant.

See: http://www.opengroup.org/personal/ajosey/tr20-08-2005.txt

BTW: There are rumors that Red Hat recently received a copy of the POSIX test suite, so it may be that there is a hidden ongoing certification...

16
  • 1
    Also relevant is the section on POSIX compliance in the GNU C library manual. Commented Sep 5, 2018 at 12:58
  • 6
    Linux is not an OS, just a kernel, so by itself it cannot be POSIX compliant. Inspur K-UX 3.0 is one example of a Linux-based system that has been certified as compliant to UNIX 03. Commented Sep 5, 2018 at 13:06
  • @StéphaneChazelas or Ubuntu, Debian. I am mainly interested in API, so does that mean Linux kernel suffices?
    – Tim
    Commented Sep 5, 2018 at 13:26
  • 2
    @StéphaneChazelas: You seem to missnderstand a POSIX certification. If Martijn Dekker did make a bug report against the austin group standard, this would have resulted in an updated test suite. Getting the seal does not mean a platform is fully compliant but that it passed all tests. Any platform that got the seal needs to recheck the compliance once a year with the actual version of the test suite. The enhanced ksh88 from /usr/xpg4/bin/sh is much closer to the POSIX standard than ksh93 or bash and it seems to be changed when non-compliances are detected.
    – schily
    Commented Sep 5, 2018 at 14:16
  • 1
    @phuclv: as mentioned: The UNIX-03 test suite has a buggy test for waitid() and it is pretty useless to claim that they passed the test when they cannot run software that was designed for a POSIX compliant waitid(). The only systems on your list that are POSIX compliant with respect to waitid()are from Oracle and SCO. The Apple system from that list neither returns the pid of the waited for process, nor the exit reason. I needed to write a real compliance test for my configure in order not to use waitid() on defective systems.
    – schily
    Commented Oct 24, 2018 at 9:19
0

Linux is not XSI-compliant at all. For example, it does not provide the system header <stdio.h>. This is because Linux is only an operating system kernel. This kernel needs an additional userland implementation to be able to be XSI-compliant.

There are several Linux distributions that include the Linux kernel, an implementation of the C Standard Library, a shell, the various utilities and various other components.

All these parts together may possibly be XSI-compliant, but that needs to be tested and verified for each of these combinations.

3
  • 2
    You must be a mathematician, right? Saying Linux is only a kernel and as such can't fill the user space requirements is both entirely accurate and entirely useless in the context of the question asked. Note how they say "or Ubuntu, Debian in particular", a part you completely ignored. (A comment from 2018 under the other answer also already mentions the "just a kernel" issue.)
    – ilkkachu
    Commented Sep 9, 2022 at 19:37
  • I didn't completely ignore the Linux distributions. I said that adding various parts to the kernel might result in an XSI-compliant system. I never tried to actually prove that myself, as it would take an enormous amount of time (or the appropriate test suite), both of which I am lacking. Commented Sep 10, 2022 at 10:50
  • This answer doesn't add anything to the question and completely ignores details already mentioned that prevent any system using the "Linux kernel" from being XSI-compliant regardless if they have an otherwise XSI-complaint userland. Proper waitid() support, for example, is entirely a kernel issue and being pedantic about it properly being "GNU/Linux" or whatever doesn't help the reader at all.
    – penguin359
    Commented Jun 26, 2023 at 23:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .