The Linux System Call Execution Model: An Insight
Open Source For You|August 2024
This two-part series of articles focuses on the system call execution model in Linux based operating systems. This first part explains what system calls are, why they are required and the role of the glibc wrapper in system call execution. It then touches on the system call execution model from the Linux kernel perspective.
The Linux System Call Execution Model: An Insight

A system call is a request by a user space program (application) to interact with an OS executing in the kernel space. Basically, the user application invokes a system call when it requires access to the services that can only be accessed through a higher privilege mode — for example, creating a new task, doing network I/O or file I/O, or accessing hardware resources. These operations cannot be directly performed by the user space application; hence, operating systems like Linux provide a set of routines called system calls which are basically C functions executing in the kernel space.

When a user space program invokes a system call, there is a software interrupt (nowadays x86-64 provides syscall instruction for fast system call execution) and the mode switches from user space to kernel space (or more precisely, the privilege mode changes from lower to higher). Now the system call handler in the kernel space performs the required operation on behalf of the user space application and sends the response back to it.

We will see in detail in later sections as to how the user space to kernel space mode switching happens and how kernel space system call handlers are invoked. But first let’s examine the role of the standard C library in the execution of system calls.

Role of the C library

When we say C library, the most commonly and widely distributed C library with a Linux based OS is glibc or GNU C library. This C library helps implement standard C functions and APIs like print(), scanf(), malloc(), fopen(), strcpy(), etc. These standard functions may or may not invoke system calls internally — for example, printf() internally invokes write(2) system calls. However, all these internal invocations of system calls are hidden from the user space application.

Denne historien er fra August 2024-utgaven av Open Source For You.

Start din 7-dagers gratis prøveperiode på Magzter GOLD for å få tilgang til tusenvis av utvalgte premiumhistorier og 9000+ magasiner og aviser.

Denne historien er fra August 2024-utgaven av Open Source For You.

Start din 7-dagers gratis prøveperiode på Magzter GOLD for å få tilgang til tusenvis av utvalgte premiumhistorier og 9000+ magasiner og aviser.

FLERE HISTORIER FRA OPEN SOURCE FOR YOUSe alt
Not Investing in a Cloud Security Program can be Expensive
Open Source For You

Not Investing in a Cloud Security Program can be Expensive

A well-planned cloud security program serves as the primary barrier against security breaches, protecting both the company's assets and its reputation. It's a crucial component that supports an organisation's overall health and in a world with more advanced cyber threats, it helps meet the basic compliance standards that stakeholders expect.

time-read
5 mins  |
September 2024
Cutting Costs, Not Corners: Building Large Scale Applications with Open Source Software
Open Source For You

Cutting Costs, Not Corners: Building Large Scale Applications with Open Source Software

Here are some strategies and best practices for leveraging open source to create enterprise-grade web and mobile applications without sacrificing quality or functionality.

time-read
6 mins  |
September 2024
FIDO2 and WebAuthn: Ensuring Secure User Authentication
Open Source For You

FIDO2 and WebAuthn: Ensuring Secure User Authentication

In today's digital landscape, securing online identities is more crucial than ever. Traditional passwords are no longer sufficient to protect sensitive information, which is where advanced passwordless authentication mechanisms like FIDO2 and WebAuthn come into play. These technologies offer a powerful solution for secure user authentication in a browser-based environment.

time-read
5 mins  |
September 2024
Aspiring to be a DevOps Engineer? Here are a Few Tips
Open Source For You

Aspiring to be a DevOps Engineer? Here are a Few Tips

Organisations are embracing DevOps in software development to ensure quality products are delivered faster. This fast-growing domain offers a range of career opportunities for those willing to learn. You can enrol for one of the many industry-recognised certifications and then gain experience through internships and entry-level positions.

time-read
7 mins  |
September 2024
GitHub Actions: Accelerating DevOps Adoption
Open Source For You

GitHub Actions: Accelerating DevOps Adoption

The integration of DevOps practices has become crucial for achieving rapid, reliable, and high-quality software delivery. GitHub Actions, an automation tool provided by GitHub, significantly contributes to this process by streamlining and automating various stages of the software development lifecycle. Let's find out how it can accelerate DevOps adoption.

time-read
4 mins  |
September 2024
DevOps in a Nutshell
Open Source For You

DevOps in a Nutshell

This overview takes you down the path of DevOps development, its benefits and drawbacks as well as the resources you may need to become an expert in this field. It explains the roles of a DevOps professional and why they are in demand.

time-read
5 mins  |
September 2024
The DevOps Guide: Trends, Tools, Skills, and Career Opportunities
Open Source For You

The DevOps Guide: Trends, Tools, Skills, and Career Opportunities

In today's fast-paced digital world, DevOps is crucial for software development and IT operations. By fostering collaboration and automating processes, it aims to deliver high-quality software quickly and reliably. Let's explore the latest trends in DevOps, essential tools, required skills, career opportunities, and the future of this transformative practice.

time-read
7 mins  |
September 2024
AlOps: Integrating AI with DevOps
Open Source For You

AlOps: Integrating AI with DevOps

By integrating AI with DevOps, we can harness the power of both technologies to quicken the development of quality software. Open source DevOps tools now come with AI integrated in them to automate the software development lifecycle and enhance security features.

time-read
6 mins  |
September 2024
Getting Started on Contributing to Free Software
Open Source For You

Getting Started on Contributing to Free Software

Interested in contributing to free and open source software but wondering where and how to begin? Dive in to find out...it's quite simple.

time-read
7 mins  |
September 2024
AI Services in Microsoft Azure: Designed to Help
Open Source For You

AI Services in Microsoft Azure: Designed to Help

Microsoft's Azure AI services enable optimised operations in industries as varied as retail, healthcare, manufacturing, finance, education, and media.

time-read
6 mins  |
September 2024