Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a c program for implement your own system function int cs531_system(const char *comm); Include the following functions/macros within your program: fork(), execlp(), dup(), wait(),

Write a c program for implement your own "system" function

int cs531_system(const char *comm);

Include the following functions/macros within your program: fork(), execlp(), dup(), wait(), signal(), WEXITSTATUS(), WTERMSIG(), WSTOPSIG(), WIFCONTINUED()Do Not use system().

implement your own "system" function

int cs531_system(const char *comm);

Include the following functions/macros within your program: fork(), execlp(), dup(), wait(), signal(), WEXITSTATUS(), WTERMSIG(), WSTOPSIG(), WIFCONTINUED()Do Not use system().

Test Case

1. "ps -a"

PID TTY TIME CMD 5925 ttys000 0:00.03 login -pf halgreenwald 5926 ttys000 0:00.46 -bash 5934 ttys001 0:00.02 login -pf halgreenwald 5935 ttys001 0:00.82 -bash 24790 ttys002 0:00.04 login -pf halgreenwald 24791 ttys002 0:00.28 -bash 50596 ttys002 0:00.00 ./hw5 ps -a 50597 ttys002 0:00.00 ps "a Parent process is sleeping...

2. "ping 127.0.0.1" > tmp

PING 127.0.0.1 (127.0.0.1): 56 data bytes 64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.049 ms 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.121 ms 64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.055 ms 64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.118 ms

^C $ cat tmp Parent process is sleeping...

NOTE: ping should still be visible on the console. out.txt should contain Parent process is sleepling

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions

Question

Define externalities and public goods.

Answered: 1 week ago