The Runtime Theory
mediumHardwareInternals#calling-convention#privilege-boundary

What Is the Difference Between a Function Call and a System Call?

A systems prompt about calling conventions, privilege boundaries, kernel services, and the source-level syntax that can hide them.

TRT practice prompt — not a verified question from a named employer.

The Runtime Theory Team1 min read

A strong answer

A function call transfers control within a program according to a calling convention or ABI. The caller and callee agree on where arguments and results go, which registers are preserved, and how control returns. The compiler may inline the function, so a source-level call does not guarantee a machine-level call or a stack frame.

A system call requests a privileged operating-system service, such as reading a file or creating a process. On a protected system, a special instruction transfers execution into a kernel entry path, where the kernel validates arguments and performs or schedules the operation. It may return data, a status, or an error.

The two can appear together: a C library function may wrap a system call, but some library functions do only userspace work, and one library call can make multiple system calls. Similar syntax does not imply the same boundary.

Follow-up direction

Use a concrete example such as printf versus write: formatted output may be buffered in userspace before a write operation crosses into the kernel.

This answer walks

Practice follow-ups

  1. 01Does every function call create a stack frame?
  2. 02Can a library function make no system calls?
  3. 03What work occurs after a process enters the kernel?

One dispatch a week

The trace behind each question, the tradeoff that explains it, and one technical dispatch per week — no noise.

One technical dispatch per week. No noise.

Not started

Sign in to save your learning progress.

Sign in to save