• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 1 out of 3 pages
Exam (elaborations)

CMSC 421 Exam 1(Correctly solved)

Document preview thumbnail
Preview 1 out of 3 pages

What is the name of our instructor? correct answers Gerald Tompkins What is the email of our instructor? correct answers What does the fork system call do? correct answers The operating system will create a new process that contains the same code/data as the parent process. The state is copied, including open files, register state and all memory allocations, which include the program code. Has a new program ID What does the exec system call do? correct answers Used when the process is not part of the same program as parent process. This is the case in the shell; when a user starts the command, it needs to run in a new process, but it is unrelated to the shell. Called after a fork. The exec replaces forked process with the new process. Since it replaces forked process, it has the same PID as the old process. How does fork and exec work together? correct answers While they have two different purposes, they work together. The fork() system call creates an exact copy of a program while the exec() system call replaces an instance of a program. So, if you want to have another program run at the same time, you can fork a current process to create a new instance, and then exec() in that fork to get a different program to run. This allows two things to run at the same time even if you only explicitly ran one thing. What is a system call in C programming? correct answers A system call is a programming interface to the services provided by the OS kernel. Mostly accessed by programs in a high-level API. What is a stack? correct answers LIFO Structure, Used for temporary data, function arguments, local variables, and return addresses. Automatically allocated and deallocated upon function entry/exit. What is a heap? correct answers Dynamically allocated blocks. Used for dynamically allocated data with unknown size beforehand. What is a text? correct answers Read-only segment containing the program's executable code. Fixed size set during program compilation/linking. Not managed during runtime, cannot be modified. What is "data"? correct answers Contains global and static variables initialized before program execution. Fixed size set during program compilation/linking. Initialized values can be modified during runtime.


Document information

Uploaded on
May 23, 2024
Number of pages
3
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers
$11.29

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Sold
23
Followers
6
Items
4026
Last sold
1 month ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions

Whoops! We can’t load your doc right now. Try again or contact support.