Show HN: Libcox – A C Library for Cross-Platform System Calls
libcox.net
libcox.net
Thanks also to you for sharing a couple well-established alternatives.
So if you ask this question, you might as well ask why system calls are not more expansive in their capabilities.
I think there's a reason, system calls are much simpler. They are building bricks. If you want to layer something complex on top, you're free to do so.
About your suggestions, ACE's documentation is particularly bad. I wouldn't recommend it to anyone.
libcox is for when your existing code would do something like system("uname") or system("ls") (... except not even with system(), with popen() or something), and you want it portable to Windows.
rc = libcox_exec_fmt(pHandle,&pResult,"ls '%s'",zDir); /*Don't forget the single quotes around 'zDir' */
This is either insecure, or so different from a shell as to make it not worth using shell syntax.I really like the concept though. Took me to figure out what the concept is because "system calls" doesn't mean "shell commands" to me, but having figured that out, operating on shell commands has a lot of things going for it.
That'd be my guess, at least, but, i guess, single quotes aren't valid characters for zDir.
(In the absence of this, and certainly in the absence of official docs/examples that do the right thing, that's a security vulnerability waiting to happen.)