Technische Universität Braunschweig
  • Study & Teaching
    • Beginning your Studies
      • Prospective Students
      • Degree Programmes
      • Application
      • Fit4TU
      • Why Braunschweig?
    • During your Studies
      • Fresher's Hub
      • Term Dates
      • Courses
      • Practical Information
      • Beratungsnavi
      • Additional Qualifications
      • Financing and Costs
      • Special Circumstances
      • Health and Well-being
      • Campus life
    • At the End of your Studies
      • Discontinuation and Credentials Certification
      • After graduation
      • Alumni*ae
    • For Teaching Staff
      • Strategy, Offers and Information
      • Learning Management System Stud.IP
    • Contact
      • Study Service Centre
      • Academic Advice Service
      • Student Office
      • Career Service
  • Research
    • Research Profile
      • Core Research Areas
      • Clusters of Excellence at TU Braunschweig
      • Research Projects
      • Research Centres
      • Professors‘ Research Profiles
    • Early Career Researchers
      • Support in the early stages of an academic career
      • PhD-Students
      • Postdocs
      • Junior research group leaders
      • Junior Professorship and Tenure-Track
      • Habilitation
      • Service Offers for Scientists
    • Research Data & Transparency
      • Transparency in Research
      • Research Data
      • Open Access Strategy
      • Digital Research Announcement
    • Research Funding
      • Research Funding Network
      • Research funding
    • Contact
      • Research Services
      • Academy for Graduates
  • International
    • International Students
      • Why Braunschweig?
      • Degree seeking students
      • Exchange Studies
      • TU Braunschweig Summer School
      • Refugees
      • International Student Support
    • Going Abroad
      • Studying abroad
      • Internships abroad
      • Teaching and research abroad
      • Working abroad
    • International Researchers
      • Welcome Support
      • PhD Studies
      • Service for host institutes
    • Language and intercultural competence training
      • Learning German
      • Learning Foreign Languages
      • Intercultural Communication
    • International Profile
      • Internationalisation
      • International Cooperations
      • Strategic Partnerships
      • International networks
    • International House
      • About us
      • Contact & Office Hours
      • News and Events
      • International Days
      • 5th Student Conference: Internationalisation of Higher Education
      • Newsletter, Podcast & Videos
      • Job Advertisements
  • TU Braunschweig
    • Our Profile
      • Aims & Values
      • Regulations and Guidelines
      • Alliances & Partners
      • The University Development Initiative 2030
      • Foundation University
      • Facts & Figures
      • Our History
    • Career
      • Working at TU Braunschweig
      • Vacancies
    • Economy & Business
      • Entrepreneurship
      • Friends & Supporters
    • General Public
      • Check-in for Students
      • The Student House
      • Access to the University Library
    • Media Services
      • Communications and Press Service
      • Services for media
      • Film and photo permits
      • Advices for scientists
      • Topics and stories
    • Contact
      • General Contact
      • Getting here
  • Organisation
    • Presidency & Administration
      • Executive Board
      • Designated Offices
      • Administration
      • Committees
    • Faculties
      • Carl-Friedrich-Gauß-Fakultät
      • Faculty of Life Sciences
      • Faculty of Architecture, Civil Engineering and Environmental Sciences
      • Faculty of Mechanical Engineering
      • Faculty of Electrical Engineering, Information Technology, Physics
      • Faculty of Humanities and Education
    • Institutes
      • Institutes from A to Z
    • Facilities
      • University Library
      • Gauß-IT-Zentrum
      • Professional and Personnel Development
      • International House
      • The Project House of the TU Braunschweig
      • Transfer Service
      • University Sports Center
      • Facilities from A to Z
    • Equal Opportunity Office
      • Equal Opportunity Office
      • Family
      • Diversity for Students
  • Search
  • Quicklinks
    • People Search
    • Webmail
    • cloud.TU Braunschweig
    • Messenger
    • Cafeteria
    • Courses
    • Stud.IP
    • Library Catalogue
    • IT Services
    • Information Portal (employees)
    • Link Collection
    • DE
    • EN
    • IBR YouTube
    • Facebook
    • Instagram
    • YouTube
    • LinkedIn
    • Mastodon
Menu
  • Organisation
  • Faculties
  • Carl-Friedrich-Gauß-Fakultät
  • Institutes
  • Institute of Operating Systems and Computer Networks
  • Prof. Dr.-Ing. Christian Dietrich
  • Advent(2)
Logo IBR
IBR Login
  • Institute of Operating Systems and Computer Networks
    • News
    • About us
      • Whole Team
      • Directions
      • Floor Plan
      • Projects
      • Publications
      • Software
      • News Archive
    • Connected and Mobile Systems
      • Team
      • Courses
      • Theses
      • Projects
      • Publications
      • Software
      • Datasets
    • Reliable System Software
      • Overview
      • Team
      • Teaching
      • Theses & Jobs
      • Research
      • Publications
    • Algorithms
      • Team
      • Courses
      • Theses
      • Projects
      • Publications
    • Microprocessor Lab
    • Education
      • Summer 2025
      • Winter 2024/2025
      • Theses
    • Services
      • Library
      • Mailinglists
      • Webmail
      • Knowledge Base
      • Wiki
      • Account Management
      • Services Status
    • Spin-Offs
      • Docoloc
      • bliq (formerly AIPARK)
      • Confidential Technologies
    • Research Cooperations
      • IST.hub
  • Task Overview
  • Git repository
  • Mailing list
  • Matrix-Channel

Advent(2) -- The System Call Advent Calendar

Welcome to the Advent(2), the Advent calendar of the Institute of Operating Systems and Computer Networks at the TU Braunschweig. Every day of December, we will open a door and find a system call, a concept or an interface of Linux. Behind each door, there is a short article and a small exercise, for which the solution is provided the following day.

Christian Dietrich
The system call advent calendar is being organized by Prof. Christian Dietrich. Explore the upcoming topics for Bachelor's and Master's theses! If you are considering pursuing a PhD under his guidance, do not hesitate to reach out: dietrich-at-ibr.cs.tu-bs.de

Introduction

System calls are commands that our programs send to the operating system kernel to get things done. And there are a lot of system calls that we can choose from. In our programs, system calls look like normal function calls as the C library provides thin wrapper functions that pack the arguments, invoke the OS, and post-process the return code (errno(3)).

From your experience, it might be quite muddy to know whether a C-library function is a thin wrapper around a bare system call (like open(2)), a thick wrapper that provides additional user space functionality (like fopen(3)), or a function that does not involve the kernel (like atoi(3)). Most of the time, this distinction does not matter at all. However, in this Advent(2), we want to focus on the bare and naked OS interface and show you abstractions, interfaces, and concepts that are interesting, not well-known, or just plain useful. At the beginning, we will have a slow start, we will see things that you might already know, or at least you believe to know.

For this project, we will often link man-pages(7) that contain the detailed descriptions of the involved system calls. Read them! At least the DESCRIPTION section. With more and more of those, you will get a deeper understanding of the basic UNIX concepts. These man pages are organized in so-called "sections", where section 1 refers to command-line tools (e.g., cat(1)), section 2 to system-call wrappers (e.g., open(2)), and section 3 to C-library functions (e.g., fopen(3), atoi(3)). While you can read those manual pages in your browser, the man(1) command-line tool is even more useful, as it is always at your fingertips when you at work with the shell. Try it ($ in monotype indicates a shell prompt):

$ man 1 man
$ man 2 open
$ man 3 fopen

About the Advent(2)

We will describe a system-call, a concept or an interface each day. Thereby, we will not stick to the POSIX standards, but we will enjoy the full depth of Linux specific interfaces! You can either just read and enjoy these articles (and the solution code) or you can work out the tasks by yourself. The most important part of this calendar is that we have some fun together and learn something about Linux.

What you need is a Linux shell (as we focus on Linux) with the gcc C compiler installed (apt-get install build-essential). The easiest way to get such an environment is to use SSH to log into you local university's computer pool. But also an Ubuntu installation in a virtual machine or the Windows Subsystem for Linux (WSL) are viable options. For some exercises, you will need a relatively recent Linux kernel (> 5.10) as we will explore some shiny new features.

Calendar

Creative Illustration for The Endless Advent Calendar

24

The Endless Advent Calendar

process 61 lines

[prctl(2), sigaction(2)]

Creative Illustration for Counting Presents. Fast!

23

Counting Presents. Fast!

ipc 12 lines

[getcpu(2), rseq(2)]

Creative Illustration for On Christmas, They Come and Go!

22

On Christmas, They Come and Go!

process 115 lines

[netlink(7), netlink(3)]

Creative Illustration for Let the Children Speak up!

21

Let the Children Speak up!

ipc 155 lines

[sendmsg(2), cmsg(3), unix(7)]

Creative Illustration for Don't Dip Your Fingers into the Sauce!

20

Don't Dip Your Fingers into the Sauce!

process 52 lines

[process_vm_readv(2), process_vm_writev(2)]

Creative Illustration for Cookie Counting

19

Cookie Counting

process 69 lines

[perf_event_open(2)]

Creative Illustration for A Trace of Cookie Crumbs

18

A Trace of Cookie Crumbs

process 63 lines

[ptrace(2)]

Creative Illustration for Stop Asking for more Presents

17

Stop Asking for more Presents

process 59 lines

[seccomp(2)]

Creative Illustration for Spin the Advent Wreath as Fast as You can

16

Spin the Advent Wreath as Fast as You can

file 171 lines

[io_uring_setup(2), io_uring_register(2)]

Creative Illustration for Let the ELF Note Everything

15

Let the ELF Note Everything

ipc 114 lines

[pty(7), termios(3)]

Creative Illustration for Last Christmas I Gave you my Letter

14

Last Christmas I Gave you my Letter

file 137 lines

[getdents64(2), statx(2)]

Creative Illustration for Santas Postbox (2)

13

Santas Postbox (2)

ipc 43 lines

[signalfd(2), signal(7), mq_overview(7), mq_open(2), mq_timedreceive(2)]

Creative Illustration for Santa's Postbox

12

Santa's Postbox

ipc 74 lines

[fifo(7), unix(7), mknod(2)]

Creative Illustration for Send a Letter to Santa. Fast.

11

Send a Letter to Santa. Fast.

ipc 44 lines

[sendfile(2), memfd_create(2)]

Creative Illustration for Pipes Full of Gravy

10

Pipes Full of Gravy

ipc 131 lines

[epoll_create(2), epoll_ctl(2), epoll_wait(2), pipe(7), splice(2)]

Creative Illustration for For Christmas, Checks are Extended

9

For Christmas, Checks are Extended

file 65 lines

[getxattr(2), setxattr(2), listxattr(2)]

Creative Illustration for Wishlist Sorting

8

Wishlist Sorting

file 61 lines

[readv(2), writev(2), preadv(2), pwritev(2)]

Creative Illustration for Select a Gift

7

Select a Gift

file 110 lines

[select(2)]

Creative Illustration for The Self-Healing Road to Perdition

6

The Self-Healing Road to Perdition

process 90 lines

[sigaction(2)]

Creative Illustration for Wake me up before you clo-close!

5

Wake me up before you clo-close!

file 70 lines

[inotify_init(2), inotify_add_watch(2), read(2)]

Creative Illustration for Workbench Management

4

Workbench Management

ipc 101 lines

[futex(2)]

Creative Illustration for A Map to Persistance!

3

A Map to Persistance!

memory 65 lines

[mmap(2), ftruncate(2)]

Creative Illustration for Clone a Chimera!

2

Clone a Chimera!

process 45 lines

[clone(2), fork(2), getpid(2), gettid(2)]

Creative Illustration for The cat on the tip of the iceberg

1

The cat on the tip of the iceberg

file 45 lines

[open(2), pread(2), close(2)]

Last modified: 2023-12-01 15:52:27.445711, Last author: , Permalink: /p/advent


last changed 2024-11-25, 11:03 by Prof. Dr.-Ing. Christian Dietrich

For All Visitors

Vacancies of TU Braunschweig
Career Service' Job Exchange 
Merchandising

For Students

Term Dates
Courses
Degree Programmes
Information for Freshman
TUCard

Internal Tools

Glossary (GER-EN)
Change your Personal Data

Contact

Technische Universität Braunschweig
Universitätsplatz 2
38106 Braunschweig

P. O. Box: 38092 Braunschweig
GERMANY

Phone: +49 (0) 531 391-0

Getting here

© Technische Universität Braunschweig
Imprint Privacy Accessibility