Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it actually important for a programmer to know if the standard library function he/she is using is actually executing a system call? If so, why?

Intuitively I'm guessing the only importance is in knowing if the general standard function is a library function or a system call itself. In other cases, I'm guessing there isn't much of a need to know if a library functions uses internally a system call?

share|improve this question

closed as off topic by Gilles, Renan, slm, jasonwryan, peterph Apr 29 '13 at 13:25

Questions on Unix & Linux Stack Exchange are expected to relate to Unix or Linux within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

As a programmer you should be interested in what the function call does, not how it is done. Sure, one can be curious about such things. But if a particular function does (or could) invoke a system call or not is very much system-dependent.

share|improve this answer
Some "system-calls" may actually not be system calls per se: VDSO – peterph Apr 29 '13 at 13:25

I can only think of two situations in which you might need to care about what the library function is doing:

  1. You discovered a bug in the function, and you verified this via some test cases.

  2. The function is causing you performance problems, and you verified this via appropriate profiling.

As a general rule, though, it doesn't really matter what the library is doing, so long as it isn't causing you any trouble.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.