Funnily enough, I've been trying to live with a program which tries to do POSIX-style disk IO on Windows. Or rather, I'm using several, but one of them pushes the edge cases of POSIX IO to breaking point. It's a ZUI (zoomable) file manager called Eagle Mode. It's always reading many files at once to display them. Under Linux or Mac, this works very well until you try to read a CD-ROM and then the whole program stalls while waiting for the slow disk. Under FreeBSD, it would stutter a little bit - stall very briefly and often. Under Windows, it stalls so much it's barely usable. Windows with 8GB RAM, Core i5
and SSD is much worse than Linux or OS X with 4GB, Core 2 Quad, and physical hard disks. If this is a general Windows problem, how on Earth could it ever be used as a server? Lots of programs seem to get on fine with Windows. I know of one which doesn't but I think it also uses POSIX file calls, so what's going on?
There's one obvious problem with Eagle mode: it expects specific semantics which barely hold true even on POSIX systems - it expects synchronous file reads to be fast. Obviously, it should be multi-threaded, but my point
Unix's seemingly simple file API and somewhat-good semantics have let Eagle Mode's author believe he could make this thing work without multi-threading. Now he's got this big codebase which is an awesome proof of concept, but needs really deep changes to be practical wherever synchronous file access is slow. Whether you're on full-bloatware Windows or you've left a 90s game CD-ROM in the drive of your lean, mean Linux machine, Eagle Mode gets impractically slow. (I told him this years ago, but he said it's too hard, and he's just continued to add features and make detail changes ever since. Including changing the script API regularly. I wish I could handle complex languages - emCore is nearly 41,000 lines of C++, emFileMan nearly 6,500.)
This brings me to a concept I've been wrestling with: Unix as conceived by Thompson and Ritchie was all about simple interfaces. They apparently didn't say so, or possibly other programmers argued until they stopped, but eventually Rob Pike made a statement about Linux's sysfs in relation to Plan 9: "The point isn't plain text interfaces, the point is simple interfaces." With a little knowledge of Unix history, it becomes clear that simple interfaces were also the main goal of Unix. In 1970 it was normal for file access to be complex, even unnecessarily difficult. Unix has a simple file API because simplicity was desired. (Other, more complex interfaces were added in Berkley (notably sockets), by commercial implementors, or perhaps in response to opposition within the Bell organization when Unix was part of the Programmer's Workbench system of 1972.) But it's not just simplicity, the idea seems to be to design the semantics of these simple interfaces to be good for a wide range of tasks.
I'm wondering if that's really a good thing, because no 'wide range' can possibly be 'wide' enough. Expectations based on Unix file semantacs fall apart if the filesystem is slow or if it has non-Unix semantics. And Unix - or Plan 9 - file semantics place demands on the file servers which can be impossible to meet or lead to other problems.
I kept running into these limitations of simplicity in Plan 9. Plan 9's primary network filesystem seems simple and good, but suffers serious performance degradation over long-distance networks, and while it's possible to work around it, such workarounds would complexify every program on the system; even cat. The simplicity of cat is a point of pride for many Plan 9 users.
Then there's the difficulty of writing file servers for Plan 9. Plan 9 is like a microkernel OS which uses file streams for its IPC. So many things are simple on Plan 9, but not writing a file server. A guy I know once wrote, "everything I've ever wanted to do with computers, I can do with a few lines of shell script in Plan 9," but then he almost immediately found he had to write a mountain of C code because Plan 9's file semantics didn't fit what he was trying to do. Over and over again I had this experience with Plan 9: whatever I wanted to do seemed easy, I'd get it part-way done, but some detail would crop up requiring so much more work! Sometimes it would be usable without the extra work, sometimes not. I ended up wondering if Plan 9's appearance of simple interfaces was really a good thing. And now I'm wondering the same about the parts of POSIX which come from original Unix. These interfaces are deceptively simple, and I'm thinking that's not a good thing.
Separately, the last thing I read in depth about POSIX function difficulties, many years ago, was the impossibility of fully implementing select(). I don't know if the standard has been improved, but at the time, select() was supposed to be able to select between every possible type of input. Many OSs didn't bother.