• Ging@anarchist.nexus
    link
    fedilink
    English
    arrow-up
    23
    ·
    18 hours ago

    I’ve been too scared to ask for a really long time
    What’s the big deal with POSIX? Why are ppl constantly discussing what is and isn’t posix compliant? Is it just funny or am I missing something important?

    • BartyDeCanter@lemmy.sdf.org
      link
      fedilink
      arrow-up
      52
      ·
      edit-2
      15 hours ago

      Ok, there seems to be a lot of confusion here about what POSIX is.

      A long time ago, there were a lot of systems by various companies and groups that all claimed to be Unix, or at least Unix compatible. But, since there wasn’t a standardized definition of Unix, they weren’t all compatible with each other. The US government and other groups decided this was a problem and asked the IEEE to come up with a standard that the vendors could certify to. This standard is named POSIX and is composed of low level OS APIs, C language support, shells, utilities and a bunch of other components.

      This meant that anything that targets POSIX should run on any POSIX system with nothing more than at most a recompile. There was a time, basically until the early ‘00s, that every major OS targeted being able to be certified POSIX in some way. This was great!

      However, since Linux has won the Unix wars, with MacOS in a technical second place, the importance of POSIX has mostly gone away. It is still an important spec. Linux, MacOS and even Windows more or less maintain compatibility with it, but there isn’t a push for certification the way there once was. If it runs on a couple Linux distros and MacOS, that’s probably good enough.

      EDIT: The jokes that you might see having to do with POSIX generally are about the fact that MacOS is certified POSIX compliant, but nobody really cares, while Linux has never been certified POSIX compliant but is the de facto standard UNIX and therefore the most common POSIX target.

    • Squiddlioni@kbin.melroy.org
      link
      fedilink
      arrow-up
      20
      ·
      17 hours ago

      It’s essentially a guarantee that certain tools and system APIs will be available, accept certain arguments, and accept/return data formatted in a specific way. It’s important for general purpose software and portability. Basically, if you want your software to run on anything and everything, you target POSIX. Except Windows, obviously, but pretty much everything else is POSIX compatible, or close enough that you’re probably fine.

      An example: I write medical applications that are distributed to many hospitals, so well outside of my direct control. One program in particular is run on Windows, Linux, or AIX. I have to write separate handling for Windows obviously, but all I need to do to support both Linux and AIX is stick to POSIX APIs and test on Linux. Which is great, because I don’t have access to an AIX system. I still have to do final testing on AIX, but with one minor exception in the last five years, it all just works.

    • Cawifre@lemmy.world
      link
      fedilink
      arrow-up
      25
      ·
      18 hours ago

      I’m no expert, but my take on the situation is that POSIX is a very old, very stable, relatively powerful API. If figure out a workflow that uses only POSIX tools, then you have very high confidence that you can reuse that workflow across any POSIX-compliant environment.

      • Ging@anarchist.nexus
        link
        fedilink
        English
        arrow-up
        5
        ·
        17 hours ago

        But if it’s just an old api, why is it still in the spotlight? I understand compatibility is important, but I’m almost never hearing half as much about any of the other old apis–can’t even really think of one either

        • arcterus@piefed.blahaj.zone
          link
          fedilink
          English
          arrow-up
          7
          ·
          15 hours ago

          It covers the majority of basic things you need your computer to do and it works practically everywhere. If you target POSIX (and you avoid uncommon features that some systems don’t implement), your program will probably run on Linux, macOS, *BSDs, random OSes you’ve never heard of, Windows (with certain setups), maybe your toaster, etc. It has a lot of inertia behind it at this point.

        • kautau@lemmy.world
          link
          fedilink
          arrow-up
          4
          ·
          15 hours ago

          Because it avoids this

          It’s the baseline of UNIX, with Linux maintaining most compatibility, meaning servers around the world, desktop environments including MacOS and GNU/Linux, gaming machines (including video game consoles like PlayStation and Steam Deck), mobile devices like Android and Apple Devices, mainframe computing systems, embedded systems, so on and so forth. It makes up the backbone of our technology infrastructure. It continues to be iterated on, and is tightly bound with the C programming language and its improvements and iterations.

    • WaterWaiver@aussie.zone
      link
      fedilink
      English
      arrow-up
      9
      ·
      edit-2
      17 hours ago

      If something is POSIX compliant then it’s very likely to work on any Linux, BSD or the like; and probably very easy to port to windows. It’s a sign that the developer is willing to go the extra mile to make users’ lives easier.

      N.B. “POSIX compliance” is not just considered in black or white terms, it’s also done in degrees. There are many things that have never formally been changed or been specified in POSIX but informally things have evolved. By attempting any level of compliance (or a similar equivalent) you tend to be doing better than most software.

    • tal@olio.cafe
      link
      fedilink
      English
      arrow-up
      7
      arrow-down
      2
      ·
      17 hours ago

      What’s the big deal with POSIX? Why are ppl constantly discussing what is and isn’t posix compliant?

      The short version: it’s a least-common-denominator standard that spans multiple Unix and Unix-like systems, so if you write to it, your software can fairly-trivially run on various systems.

      https://en.wikipedia.org/wiki/POSIX

      Windows has some level of Microsoft-provided Posix support, which is what the post is alluding to. I am fairly confident that it doesn’t have full Posix compliance. Cygwin, a separate, non-Microsoft, open-source effort, might qualify.

      kagis

      Okay, apparently it does confirm to a portion of the Posix standard:

      https://en.wikipedia.org/wiki/Microsoft_POSIX_subsystem

      The subsystem only implements the POSIX.1 standard – also known as IEEE Std 1003.1-1990 or ISO/IEC 9945-1:1990 – primarily covering the kernel and C library programming interfaces which allowed a program written for other POSIX.1-compliant operating systems to be compiled and run under Windows NT. The Windows NT POSIX subsystem did not provide the interactive user environment parts of POSIX, originally standardized as POSIX.2. That is, Windows NT did not provide a POSIX shell nor any Unix commands out of the box, except for pax. The NT POSIX subsystem also did not provide any of the POSIX extensions that postdated the creation of Windows NT 3.1, such as those for POSIX Threads or POSIX IPC.

    • Jul (they/she)@piefed.blahaj.zone
      link
      fedilink
      English
      arrow-up
      4
      ·
      17 hours ago

      If it’s POSIX compliant then it will work on all versions of Linux/Unix. Otherwise it depends on specific implementations that have branched for decades.