Quote:
Originally Posted by sundialsvcs
... whereas I would respectfully dissent, and say to the OP: "if you find a saddle, ride in it, instead of trying to hang-on to the back of the horse." System calls are really designed to be the low est level interface. There's a lot of stuff that is "ordinarily needed" that has already been built on-top of that layer, in the form of standard system libraries ... both those that are included with the language and those that are not. To me, it's senseless to reinvent any wheel at all. There's no "up-side" to doing it, it takes many hundreds of thousands of microseconds to add-up to the blink of an eye, and there could be a "down-side," therefore ... "why (bother)?"
|
Right, if we are talking about a program that wants to be platform independent and already uses the standard library, then there is little benefit in using syscalls over the standard library.
However, if the choice is between another dependency (third party library) or using a few syscalls, then syscalls look a lot more attractive, even to the end user who has to install the thing. Now, I can't think of a case where that would ever be the problem, since third party libraries typically implement things that are very difficult with syscalls.
It should also be noted that the OP mentioned the program is meant to run on Linux, so if portability is not an issue then another disadvantage of syscalls disappears.
Anyways, I took a second to do a google search and came up with this:
https://github.com/graemeg/freepasca.../src/xattr.pas
Which looks like there is an xattr unit included with the freepascal compiler.