My OS course was my first real exposure to the depths of UNIX and C. Being used to Python, I quickly got fed up with how archaic and arcane most of the UNIX/C APIs are. I have a feeling that, if it were judged by even somewhat modern software engineering standards, it would be panned.
There is probably a logical reason to the design and nomenclature of the system. Unfortunately, these things seem to get lost over time. I imagine that in another twenty to thirty years a portion of our current technology will be considered unnecessarily complicated and obfuscated.
<p><pre><code> Is it too much to ask to create separate sem_wait()
and sem_post() methods.
</code></pre>
What happens when you want to do a sequence of waits and posts, and you want to do it atomically? You'd have to introduce an extra semaphore to control access to all doing your sequence.<p>With the semop() function, you put all your desired operations in one array of ops, and make one semop call, which does all the operations atomically.