mirror of
https://github.com/linkedin/school-of-sre
synced 2026-01-08 09:38:05 +00:00
2431 lines
66 KiB
HTML
2431 lines
66 KiB
HTML
|
||
<!doctype html>
|
||
<html lang="en" class="no-js">
|
||
<head>
|
||
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||
|
||
|
||
|
||
|
||
<link rel="canonical" href="https://linkedin.github.io/school-of-sre/level102/system_calls_and_signals/system_calls/">
|
||
|
||
<link rel="shortcut icon" href="../../../img/favicon.ico">
|
||
<meta name="generator" content="mkdocs-1.2.3, mkdocs-material-6.2.8">
|
||
|
||
|
||
|
||
<title>System Calls - School Of SRE</title>
|
||
|
||
|
||
|
||
<link rel="stylesheet" href="../../../assets/stylesheets/main.cb6bc1d0.min.css">
|
||
|
||
|
||
<link rel="stylesheet" href="../../../assets/stylesheets/palette.39b8e14a.min.css">
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
|
||
<style>body,input{font-family:"Roboto",-apple-system,BlinkMacSystemFont,Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono",SFMono-Regular,Consolas,Menlo,monospace}</style>
|
||
|
||
|
||
|
||
|
||
<link rel="stylesheet" href="../../../stylesheets/custom.css">
|
||
|
||
|
||
|
||
|
||
|
||
</head>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<body dir="ltr" data-md-color-scheme="" data-md-color-primary="none" data-md-color-accent="none">
|
||
|
||
|
||
|
||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||
<label class="md-overlay" for="__drawer"></label>
|
||
<div data-md-component="skip">
|
||
|
||
|
||
<a href="#introduction" class="md-skip">
|
||
Skip to content
|
||
</a>
|
||
|
||
</div>
|
||
<div data-md-component="announce">
|
||
|
||
</div>
|
||
|
||
|
||
<script async defer data-domain="linkedin.github.io" src="https://tracking.eskratch.com/js/plausible.js"></script>
|
||
<script>document.addEventListener("DOMContentLoaded", function() {
|
||
if (document.getElementById("nav-2").checked!=true && document.getElementById("nav-3").checked!=true && window.innerWidth>1220){
|
||
document.getElementById("nav-2").checked=true;
|
||
document.getElementById("nav-3").checked=true;
|
||
|
||
}
|
||
});</script>
|
||
|
||
|
||
|
||
<header class="md-header" data-md-component="header">
|
||
<nav class="md-header-nav md-grid" aria-label="Header">
|
||
<a href="https://linkedin.github.io/school-of-sre/" title="School Of SRE" class="md-header-nav__button md-logo" aria-label="School Of SRE">
|
||
|
||
<img src="../../../img/sos.png" alt="logo">
|
||
|
||
</a>
|
||
<!-- Button to open drawer -->
|
||
<label class="md-header-nav__button md-icon" for="__drawer">
|
||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/></svg>
|
||
</label>
|
||
<div class="md-header-nav__title" data-md-component="header-title">
|
||
|
||
<div class="md-header-nav__ellipsis">
|
||
<span class="md-header-nav__topic md-ellipsis">
|
||
<a href="https://linkedin.github.io/school-of-sre/" title="School Of SRE" >
|
||
School Of SRE
|
||
</a>
|
||
</span>
|
||
<span class="md-header-nav__topic md-ellipsis">
|
||
|
||
System Calls
|
||
|
||
</span>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<label class="md-header-nav__button md-icon" for="__search">
|
||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
|
||
</label>
|
||
|
||
<div class="md-search" data-md-component="search" role="dialog">
|
||
<label class="md-search__overlay" for="__search"></label>
|
||
<div class="md-search__inner" role="search">
|
||
<form class="md-search__form" name="search">
|
||
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" data-md-state="active" required>
|
||
<label class="md-search__icon md-icon" for="__search">
|
||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
|
||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
|
||
</label>
|
||
<button type="reset" class="md-search__icon md-icon" aria-label="Clear" data-md-component="search-reset" tabindex="-1">
|
||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
|
||
</button>
|
||
</form>
|
||
<div class="md-search__output">
|
||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||
<div class="md-search-result" data-md-component="search-result">
|
||
<div class="md-search-result__meta">
|
||
Initializing search
|
||
</div>
|
||
<ol class="md-search-result__list"></ol>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
</nav>
|
||
</header>
|
||
|
||
<div class="md-container" data-md-component="container">
|
||
|
||
|
||
|
||
|
||
<main class="md-main" data-md-component="main">
|
||
<div class="md-main__inner md-grid">
|
||
|
||
|
||
|
||
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation" >
|
||
<div class="md-sidebar__scrollwrap">
|
||
<div class="md-sidebar__inner">
|
||
|
||
|
||
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
|
||
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../.." class="md-nav__link">
|
||
Home
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-2" type="checkbox" id="nav-2" >
|
||
|
||
<label class="md-nav__link" for="nav-2">
|
||
Level 101
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Level 101" data-md-level="1">
|
||
<label class="md-nav__title" for="nav-2">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Level 101
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-2-1" type="checkbox" id="nav-2-1" >
|
||
|
||
<label class="md-nav__link" for="nav-2-1">
|
||
Fundamentals Series
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Fundamentals Series" data-md-level="2">
|
||
<label class="md-nav__title" for="nav-2-1">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Fundamentals Series
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-2-1-1" type="checkbox" id="nav-2-1-1" >
|
||
|
||
<label class="md-nav__link" for="nav-2-1-1">
|
||
Linux Basics
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Linux Basics" data-md-level="3">
|
||
<label class="md-nav__title" for="nav-2-1-1">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Linux Basics
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/linux_basics/intro/" class="md-nav__link">
|
||
Introduction
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/linux_basics/command_line_basics/" class="md-nav__link">
|
||
Command Line Basics
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/linux_basics/linux_server_administration/" class="md-nav__link">
|
||
Server Administration
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/linux_basics/conclusion/" class="md-nav__link">
|
||
Conclusion
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-2-1-2" type="checkbox" id="nav-2-1-2" >
|
||
|
||
<label class="md-nav__link" for="nav-2-1-2">
|
||
Git
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Git" data-md-level="3">
|
||
<label class="md-nav__title" for="nav-2-1-2">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Git
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/git/git-basics/" class="md-nav__link">
|
||
Git Basics
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/git/branches/" class="md-nav__link">
|
||
Working With Branches
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/git/github-hooks/" class="md-nav__link">
|
||
Github and Hooks
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/git/conclusion/" class="md-nav__link">
|
||
Conclusion
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-2-1-3" type="checkbox" id="nav-2-1-3" >
|
||
|
||
<label class="md-nav__link" for="nav-2-1-3">
|
||
Linux Networking
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Linux Networking" data-md-level="3">
|
||
<label class="md-nav__title" for="nav-2-1-3">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Linux Networking
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/linux_networking/intro/" class="md-nav__link">
|
||
Introduction
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/linux_networking/dns/" class="md-nav__link">
|
||
DNS
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/linux_networking/udp/" class="md-nav__link">
|
||
UDP
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/linux_networking/http/" class="md-nav__link">
|
||
HTTP
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/linux_networking/tcp/" class="md-nav__link">
|
||
TCP
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/linux_networking/ipr/" class="md-nav__link">
|
||
Routing
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/linux_networking/conclusion/" class="md-nav__link">
|
||
Conclusion
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-2-2" type="checkbox" id="nav-2-2" >
|
||
|
||
<label class="md-nav__link" for="nav-2-2">
|
||
Python and Web
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Python and Web" data-md-level="2">
|
||
<label class="md-nav__title" for="nav-2-2">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Python and Web
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/python_web/intro/" class="md-nav__link">
|
||
Introduction
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/python_web/python-concepts/" class="md-nav__link">
|
||
Some Python Concepts
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/python_web/python-web-flask/" class="md-nav__link">
|
||
Python, Web and Flask
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/python_web/url-shorten-app/" class="md-nav__link">
|
||
The URL Shortening App
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/python_web/sre-conclusion/" class="md-nav__link">
|
||
Conclusion
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-2-3" type="checkbox" id="nav-2-3" >
|
||
|
||
<label class="md-nav__link" for="nav-2-3">
|
||
Data
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Data" data-md-level="2">
|
||
<label class="md-nav__title" for="nav-2-3">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Data
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-2-3-1" type="checkbox" id="nav-2-3-1" >
|
||
|
||
<label class="md-nav__link" for="nav-2-3-1">
|
||
Relational Databases
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Relational Databases" data-md-level="3">
|
||
<label class="md-nav__title" for="nav-2-3-1">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Relational Databases
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/databases_sql/intro/" class="md-nav__link">
|
||
Introduction
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/databases_sql/concepts/" class="md-nav__link">
|
||
Key Concepts
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/databases_sql/mysql/" class="md-nav__link">
|
||
MySQL
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/databases_sql/innodb/" class="md-nav__link">
|
||
InnoDB
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/databases_sql/backup_recovery/" class="md-nav__link">
|
||
Backup and Recovery
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/databases_sql/replication/" class="md-nav__link">
|
||
MySQL Replication
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-2-3-1-7" type="checkbox" id="nav-2-3-1-7" >
|
||
|
||
<label class="md-nav__link" for="nav-2-3-1-7">
|
||
Operational Concepts
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Operational Concepts" data-md-level="4">
|
||
<label class="md-nav__title" for="nav-2-3-1-7">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Operational Concepts
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/databases_sql/select_query/" class="md-nav__link">
|
||
Select Query
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/databases_sql/query_performance/" class="md-nav__link">
|
||
Query Performance
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/databases_sql/lab/" class="md-nav__link">
|
||
Lab
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/databases_sql/conclusion/" class="md-nav__link">
|
||
Conclusion
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-2-3-2" type="checkbox" id="nav-2-3-2" >
|
||
|
||
<label class="md-nav__link" for="nav-2-3-2">
|
||
NoSQL
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="NoSQL" data-md-level="3">
|
||
<label class="md-nav__title" for="nav-2-3-2">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
NoSQL
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/databases_nosql/intro/" class="md-nav__link">
|
||
Introduction
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/databases_nosql/key_concepts/" class="md-nav__link">
|
||
Key Concepts
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/databases_nosql/further_reading/" class="md-nav__link">
|
||
Conclusion
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-2-3-3" type="checkbox" id="nav-2-3-3" >
|
||
|
||
<label class="md-nav__link" for="nav-2-3-3">
|
||
Big Data
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Big Data" data-md-level="3">
|
||
<label class="md-nav__title" for="nav-2-3-3">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Big Data
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/big_data/intro/" class="md-nav__link">
|
||
Introduction
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/big_data/evolution/" class="md-nav__link">
|
||
Evolution and Architecture of Hadoop
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/big_data/tasks/" class="md-nav__link">
|
||
Conclusion
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-2-4" type="checkbox" id="nav-2-4" >
|
||
|
||
<label class="md-nav__link" for="nav-2-4">
|
||
Systems Design
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Systems Design" data-md-level="2">
|
||
<label class="md-nav__title" for="nav-2-4">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Systems Design
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/systems_design/intro/" class="md-nav__link">
|
||
Introduction
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/systems_design/scalability/" class="md-nav__link">
|
||
Scalability
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/systems_design/availability/" class="md-nav__link">
|
||
Availability
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/systems_design/fault-tolerance/" class="md-nav__link">
|
||
Fault Tolerance
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/systems_design/conclusion/" class="md-nav__link">
|
||
Conclusion
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-2-5" type="checkbox" id="nav-2-5" >
|
||
|
||
<label class="md-nav__link" for="nav-2-5">
|
||
Metrics and Monitoring
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Metrics and Monitoring" data-md-level="2">
|
||
<label class="md-nav__title" for="nav-2-5">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Metrics and Monitoring
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/metrics_and_monitoring/introduction/" class="md-nav__link">
|
||
Introduction
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/metrics_and_monitoring/command-line_tools/" class="md-nav__link">
|
||
Command-line Tools
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/metrics_and_monitoring/third-party_monitoring/" class="md-nav__link">
|
||
Third-party Monitoring
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/metrics_and_monitoring/alerts/" class="md-nav__link">
|
||
Proactive Monitoring with Alerts
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/metrics_and_monitoring/best_practices/" class="md-nav__link">
|
||
Best Practices for Monitoring
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/metrics_and_monitoring/observability/" class="md-nav__link">
|
||
Observability
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/metrics_and_monitoring/conclusion/" class="md-nav__link">
|
||
Conclusion
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-2-6" type="checkbox" id="nav-2-6" >
|
||
|
||
<label class="md-nav__link" for="nav-2-6">
|
||
Security
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Security" data-md-level="2">
|
||
<label class="md-nav__title" for="nav-2-6">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Security
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/security/intro/" class="md-nav__link">
|
||
Introduction
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/security/fundamentals/" class="md-nav__link">
|
||
Fundamentals of Security
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/security/network_security/" class="md-nav__link">
|
||
Network Security
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/security/threats_attacks_defences/" class="md-nav__link">
|
||
Threat, Attacks & Defences
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/security/writing_secure_code/" class="md-nav__link">
|
||
Writing Secure code
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../level101/security/conclusion/" class="md-nav__link">
|
||
Conclusion
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
|
||
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-3" type="checkbox" id="nav-3" checked>
|
||
|
||
<label class="md-nav__link" for="nav-3">
|
||
Level 102
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Level 102" data-md-level="1">
|
||
<label class="md-nav__title" for="nav-3">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Level 102
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-3-1" type="checkbox" id="nav-3-1" >
|
||
|
||
<label class="md-nav__link" for="nav-3-1">
|
||
Linux Intermediate
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Linux Intermediate" data-md-level="2">
|
||
<label class="md-nav__title" for="nav-3-1">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Linux Intermediate
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../linux_intermediate/introduction/" class="md-nav__link">
|
||
Introduction
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../linux_intermediate/package_management/" class="md-nav__link">
|
||
Package Management
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../linux_intermediate/storage_media/" class="md-nav__link">
|
||
Storage Media
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../linux_intermediate/archiving_backup/" class="md-nav__link">
|
||
Archiving and Backup
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../linux_intermediate/introvim/" class="md-nav__link">
|
||
Introduction to Vim
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../linux_intermediate/bashscripting/" class="md-nav__link">
|
||
Bash Scripting
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../linux_intermediate/conclusion/" class="md-nav__link">
|
||
Conclusion
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
|
||
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-3-2" type="checkbox" id="nav-3-2" checked>
|
||
|
||
<label class="md-nav__link" for="nav-3-2">
|
||
Linux Advanced
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Linux Advanced" data-md-level="2">
|
||
<label class="md-nav__title" for="nav-3-2">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Linux Advanced
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-3-2-1" type="checkbox" id="nav-3-2-1" >
|
||
|
||
<label class="md-nav__link" for="nav-3-2-1">
|
||
Containerization And Orchestration
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Containerization And Orchestration" data-md-level="3">
|
||
<label class="md-nav__title" for="nav-3-2-1">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Containerization And Orchestration
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../containerization_and_orchestration/intro/" class="md-nav__link">
|
||
Introduction
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../containerization_and_orchestration/intro_to_containers/" class="md-nav__link">
|
||
Introduction To Containers
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../containerization_and_orchestration/containerization_with_docker/" class="md-nav__link">
|
||
Containerization With Docker
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../containerization_and_orchestration/orchestration_with_kubernetes/" class="md-nav__link">
|
||
Orchestration With Kubernetes
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../containerization_and_orchestration/conclusion/" class="md-nav__link">
|
||
Conclusion
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
|
||
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-3-2-2" type="checkbox" id="nav-3-2-2" checked>
|
||
|
||
<label class="md-nav__link" for="nav-3-2-2">
|
||
System Calls and Signals
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="System Calls and Signals" data-md-level="3">
|
||
<label class="md-nav__title" for="nav-3-2-2">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
System Calls and Signals
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../intro/" class="md-nav__link">
|
||
Introduction
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../signals/" class="md-nav__link">
|
||
Signals
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--active">
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
|
||
|
||
|
||
<label class="md-nav__link md-nav__link--active" for="__toc">
|
||
System Calls
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
|
||
<a href="./" class="md-nav__link md-nav__link--active">
|
||
System Calls
|
||
</a>
|
||
|
||
|
||
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
|
||
|
||
|
||
|
||
<label class="md-nav__title" for="__toc">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Table of contents
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
<li class="md-nav__item">
|
||
<a href="#introduction" class="md-nav__link">
|
||
Introduction
|
||
</a>
|
||
|
||
</li>
|
||
|
||
<li class="md-nav__item">
|
||
<a href="#types-of-system-calls" class="md-nav__link">
|
||
Types of system calls
|
||
</a>
|
||
|
||
</li>
|
||
|
||
<li class="md-nav__item">
|
||
<a href="#user-mode-kernel-mode-and-their-transitions" class="md-nav__link">
|
||
User mode, kernel mode and their transitions
|
||
</a>
|
||
|
||
</li>
|
||
|
||
<li class="md-nav__item">
|
||
<a href="#working-of-write-system-call" class="md-nav__link">
|
||
Working of write() system call
|
||
</a>
|
||
|
||
</li>
|
||
|
||
<li class="md-nav__item">
|
||
<a href="#debugging-in-linux-with-strace" class="md-nav__link">
|
||
Debugging in Linux with strace
|
||
</a>
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
</nav>
|
||
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../conclusion/" class="md-nav__link">
|
||
Conclusion
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-3-3" type="checkbox" id="nav-3-3" >
|
||
|
||
<label class="md-nav__link" for="nav-3-3">
|
||
Networking
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Networking" data-md-level="2">
|
||
<label class="md-nav__title" for="nav-3-3">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Networking
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../networking/introduction/" class="md-nav__link">
|
||
Introduction
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../networking/security/" class="md-nav__link">
|
||
Security
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../networking/scale/" class="md-nav__link">
|
||
Scale
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../networking/rtt/" class="md-nav__link">
|
||
RTT
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../networking/infrastructure-features/" class="md-nav__link">
|
||
Infrastructure Services
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../networking/conclusion/" class="md-nav__link">
|
||
Conclusion
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-3-4" type="checkbox" id="nav-3-4" >
|
||
|
||
<label class="md-nav__link" for="nav-3-4">
|
||
System Design
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="System Design" data-md-level="2">
|
||
<label class="md-nav__title" for="nav-3-4">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
System Design
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../system_design/intro/" class="md-nav__link">
|
||
Introduction
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../system_design/large-system-design/" class="md-nav__link">
|
||
Large System Design
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../system_design/scaling/" class="md-nav__link">
|
||
Scaling
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../system_design/scaling-beyond-the-datacenter/" class="md-nav__link">
|
||
Scaling Beyond the Data Center
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../system_design/resiliency/" class="md-nav__link">
|
||
Resiliency
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../system_design/conclusion/" class="md-nav__link">
|
||
Conclusion
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-3-5" type="checkbox" id="nav-3-5" >
|
||
|
||
<label class="md-nav__link" for="nav-3-5">
|
||
System Troubleshooting and Performance Improvements
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="System Troubleshooting and Performance Improvements" data-md-level="2">
|
||
<label class="md-nav__title" for="nav-3-5">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
System Troubleshooting and Performance Improvements
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../system_troubleshooting_and_performance/introduction/" class="md-nav__link">
|
||
Introduction
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../system_troubleshooting_and_performance/troubleshooting/" class="md-nav__link">
|
||
Troubleshooting
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../system_troubleshooting_and_performance/important-tools/" class="md-nav__link">
|
||
Important Tools
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../system_troubleshooting_and_performance/performance-improvements/" class="md-nav__link">
|
||
Performance Improvements
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../system_troubleshooting_and_performance/troubleshooting-example/" class="md-nav__link">
|
||
Troubleshooting Example
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../system_troubleshooting_and_performance/conclusion/" class="md-nav__link">
|
||
Conclusion
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-3-6" type="checkbox" id="nav-3-6" >
|
||
|
||
<label class="md-nav__link" for="nav-3-6">
|
||
Continuous Integration and Continuous Delivery
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Continuous Integration and Continuous Delivery" data-md-level="2">
|
||
<label class="md-nav__title" for="nav-3-6">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Continuous Integration and Continuous Delivery
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../continuous_integration_and_continuous_delivery/introduction/" class="md-nav__link">
|
||
Introduction
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../continuous_integration_and_continuous_delivery/introduction_to_cicd/" class="md-nav__link">
|
||
What is CI/CD?
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../continuous_integration_and_continuous_delivery/cicd_brief_history/" class="md-nav__link">
|
||
Brief History
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../continuous_integration_and_continuous_delivery/continuous_integration_build_pipeline/" class="md-nav__link">
|
||
Continuous Integration
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../continuous_integration_and_continuous_delivery/continuous_delivery_release_pipeline/" class="md-nav__link">
|
||
Continuous Delivery and Deployment
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../continuous_integration_and_continuous_delivery/jenkins_cicd_pipeline_hands_on_lab/" class="md-nav__link">
|
||
CI/CD Pipeline - Hands-on
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../continuous_integration_and_continuous_delivery/conclusion/" class="md-nav__link">
|
||
Conclusion
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../CONTRIBUTING/" class="md-nav__link">
|
||
Contribute
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../CODE_OF_CONDUCT/" class="md-nav__link">
|
||
Code of Conduct
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../../sre_community/" class="md-nav__link">
|
||
SRE Community
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
|
||
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc" >
|
||
<div class="md-sidebar__scrollwrap">
|
||
<div class="md-sidebar__inner">
|
||
|
||
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
|
||
|
||
|
||
|
||
<label class="md-nav__title" for="__toc">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Table of contents
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
<li class="md-nav__item">
|
||
<a href="#introduction" class="md-nav__link">
|
||
Introduction
|
||
</a>
|
||
|
||
</li>
|
||
|
||
<li class="md-nav__item">
|
||
<a href="#types-of-system-calls" class="md-nav__link">
|
||
Types of system calls
|
||
</a>
|
||
|
||
</li>
|
||
|
||
<li class="md-nav__item">
|
||
<a href="#user-mode-kernel-mode-and-their-transitions" class="md-nav__link">
|
||
User mode, kernel mode and their transitions
|
||
</a>
|
||
|
||
</li>
|
||
|
||
<li class="md-nav__item">
|
||
<a href="#working-of-write-system-call" class="md-nav__link">
|
||
Working of write() system call
|
||
</a>
|
||
|
||
</li>
|
||
|
||
<li class="md-nav__item">
|
||
<a href="#debugging-in-linux-with-strace" class="md-nav__link">
|
||
Debugging in Linux with strace
|
||
</a>
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
</nav>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div class="md-content">
|
||
<article class="md-content__inner md-typeset">
|
||
|
||
|
||
|
||
<h1>System Calls</h1>
|
||
|
||
<h2 id="introduction">Introduction</h2>
|
||
<p>A system call is a controlled entry point into the kernel, allowing a process to
|
||
request the kernel to perform some action on the process’s behalf. The kernel
|
||
makes a range of services accessible to programs via the system call application
|
||
programming interface (API). Application developers often do not have direct access to the system calls, but can access them through this API. These services include, for example, creating a new process, performing I/O, and creating a pipe for interprocess communication. The set of system calls is fixed. Each system call is identified by a unique number. The list of different system calls can be found <a href="https://man7.org/linux/man-pages/man2/syscall.2.html">here</a>.</p>
|
||
<p>A system call changes the processor state from user mode to kernel mode, so
|
||
that the CPU can access protected kernel memory. Each system call may have a set of arguments that specify information to be transferred from user space (i.e., the process’s virtual address space) to kernel space and vice versa. From a programming point of view, invoking a system call looks much like calling a C function.</p>
|
||
<h2 id="types-of-system-calls">Types of system calls</h2>
|
||
<p>There are mainly 5 types of different system calls. They are :</p>
|
||
<ul>
|
||
<li>Process Control: These system calls are used to handle tasks related to a process such as process creation, termination,etc.</li>
|
||
<li>File Management: These system calls are used for operations on files such as reading/writing a file.</li>
|
||
<li>Device Management: These system calls are used to deal with devices such as reading/writing into device buffers.</li>
|
||
<li>Information Maintenance: These system calls handle information and its transfer between the operating system and the user program.</li>
|
||
<li>Communication: These system calls are useful for inter-process communication. They are also used for creating and deleting a communication connection.</li>
|
||
</ul>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th style="text-align: left;">Types Of System Calls</th>
|
||
<th style="text-align: right;">Examples in Linux</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td style="text-align: left;">Process Control</td>
|
||
<td style="text-align: right;">fork(),exit(),wait()</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align: left;">File Management</td>
|
||
<td style="text-align: right;">open(), read(),write()</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align: left;">Device Management</td>
|
||
<td style="text-align: right;">ioctl(),read(),write()</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align: left;">Information Maintenance</td>
|
||
<td style="text-align: right;">getpid(),alarm(),sleep()</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align: left;">Communication</td>
|
||
<td style="text-align: right;">pipe(),shmget(),mmap()</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<h2 id="user-mode-kernel-mode-and-their-transitions">User mode, kernel mode and their transitions</h2>
|
||
<p>Modern processor architectures typically allow the CPU to operate in at least two
|
||
different modes: user mode and kernel mode . Correspondingly, areas of virtual memory can be marked as being part of user space or kernel space. When running in user mode, the CPU can access only memory that is marked as being in user space; attempts to access memory in kernel space result in a hardware exception.</p>
|
||
<p>At any given time, a process may be executing in either user mode or kernel mode. The type of instructions that can be executed depends on the mode and this is enforced at the hardware level. CPU modes (also called processor modes, CPU states, CPU privilege levels) are operating modes for the central processing unit of some computer architectures that place restrictions on the type and scope of operations that can be performed by certain processes being run by the CPU. The kernel itself is not a process but a process manager. The kernel model assumes that processes that require a kernel service use specific programming constructs called system calls.</p>
|
||
<p>When a program is executed in user mode, it cannot directly access the kernel data structures or the kernel programs. When an application executes in kernel mode, however, these restrictions no longer apply. A program usually executes in user mode and switches to kernel mode only when requesting a service provided by the kernel. If an application needs access to hardware resources on the system(like peripherals,memory,disks), it must issue a system call, which causes a context switch from user mode to kernel mode. This procedure is followed when reading/writing from/to files, etc. It is only the system call itself which runs in kernel mode, not the application code. When the system call is complete, the process returns to the user mode with the return value using an inverse context switch. Apart from system calls, kernel routines can be activated in the below ways as well:</p>
|
||
<ul>
|
||
<li>The CPU executing the process signals an exception , which is an unusual condition such as an invalid instruction. The kernel handles the exception on behalf of the process that caused it.</li>
|
||
<li>A peripheral device issues an interrupt signal to the CPU to notify it of an event such as a request for attention, a status change, or the completion of an I/O operation. Each interrupt signal is dealt by a kernel program called an interrupt handler . Since peripheral devices operate asynchronously with respect to the CPU, interrupts occur at unpredictable times.</li>
|
||
<li>A kernel thread is executed. Since it runs in kernel Mode, the corresponding program must be considered part of the kernel.</li>
|
||
</ul>
|
||
<p><img alt=" " src="../images/Transition_between_User_and_Kernel_Mode.png" /></p>
|
||
<p>In the above diagram, Process 1 in User Mode issues a system call, after which the process switches to Kernel Mode and the system call is serviced. Process 1 then resumes execution in User Mode until a timer interrupt occurs and the scheduler is activated in Kernel Mode. A process switch takes place and Process 2 starts its execution in User Mode until a hardware device raises an interrupt. As a consequence of the interrupt, Process 2 switches to Kernel Mode and services the interrupt.</p>
|
||
<h2 id="working-of-write-system-call">Working of <em>write()</em> system call</h2>
|
||
<p>The <em>write()</em> system call writes data to an open file.</p>
|
||
<pre><code># include <unistd.h>
|
||
|
||
ssize_t write(int fd, void *buffer, size_t count);
|
||
</code></pre>
|
||
<p><em>buffer</em> is the address of the data to be written; <em>count</em> is the number of bytes to write from buffer; and <em>fd</em> is a file descriptor referring to the file to which data is to be written.</p>
|
||
<p><em>write()</em> call writes up to <em>count</em> bytes from buffer to the open file referred to by <em>fd</em>. On success, <em>write()</em> call returns the number of bytes actually written, which may be less than <em>count</em> and returns -1 on error. When performing I/O on a disk file, a successful return from <em>write()</em> doesn’t guarantee that the data has been transferred to disk, because the kernel performs buffering of disk I/O in order to reduce disk activity and expedite <em>write()</em> calls. It simply copies data between a user-space buffer and a buffer in the kernel buffer cache. At some later point, the kernel writes (flushes) its buffer to the disk.</p>
|
||
<p>If, in the interim, another process attempts to read these bytes of the file, then the kernel automatically supplies the data from the buffer cache, rather than from (the outdated contents of) the file. The aim of this design is to allow <em>write()</em> to be fast, since they don’t need to wait on a (slow) disk operation. This design is also efficient, since it reduces the number of disk transfers that the kernel must perform.</p>
|
||
<h2 id="debugging-in-linux-with-strace">Debugging in Linux with strace</h2>
|
||
<p><em>strace</em> is a tool used to trace the transition between user processes and the Linux kernel. Inorder to use the tool, we need ensure that it is installed in the system by running the command:</p>
|
||
<pre><code>$ rpm -qa | grep -i strace
|
||
|
||
strace-4.12-9.el7.x86_64
|
||
</code></pre>
|
||
<p>If the above command does not give any output, you can install the tool via:</p>
|
||
<p><code>$ yum install strace</code></p>
|
||
<p>The functions which are a part of standard C library are known as library functions. The purposes of these functions are very diverse, including such tasks as opening a file, converting a time to a human-readable format, and comparing two character strings. Some library functions are layered on top of system calls. Often, library functions are designed to provide a more caller-friendly interface than the underlying system call. For example, the <em>printf()</em> function provides output formatting and data buffering, whereas the <em>write()</em> system call just outputs a block of bytes.The most commonly used implementation of the standard C library on Linux is the GNU C library <a href="http://www.gnu.org/software/libc/">glibc</a>.</p>
|
||
<p>The C programming language gives <em>printf()</em> that lets the user write data in many different formats. So printf() as a function converts your data into a formatted sequence of bytes and that calls <em>write()</em> to write those bytes onto the output. Let us examine what happens when a <em>printf()</em> statement is executed with the use of <em>strace</em> command : <code>strace printf %s “Hello world”</code></p>
|
||
<pre><code> ~]$ strace printf %s "Hello world"
|
||
execve("/usr/bin/printf", ["printf", "%s", "Hello world"], [/* 47 vars */]) = 0
|
||
brk(NULL) = 0x90d000
|
||
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f8fc672f000
|
||
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
|
||
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
|
||
fstat(3, {st_mode=S_IFREG|0644, st_size=98854, ...}) = 0
|
||
mmap(NULL, 98854, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f8fc6716000
|
||
close(3) = 0
|
||
open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
|
||
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20&\2\0\0\0\0\0"..., 832) = 832
|
||
fstat(3, {st_mode=S_IFREG|0755, st_size=2156160, ...}) = 0
|
||
mmap(NULL, 3985888, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f8fc6141000
|
||
mprotect(0x7f8fc6304000, 2097152, PROT_NONE) = 0
|
||
mmap(0x7f8fc6504000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c3000) = 0x7f8fc6504000
|
||
mmap(0x7f8fc650a000, 16864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f8fc650a000
|
||
close(3) = 0
|
||
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f8fc6715000
|
||
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f8fc6713000
|
||
arch_prctl(ARCH_SET_FS, 0x7f8fc6713740) = 0
|
||
mprotect(0x7f8fc6504000, 16384, PROT_READ) = 0
|
||
mprotect(0x60a000, 4096, PROT_READ) = 0
|
||
mprotect(0x7f8fc6730000, 4096, PROT_READ) = 0
|
||
munmap(0x7f8fc6716000, 98854) = 0
|
||
brk(NULL) = 0x90d000
|
||
brk(0x92e000) = 0x92e000
|
||
brk(NULL) = 0x92e000
|
||
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
|
||
fstat(3, {st_mode=S_IFREG|0644, st_size=106075056, ...}) = 0
|
||
mmap(NULL, 106075056, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f8fbfc17000
|
||
close(3) = 0
|
||
open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
|
||
fstat(3, {st_mode=S_IFREG|0644, st_size=2502, ...}) = 0
|
||
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f8fc672e000
|
||
read(3, "# Locale name alias data base.\n#"..., 4096) = 2502
|
||
read(3, "", 4096) = 0
|
||
close(3) = 0
|
||
munmap(0x7f8fc672e000, 4096) = 0
|
||
open("/usr/lib/locale/UTF-8/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
|
||
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0
|
||
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f8fc672e000
|
||
write(1, "Hello world", 11Hello world) = 11
|
||
close(1) = 0
|
||
munmap(0x7f8fc672e000, 4096) = 0
|
||
close(2) = 0
|
||
exit_group(0) = ?
|
||
+++ exited with 0 +++
|
||
</code></pre>
|
||
<blockquote>
|
||
<p>execve("/usr/bin/printf", ["printf", "%s", "Hello world"], [/<em> 47 vars </em>/]) = 0</p>
|
||
</blockquote>
|
||
<p>The first system call made is <em>execve()</em> and does three things:</p>
|
||
<ul>
|
||
<li>The operating system (OS) stops the duplicated process (of the parent).</li>
|
||
<li>OS loads up the new program (in this case: <em>printf()</em>), and starts the new program. </li>
|
||
<li><em>execve()</em> replaces defining parts of the current process's memory stack with the new stuff loaded from the <em>printf</em> executable file.</li>
|
||
</ul>
|
||
<p>The first word of the line, execve, is the name of the system call being executed. The first parameter must be the path of a binary executable or a script. The second is an array of argument strings passed to the new program. By convention, the first of these strings should contain the filename associated with the file being executed. The third parameter must be an environment variable. The number after the = sign (which is 0 in this case) is a value returned by the execve system call which indicates that the call was successful. </p>
|
||
<blockquote>
|
||
<p>open("/usr/lib/locale/UTF-8/LC_CTYPE", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)</p>
|
||
</blockquote>
|
||
<p>In this line, the program tried to <em>open()</em> file <em>/usr/lib/locale/UTF-8/LC_CTYPE</em>. However the system call failed (with -1 status) with the descriptive error message <em>No such file or directory</em>, as the file wasn’t found (ENOENT).</p>
|
||
<blockquote>
|
||
<p>brk(NULL) = 0x90d000</p>
|
||
<p>brk(0x92e000) = 0x92e000</p>
|
||
<p>brk(NULL) = 0x92e000</p>
|
||
</blockquote>
|
||
<p>The system call <em>brk()</em> is used to increase or decrease the process’s data segment. It returns the new address where the data segment of the process is to end.</p>
|
||
<blockquote>
|
||
<p>open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3</p>
|
||
<p>read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20&\2\0\0\0\0\0"..., 832) = 832</p>
|
||
</blockquote>
|
||
<p>In the above lines of the console output, we see that a successful <em>open()</em> call is made, followed by <em>read()</em> system call.</p>
|
||
<p>In <em>open()</em>, the first parameter is the path to file which you want to use and the second parameter defines the permissions. In this example, O_RDONLY which means the file is read only and <a href="https://man7.org/linux/man-pages/man2/open.2.html">O_CLOEXEC</a> which enables the close-on-exec flag for the opened file. This is useful to avoid race conditions in multithreaded programs where one thread opens a file descriptor at the same time as another thread. 3 indicates the file descriptor used to open the file. Since fd 0, 1, 2 are already taken by stdin, stdout and stderr. So first unused file descriptor is 3 in file descriptor table.</p>
|
||
<p>If <em>open()</em> </p>
|
||
<p>In <em>read()</em>, the first parameter is the file descriptor which is 3(the file was opened using this file descriptor by <em>open()</em>. The second parameter is the buffer to read data from and the third parameter is the length of the buffer. The return value is 832 which is the number of bytes read.</p>
|
||
<blockquote>
|
||
<p>close(3) = 0</p>
|
||
</blockquote>
|
||
<p>A close system call is used to close a file descriptor by the kernel. For most file systems, a program terminates access to a file in a filesystem using the close system call. 0 after the = sign indicates that the system call was successful.</p>
|
||
<blockquote>
|
||
<p>write(1, "Hello world", 11Hello world) = 11</p>
|
||
</blockquote>
|
||
<p>In the previous section, we described the <em>write()</em> system call and the arguments that it takes. Whenever we see any output to the video screen, it’s from the file named /dev/tty and written to stdout on screen through fd 1. The first parameter is the file descriptor , second parameter is the buffer containing the information to be written and the last parameter contains the count of characters. On success, the number of bytes written are returned (zero indicates nothing was written) which is 11 in this example.</p>
|
||
<blockquote>
|
||
<p>+++ exited with 0 +++</p>
|
||
</blockquote>
|
||
<p>This indicates that the program exited successfully with exit code 0. An exit code of 0 generally indicates successful execution and termination in Linux programs.</p>
|
||
<p>You don't need to memorize all the system calls or what they do, because you can refer to documentation when you need to. Ensure the following package is installed before running the man command:</p>
|
||
<pre><code>$ rpm -qa | grep -i man-pages
|
||
|
||
man-pages-3.53-5.el7.noarch
|
||
</code></pre>
|
||
<p>Run the following <code>man</code> command with the system call name to see the documentation for that system call(for eg, execve):</p>
|
||
<p><code>man 2 execve</code></p>
|
||
<p>Apart from system calls, strace can be used to detect the files that are being accessed by the program. In the above trace, we have a system call <em>open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3</em> which is opening the libc shared object /lib64/libc.so.6 which is the C implementation of various standard functions. It is the file where we see the <em>printf()</em> definition needed for printing <em>Hello World</em>.</p>
|
||
<p>Strace can also be used to check if a program is hanging or stuck. When we have the trace, we can observe at which operation the program is stuck as well. Furthermore, as we go through the trace, we can also find errors(if there are any) to point out why the program is hung/stuck. Strace can be very helpful in finding the reason behind slow performance of a program.</p>
|
||
<p>Alhough <em>strace</em> has the aforementioned uses to it, if you're running a trace in a production environment, strace is not a good choice.
|
||
It introduces a substantial amount of overhead. According to a performance test conducted by Arnaldo Carvalho de Melo, a senior software engineer at Red Hat, the process traced using strace ran 173 times slower, which can be disastrous for a production environment.</p>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</article>
|
||
</div>
|
||
</div>
|
||
</main>
|
||
|
||
|
||
<footer class="md-footer">
|
||
|
||
<div class="md-footer-nav">
|
||
<nav class="md-footer-nav__inner md-grid" aria-label="Footer">
|
||
|
||
<a href="../signals/" class="md-footer-nav__link md-footer-nav__link--prev" rel="prev">
|
||
<div class="md-footer-nav__button md-icon">
|
||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
|
||
</div>
|
||
<div class="md-footer-nav__title">
|
||
<div class="md-ellipsis">
|
||
<span class="md-footer-nav__direction">
|
||
Previous
|
||
</span>
|
||
Signals
|
||
</div>
|
||
</div>
|
||
</a>
|
||
|
||
|
||
<a href="../conclusion/" class="md-footer-nav__link md-footer-nav__link--next" rel="next">
|
||
<div class="md-footer-nav__title">
|
||
<div class="md-ellipsis">
|
||
<span class="md-footer-nav__direction">
|
||
Next
|
||
</span>
|
||
Conclusion
|
||
</div>
|
||
</div>
|
||
<div class="md-footer-nav__button md-icon">
|
||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z"/></svg>
|
||
</div>
|
||
</a>
|
||
|
||
</nav>
|
||
</div>
|
||
|
||
<div class="md-footer-meta md-typeset">
|
||
<div class="md-footer-meta__inner md-grid">
|
||
<div class="md-footer-copyright">
|
||
|
||
<div class="md-footer-copyright__highlight">
|
||
Copyright 2020 LinkedIn Corporation. All Rights Reserved. Licensed under the Creative Commons Attribution 4.0 International Public License
|
||
</div>
|
||
|
||
Made with
|
||
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
|
||
Material for MkDocs
|
||
</a>
|
||
</div>
|
||
|
||
<div class="md-footer-social">
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<a href="https://github.com/linkedin/school-of-sre" target="_blank" rel="noopener" title="github.com" class="md-footer-social__link">
|
||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"/></svg>
|
||
</a>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
</footer>
|
||
|
||
</div>
|
||
|
||
<script src="../../../assets/javascripts/vendor.18f0862e.min.js"></script>
|
||
<script src="../../../assets/javascripts/bundle.994580cf.min.js"></script><script id="__lang" type="application/json">{"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.term.missing": "Missing"}</script>
|
||
|
||
<script>
|
||
app = initialize({
|
||
base: "../../..",
|
||
features: [],
|
||
search: Object.assign({
|
||
worker: "../../../assets/javascripts/worker/search.9c0e82ba.min.js"
|
||
}, typeof search !== "undefined" && search)
|
||
})
|
||
</script>
|
||
|
||
|
||
</body>
|
||
</html> |