This document discusses fundamentals of low-level I/O and process creation in Unix systems. It covers:
1) Low-level I/O using system calls for opening, reading, writing and moving within files using file descriptors.
2) Program creation and execution using the exec family of system calls to launch new programs and fork() to create new processes from the parent process.
3) Process termination and waiting for child processes to finish using system calls.
Learn python in easy steps. This presentation will cover followings
1. Python basics
2. How to write a python code
3. Variable usage & their syntax
4. Strings handling
5. Files handling
6. How to use loops and others.
7. Python Vs C language.
Functions, Exception, Modules and Files
Functions: Difference between a Function and a Method, Defining a Function, Calling a Function, Returning Results from a Function, Returning Multiple Values from a Function, Functions are First Class Objects, Pass by Object Reference, Formal and Actual Arguments, Positional Arguments, Keyword Arguments, Default Arguments, Variable Length Arguments, Local and Global Variables, The Global Keyword, Passing a Group of Elements to a Function, Recursive Functions, Anonymous Functions or Lambdas (Using Lambdas with filter() Function, Using Lambdas with map() Function, Using Lambdas with reduce() Function), Function Decorators, Generators, Structured Programming, Creating our Own Modules in Python, The Special Variable __name__
Exceptions: Errors in a Python Program (Compile-Time Errors, Runtime Errors, Logical Errors),Exceptions, Exception Handling, Types of Exceptions, The Except Block, The assert Statement, UserDefined Exceptions, Logging the Exceptions
20%
Files: Files, Types of Files in Python, Opening a File, Closing a File, Working with Text Files Containing Strings, Knowing Whether a File Exists or Not, Working with Binary Files, The with Statement, Pickle in Python, The seek() and tell() Methods, Random Accessing of Binary Files, Random Accessing of Binary Files using mmap, Zipping and Unzipping Files, Working with Directories, Running Other Programs from Python Program
This Presentation is a draft of a summary of "Learn Python The Hard Way" Book which is very helpful for anyone want to learn python from scratch of
For reading the book and do exercises, the book is available for free here: http://learnpythonthehardway.org/book/
Learn python in easy steps. This presentation will cover followings
1. Python basics
2. How to write a python code
3. Variable usage & their syntax
4. Strings handling
5. Files handling
6. How to use loops and others.
7. Python Vs C language.
Functions, Exception, Modules and Files
Functions: Difference between a Function and a Method, Defining a Function, Calling a Function, Returning Results from a Function, Returning Multiple Values from a Function, Functions are First Class Objects, Pass by Object Reference, Formal and Actual Arguments, Positional Arguments, Keyword Arguments, Default Arguments, Variable Length Arguments, Local and Global Variables, The Global Keyword, Passing a Group of Elements to a Function, Recursive Functions, Anonymous Functions or Lambdas (Using Lambdas with filter() Function, Using Lambdas with map() Function, Using Lambdas with reduce() Function), Function Decorators, Generators, Structured Programming, Creating our Own Modules in Python, The Special Variable __name__
Exceptions: Errors in a Python Program (Compile-Time Errors, Runtime Errors, Logical Errors),Exceptions, Exception Handling, Types of Exceptions, The Except Block, The assert Statement, UserDefined Exceptions, Logging the Exceptions
20%
Files: Files, Types of Files in Python, Opening a File, Closing a File, Working with Text Files Containing Strings, Knowing Whether a File Exists or Not, Working with Binary Files, The with Statement, Pickle in Python, The seek() and tell() Methods, Random Accessing of Binary Files, Random Accessing of Binary Files using mmap, Zipping and Unzipping Files, Working with Directories, Running Other Programs from Python Program
This Presentation is a draft of a summary of "Learn Python The Hard Way" Book which is very helpful for anyone want to learn python from scratch of
For reading the book and do exercises, the book is available for free here: http://learnpythonthehardway.org/book/
** Python Certification Training: https://www.edureka.co/python **
This Edureka PPT on File Handling with Python covers all the important aspects of using files in Python right from the introduction to what fields are, all the way till checking out the major aspects of working with files and using the code-first approach to understand them better.
Python Tutorial Playlist: https://goo.gl/WsBpKe
Blog Series: http://bit.ly/2sqmP4s
Follow us to never miss an update in the future.
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Python Session - 2
Install Python
Run Python
Python Keyword
Python Identifiers
Python Variables
Python Literals
Python Comments
By default Python installed on following path in Windows
C:\Users\user\AppData\Local\Programs\Python\Python37
Removing the MAX_PATH Limitation :
Windows historically has limited path lengths to 260 characters. This meant that paths longer than this would not resolve and errors would result.
In the latest versions of Windows, this limitation can be expanded to approximately 32,000 characters. Your administrator will need to activate the “Enable Win32 long paths” group policy, or set the registry value HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem@LongPathsEnabled to 1.
Introduction to Python Pandas for Data AnalyticsPhoenix
Pandas is an open-source, BSD-licensed Python library providing high-performance, easy-to-use data structures and data analysis tools for the Python programming language. Python with Pandas is used in a wide range of fields including academic and commercial domains including finance, economics, Statistics, analytics, medical...
** Python Certification Training: https://www.edureka.co/python **
This Edureka PPT on File Handling with Python covers all the important aspects of using files in Python right from the introduction to what fields are, all the way till checking out the major aspects of working with files and using the code-first approach to understand them better.
Python Tutorial Playlist: https://goo.gl/WsBpKe
Blog Series: http://bit.ly/2sqmP4s
Follow us to never miss an update in the future.
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Python Session - 2
Install Python
Run Python
Python Keyword
Python Identifiers
Python Variables
Python Literals
Python Comments
By default Python installed on following path in Windows
C:\Users\user\AppData\Local\Programs\Python\Python37
Removing the MAX_PATH Limitation :
Windows historically has limited path lengths to 260 characters. This meant that paths longer than this would not resolve and errors would result.
In the latest versions of Windows, this limitation can be expanded to approximately 32,000 characters. Your administrator will need to activate the “Enable Win32 long paths” group policy, or set the registry value HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem@LongPathsEnabled to 1.
Introduction to Python Pandas for Data AnalyticsPhoenix
Pandas is an open-source, BSD-licensed Python library providing high-performance, easy-to-use data structures and data analysis tools for the Python programming language. Python with Pandas is used in a wide range of fields including academic and commercial domains including finance, economics, Statistics, analytics, medical...
Wherever there is a need to handle large volumes of data, it is advantageous to store data on the disks and read whenever necessary. This method employs the concept of files to store data. A file is a place on disk where a group of related data is stored.file handling c programming tutorial
Text Input / Output: Files, Streams, Standard Library Input / Output Functions, Formatting Input / Output Functions, Character Input / Output Functions, Binary Input / Output: Text versus Binary Streams, Standard Library, Functions for Files, Converting File Type
These questions will be a bit advanced level 2sadhana312471
These questions will be a bit advanced(Intermediate) in terms of Python interview.
This is the continuity of Nail the Python Interview Questions.
The fields that these questions will help you in are:
• Python Developer
• Data Analyst
• Research Analyst
• Data Scientist
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
Acetabularia Information For Class 9 .docxvaibhavrinwa19
Acetabularia acetabulum is a single-celled green alga that in its vegetative state is morphologically differentiated into a basal rhizoid and an axially elongated stalk, which bears whorls of branching hairs. The single diploid nucleus resides in the rhizoid.
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
2. Fundamentals
Low-level I/O (read/write using system calls)
Opening/Creating files
Reading & Writing files
Moving around in files
file descriptors
Program Creation and Execution
exec family of system calls
using fork() to create processes
exiting processes
process termination
3. Low-level I/O
Unix System Calls can be used to:
Open/Create Files
Read & Write files
Move around in files
System calls work with file descriptors
A file descriptor is an int that represents a file/device
File descriptors are allocated by the system
Limited number of file descriptors available
0 is stdin, 1 is stdout, 2 is stderr; these are automatically allocated
and opened when a program begins
4. Opening/Creating Files
open(<file/device name>,<how to open>[,<mode>])
<file/device name> is a C-string, exactly as in the C++ fstream member
function open()
<how to open> is an int, usually specified with a constant defined in
fcntl.h. The values may be combined using a logical OR ( | ), allowing
every possible way of opening a file (examples on next slide)
Detail on this appears on the next slide
<mode> is an optional third argument that is specified only if the file is
created. It is a three digit octal number representing the permissions to be
set on the file.
a file descriptor (of type int) is returned on success; otherwise –1 is
returned.
5. Specifying How a File is to be Opened
File Access
You must specify how the file is to be accessed. Exactly one of these
values must appear in the 2nd argument of open():
O_RDONLY
The file is opened for reading only. If the file doesn’t exist, and the create
option (next slide) isn’t specified, open() will fail (note that it is not
ordinary to open a file to be read with the create option specified)
O_WRONLY
The file is to be opened for writing only. If the file doesn’t exist, and the
create option is not specified, or if the file does exist, and the create option
is specified along with the fail if file exists option, open() will fail.
O_RDWR
The file is opened for full access. Errors specified above can occur,
however.
If none of these are specified, open() can succeed, but nothing can be
done to the file. (See open2.c in the demo directory)
6. Specifying How a File is to be Opened
File Opening Options
The following are used to further specify how a file is opened. They are
combined with the access and possibly each other:
O_APPEND
all access is at end of file
O_CREAT
create file if it doesn’t exist (does not cause failure if file exists).
Use a third argument to specify mode.
O_TRUNC
Destroy the existing contents of the file, if it exists.
O_EXCL
When combined with O_CREAT, causes open() to fail if the file
already exists.
7. Specifying How a File is to be Opened
Exercises/Examples
Open a file named abc.txt for writing, only if it exists. If it does, the
present contents should be preserved, and writing should occur after the
present contents.
Give an open() command equivalent to the C++ command
Dest.open(“abc.txt”), where Dest is an ofstream
Give an open command that opens a file abc.txt for writing only if it
doesn’t already exist.
Give command(s), to open a file abc.txt for writing. If abc.txt exists, the
user should be prompted, and then the file opened for writing only if the
user answers affirmatively to a prompt to overwrite the file. Otherwise,
the file is created.
Repeat the previous exercise, using C++
8. Low-level Reading and Writing
Using low-level (system) calls, I/O can only be accomplished via a buffer,
whose size is determined by the user.
small buffer requires more device accesses, slowing program; some
systems override with their own buffer
Commands:
read(<file descriptor>,<address of buffer>,<# bytes to read>)
write(<file descriptor>,<address of buffer>,<# bytes to read>)
value returned is # bytes read; 0 => eof (read only), -1 => error
9. Moving Around in A File
Low-level access via File Descriptor
lseek(<file descriptor>,<amount>,<relativity>)
where
<file descriptor> is a file descriptor of an open file
<amount> is the number of bytes to move the file descriptor...
<relativity> is the point from which the operation takes place
SEEK_SET (0) is start of file
SEEK_CUR (1) is current position
SEEK_END (2) is end of file
if <amount> is positive with this option, there will be a hole in the file.
the return value is the new offset in the file
10. Exercises
Give an lseek() command to find the present offset in a file
How is the present offset in a file found when the file is
accessed via a file pointer?
Give a loop to write the values 1-100 in the same spot of a
text file.
Why is the seek command basically worthless in a text file,
except to go to the beginning or end of the file?
11. Program Creation and Execution
exec family of system calls
using fork() to create processes
process termination
waiting for processes
12. exec Family of System Calls
Execute a program using one of the exec calls
Six exec functions
Can provide a list and have function build argv[] vector or provide the
vector itself
Can specify path to program or use path variable to find it
Can use present environment, or specify new environment
environment defined by setenv items. Type set at Unix prompt to see
environment
called program occupies environment of caller (takes its pid, as new
process isn’t created). Only replaces text, data, heap, and stack segments
of caller of exec
execs are the only function calls that don’t return
13. execl & execv
execl
give pathname to file (incl. name) as 1st argument
Follow with list of command line arguments; executable 1st
this list is used to build the argv vector passed to the called program
executable name is in argv[0]
last argument must be null char *
execv
give pathname to file (incl. name) as 1st argument
Follow with null-terminated argv vector
14. execlp & execvp
execlp
give filename as 1st argument; path environment variable is
used to find executable
Follow with list of command line arguments; executable 1st
this list is used to build the argv vector passed to the called program
last argument must be null char *
execvp
give filename as 1st argument; path used
Follow with null-terminated argv vector
15. Exercise
Suppose a program X is executed whose
purpose is to call another program Y whose
name and command-line arguments are
passed in to X as command-line arguments.
1. Write an execlp and an execvp command,
as they would appear in X, to execute Y.
2. What problem could arise if we choose to
use execl or execv?
16. Process Creation
fork & vfork
Processes can only be created using a fork
command
fork is called once, but returns twice
parent calls fork, value is returned to each of parent and
child
created process is called the child
existing process is the parent
Process identifier (pid) is used to distinguish
between parent and child
Every process has a unique pid in the system
17. fork
Called once, returns twice; return type is pid_t, unsigned int type for
pids
Parent receives child’s pid as return value of fork
child receives 0 as return value from fork
Order of execution depends on scheduling algorithm of system.
Order can be controlled; important if there is dependence between parent and
child
Child and parent execute in their own environments
Child gets copy of parent’s environment (including data space) as it is at
time of fork
If parent has file open, child gets copy of file pointers or descriptors
If parent’s stdout (cout) is redirected before fork, child output to stdout is also
redirected
18. Child Process’ Inheritance
user id, group id
controlling terminal
current working directory
root directory
file mode creation mask
signal mask (later) and dispositions
close-on-exec flag for open file descriptors
environment
attached shared memory segments
resource limits
19. Items That Distinguish
Parent From Child
Return value from fork
unique pid
different parent pid (ppid)
child’s ppid is the parent’s pid
parent’s pid stays same
certain time values reset in child
parent’s file locks aren’t inherited
pending alarms are not inherited
pending signals in parent aren’t inherited
20. vfork
Maintained for compatability, vfork is not often used
Some systems implement it as a fork
Child executes first. Parent doesn’t resume until child either
exits (via call of exit() or _exit()) or uses exec to start
another program.
The child is a separate process, but it shares the parent’s
data space. vforkdemo.c shows that this is the case
21. vforkdemo.c
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
•Parent output is same as child’s
int glob ;
int •If separate data spaces, parent wouldn’t experience ++
main(void){
operations
int var;
pid_t pid;
glob = 10; var = 20;
printf("before vforkn");
if (vfork()== 0 ) {
sleep(1);
glob++;
var++;
printf("child glob= %d var= %dn", glob, var);
_exit(0); // what if this is just exit()?
}
else {
printf("parent glob= %d var= %dn", glob, var);
}
}
22. When a process terminates...
Its parent is informed via a SIGCHLD signal
If its parent doesn’t “collect” it, it becomes a zombie
process (next slide)
If its parent has already terminated, it is inherited by the init
process (pid 1), which “collects” it using a wait operation (2
slides hence).
All processes must have an identifiable (by pid) parent
It is able to provide minimal information to its parent when
it comes to “collect” it
23. Zombie Process
A zombie is a process that has terminated, but hasn’t
been “collected” by its parent
The system frees most of the resources associated
with this terminated process, e.g. closing open files
and freeing memory,and minimally maintains:
process id
CPU time used
termination status
24. wait operations
A terminated process’ information is “collected” via a
call of a wait operation by its parent
Operations:
wait
blocks the calling process until a child process terminates,
returning the child’s pid.
If caller has no children, wait immediately returns –1 (error)
the termination status (return value) of the child may be obtained
via the argument
waitpid
permits a caller to wait for a particular child, identified by its pid
can be configured to not block if the child is active
25. Process Termination
Normal:
1. main contains return statement
2. call exit
3. call _exit
Abnormal:
1. Process aborts itself
2. Process receives a signal (e.g. division by 0)
26. exit() vs._exit()
exit() causes a process to terminate.
stdio funtion fclose is applied to all open streams
the argument is the exit status
exit status becomes termination status when exit() calls _exit()
_exit is a Unix specific command
the process terminates immediately without any cleanup
see vfork examples
If a process doesn’t explicitly specify exit status via
a call to exit() or _exit(), the process’ termination
status will be undefined
27. Exercises
1. What can happen if a process calls exit
while writing to a buffered output stream?
2. Write code guaranteed to create a zombie
process.
3. Write code that will cause a process to be
inherited by the init process.