> As people have found out in the past, the real Unix API is the whole collection of behaviors and environments that Unix programs assume. It isn't just POSIX library calls; it's also the shell and standard utilities and files that are in known locations and standard capabilities and various other things.<p>But... "the shell and standard utilities and files that are in known locations and standard capabilities and various other things" are also specified by POSIX.<p>(Historically, they were the "POSIX.2" standard, and the libc/syscall library functions were in the "POSIX.1" standard, but since 1998 when POSIX became the ratification of Single Unix Specification version 2-and-later, they're all just in "POSIX".)<p>So... yes?<p>> Unless you intend for your program to be narrowly and specifically portable to POSIX or an even more minimal standard, it is not a bug for it to rely on portions of the broader, de facto Unix API. It's not even necessarily a bug to rely on APIs that are only there on some Unixes (for example Linux and FreeBSD),<p>Why would any of those things be considered a "bug"?<p>> for example, can you implement a compatible and fully capable Bourne shell using only public Unix kernel APIs, or at most public C library APIs?<p>What other APIs does the author think that Bourne shell writers used?<p>I feel like I'm missing some broader context for this post.
> <i>It isn't just POSIX library calls; it's also the shell and standard utilities and files that are in known locations and standard capabilities and various other things.</i><p>POSIX has standardized the shell and utilities since before 1990. Of course, not all of them. As far as locations go, you have to rely on PATH; systems do not agree on what exactly is in /bin, /usr/bin and /sbin.<p>> A 'Unix' without a useful $HOME environment variable and /tmp may be specification compliant (I haven't checked POSIX) but it's not useful, in that many programs that people want generally won't run on it.<p>Hits for the HOME variable in POSIX:<p><a href="https://pubs.opengroup.org/cgi/susv4search.cgi?KEYWORDS=HOME&SUBSTRING=substring&CONTEXT=" rel="nofollow">https://pubs.opengroup.org/cgi/susv4search.cgi?KEYWORDS=HOME...</a><p>Under the Shell Command Language it is documented that <i>HOME</i> is "[t]he pathname of the user's home directory. The contents of HOME are used in tilde expansion (see Tilde Expansion)."<p>/tmp is a <i>de facto</i> standard. POSIX encourages applications to check for the existence of a variable called TMPDIR, but doesn't require implementations to provide that.<p>There are functions which abstract creating a temporary file or directory. Some of them need a template, some don't. It is possible to write a program which uses /tmp for temporary files, yet doesn't refer to "/tmp".
I can see his point but it seems to rely on redefining what the term "API" means. You could as well say "The Windows API isn't just .NET - it's Win32 and a whole lot of other things". Which is kind of true, but we don't usually call all of those things an API. We call some of those individual parts APIs, just like we do with UNIX. And other parts we'd call filesystem conventions and so on.<p>I think he's arguing that you need to know all of those things to program with the OS and he's right, but that's still not how we conventionally use the word "API". It's more of a "standard" and the POSIX standard actually does define a lot of this.
This is kind of an odd take because POSIX is purposed to make application development across Linux and Unix easier by providing reliable behavior. Saying, "my OS is better than the high level standard because it does more" makes me go, "Okay".<p>Also, I'm not sure the author has ever actually read POSIX?
If we could finally semantically split the signals as those which can be asynchronoulsy delivered and those which sort of cannot (segfault)... that without extra and bonus kludge.