0% found this document useful (0 votes)
18 views

Fall 2024 - CS604 - 1

Uploaded by

sabahanatasha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Fall 2024 - CS604 - 1

Uploaded by

sabahanatasha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Operating Systems (CS604) Total marks = 20

Assignment # 01 Deadline
November 19,
Fall 2024 2024

Please carefully read the following instructions before attempting the assignment.

RULES FOR MARKING


It should be clear that your assignment would not get any credit if:
• The assignment is submitted after the due date.
• The submitted assignment does not open, or the file is corrupted.
• Strict action will be taken if the submitted solution is copied from any other student or
the internet.

You should consult the recommended books to clarify your concepts, as handouts are insufficient.
You are supposed to submit your assignment in Doc or Docx format.
Any other formats like scanned images, PDF, ZIP, RAR, PPT, BMP, etc. will not be accepted.

Topic Covered:
This assignment covers theoretical understanding, practical implementation, and critical analysis
of the PROCESS FORKIG, Child process and

Topic Covered
Lecture 1 to Lecture 12

NOTE

No assignment will be accepted via email after the due date (whether it is load shedding, internet
malfunctioning, etc.). Hence, refrain from uploading assignments within the last hour of the deadline. It is
recommended that the solution be uploaded at least two days before its closing date.

If you find any mistakes or confusion in the assignment (Question statement), please consult your
instructor before the deadline. After the deadline, no queries will be entertained in this regard.

For any query, feel free to email meat:


cs604@vu.edu.pk
Question Statement 20 marks

Question:
Execute the following program in GCC and find out what value of the Parent will be printed at Line A?

You are required to comment each line of the code as well as explain the program code also.

#include < sys/types.h >


#include < stdio.h> >
#include < unistd.h>
int value = 5;

int main()

pid_tpid;

pid = fork();

if (pid == 0)

{ /* child process */

value += 15; }

else if (pid > 0)

{ /* parent process */

wait (NULL) ;

printf("PARENT: value"" %d",value); /* LINE A */

exit (0) ;
}
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy