23 comments

[ 3.1 ms ] story [ 41.4 ms ] thread
Has there been any work for something post Unix 03?
So for those who, like me, wonders why Apple keeps getting macOS Unix certified, it's to avoid a lawsuit. Apple misused the Unix trademark when they first launched MacOS, so to avoid legal trouble with The Open Group, Terry Lambert was put in charge of getting MacOS Unix compliant and certified: https://www.quora.com/What-goes-into-making-an-OS-to-be-Unix...

It's basically the only relevance the Unix trademark has these days. I can't imagine many companies choosing macOS because it's a real Unix, nor would anyone really opt out of z/OS, AIX og HPUX, if they where not certified.

Literally the only reason that kept me on the platform until recently despite becoming increasingly hostile to developers...
(comment deleted)
OK, great.

Can I call poll(2) on a terminal device's file descriptor?

Requirement for certification: https://pubs.opengroup.org/onlinepubs/9799919799.2024edition...

> The poll() and ppoll() functions shall support regular files, terminal and pseudo-terminal devices, FIFOs, pipes, and sockets.

Apple (last time I checked): https://developer.apple.com/library/archive/documentation/Sy...

> BUGS: The poll() system call currently does not support devices.

I asked the same question of Sequoia: https://news.ycombinator.com/item?id=41822308

I had to work around this recently - it involved reimplementing my poll wrapper on top of select(), with the proprietary macOS extension that makes it support unlimited fds. (Of course -D_DARWIN_UNLIMITED_SELECT is completely unportable, so I still need poll too.)

Meanwhile poll() just works on Linux and the BSDs, certified or not.

There’s an interesting story from the lead engineer to make OS X originally compliant:

> I was asked if I could lead a team to do #1. I said “Yes, under the condition that I could use the compliance project as a hammer to force other parts of the organization to make changes in their own code base, and that I could play it rather loose with commit rules regarding what it said in the bugs database for a given code change, and what the given code change actually did, in addition to what it said in the bugs database”.

> We were promised 1/10th of the $200 million, or $20 million in stock, on completion. $10 million to me, $5 million to Ed, and $5 million to Karen Crippes, who was looking for a home in Mac OS X development, I knew was an amazing engineer, and who could be roped into being technical liaison and periodically kicking off the tests and complaining to Ed and I about things not passing.

—-

Source: https://www.quora.com/What-goes-into-making-an-OS-to-be-Unix...

HN discussion: https://news.ycombinator.com/item?id=29984016

Good thing to know when I go back to 1980s with a macbook!
I recently learned that macOS has a (by default) case insensitive filesystem. How does this line up with the certification?
Think of it: it's a Unix system. Literally. A unix system with the usability that your grandma can use. It supports both commercial and open source applications. The year of the linux desktop folks have been trying this for decades.

EDIT: already downvoted to negatives. The Linux folks really don't like to be reminded of that.

Sounds good, but grandma will need to disable SIP, run a few commands using sudo, and add a root account from the recovery system. It's Unix in the same way Windows 2000 was POSIX compliant, you just need to reconfigure the default system.

The Linux desktop is widely used all across the world in the form of ChromeOS and, if you count touch screen devices, Android.

my grandma used linux. in 1995!
And here I just want pthread_condattr_setclock() on Darwin. Is there some other interface to set monotonic expiries? I tried to port netconsd to Darwin and that's the sole hang up (well and recvmmsg() but that's trivial...)
There's pthread_cond_timedwait_relative_np. Looking at the implementation, pthread_cond_timedwait starts by converting the deadline to a relative timeout [1], but this is skipped if pthread_cond_timedwait_relative_np is used. Then, in the kernel, the timeout is converted back to an absolute deadline by either [2] or [3], but both of those are using Mach absolute time rather than the wall clock.

Mach absolute time is monotonic. It pauses while the system is asleep, which may or may not be what you want.

If need the timer to keep incrementing while the system is asleep, there's no way to do it directly with a timed wait, but you can use kevent with EVFILT_TIMER + NOTE_MACHTIME + NOTE_MACH_CONTINUOUS_TIME.

[1] https://github.com/apple-oss-distributions/libpthread/blob/1...

[2] https://github.com/apple-oss-distributions/libpthread/blob/1...

[3] https://github.com/apple-oss-distributions/xnu/blob/e3723e1f...

There was a time when “open standards” were treated as the definition of Unix. At least that's what we aspired to. POSIX, X/Open, and others competed to be the standard that mattered. Formal standards were hoped to be a sounder, fairer basis for compatibility and interoperability than the earlier era of “Unix is whatever this release says it is" for some subset of 7th Edition, System III, System V, BSD, or one's favorite commercial derivative (SunOS/Solaris, HP/UX, AIX, Xenix, UnixWare, ...).

That window window of optimism—roughly mid-1980s to mid-1990s—closed fast. Open source projects and _de facto_ standards proved far more powerful in deciding where applications would run, where investments would be made, and which variants survived. Today, the real baseline isn’t POSIX in a binder or some Open Group brand certificate, but Linux + GNU + the APIs everyone codes to. In some ways we've regressed—or more charitably, we shifted back to a more pragmatic form of standardization.

the big difference is that the Linux + GNU standard is not controlled by a corporation whose only motive is profit, and that the reference implementation is Free Software that everyone can potentially contribute to.

i would not call that a regression. compare that to the browser standard which is largely controlled by google.

macOS 26? I'm still on 15.6 -_-
Can there ever be a "living" standard to replace posix ...? Something that captures the good things about posix but allows all the related ecosystems to move everyone forward toward a better base specification (together rather than just increasing the number of bsd vs gnu special cases that with current plans will just have to be lived with forever)

Browser standards managed to do this in a lot of ways despite far more complex standards, more complex variations in behavior, and much more rapid continue evolution ...

I really don't care about the certification. I care that I have a terminal with bash (still) and I have ssh. This gets me through probably more than 50% of the work that I do. And that I can install packages and have an as close experience as if I were to be on a Linux machine (development frameworks, containers).

I also like the fact that I have a very polished desktop manager running on great hardware with a lot of battery life.

I wouldn't trade this for anything.