-
Notifications
You must be signed in to change notification settings - Fork 0
/
about-fork.html
54 lines (51 loc) · 3.09 KB
/
about-fork.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html>
<head>
<meta name = "viewport" content = "with=device-width, inital-scale=1.0">
<title> Build in HTML</title>
<link rel="stylesheet" href="styles.css" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@100;400&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<meta charset="UTF-8" />
</head>
<body>
<section class = "sub-header">
<nav>
<a href="index.html"><img src="images/logo.png"></a>
<div class = "nav-links" id="navLinks">
<i class="fa fa-times-circle" onclick="hideMenu()"></i>
<ul>
<li><a href="about-fork.html">About fork() in C</a></li>
<li><a href="examples.html"> Animated Examples</a></li>
<li><a href="resources.html">More Resources</a></li>
</ul>
</div>
<i class="fa fa-bars" onclick="showMenu()"></i>
</nav>
<h1>About fork()</h1>
</section>
<!---about us content-->
<section class="about-fork">
<div class="row">
<div class="row">
<div class="about-col">
<h1><strong> pid_t fork(void);</strong></h1>
<p>"The fork() system call creates a new process by duplicating the calling process. The new process is referred to as the child process and the calling process is referred to as the parent process. The child process and the parent process run in separate memory spaces. At the time of fork() both memory spaces have the same content” <a href="https://man7.org/linux/man-pages/man2/fork.2.html">(Linux Manual Page)</a></p>
<p>Let’s dissect fork()'s function declaration:<br>pid_t is a data type (a signed 32 bit integer) that represents a process ID, usually referred to as a "PID". Every process has a unique PID, therefore, the parent and child processes each have their own unique PIDs. When called within the parent process, fork() returns the PID of the child process on success and when called within the child process, fork() returns 0 on success. On failure, -1 is returned in the parent, no child process is created, and errno is set to indicate the error.</p>
</div>
<div class="about-col">
<img src="images/fork-diagram.png">
</div>
</div>
</div>
</section>
<!---footer-->
<section class = "footer">
<p><em>made with <i class="fa fa-heart-o"></i> by a former cs3157 student</em></p>
</section>
<!--- javaScript for Toggle Menu --->
<script type="text/javascript" src="js/show-hide.js"></script>
</body>
</html>