Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a whattime.c program which accepts either a -f or -d argument or no arguments at all. If the program is run with either no

Write a whattime.c program which accepts either a -f or -d argument or no arguments at all. If the program is run with either no arguments or the -f argument, then the program runs in the foreground and outputs it's results to stdout. If -d is given when the program is run, then it immediately becomes a daemon and runs in the background (detached from any terminals) and logs to a file called mydeamon.log. Whether the program runs in the foreground or background doesn't matter, the program should always run for one minute. Every two seconds your program should re port the number of seconds since 1/1/1970 12:00am and also the username and home directory of the user who started the program up (refer to getenv function in stdlib.h). And by report I mean if you run in the foreground, then display the results to stdout, if run as a daemon, then output to the log file.

image text in transcribed

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

Advanced Database Systems

Authors: Carlo Zaniolo, Stefano Ceri, Christos Faloutsos, Richard T. Snodgrass, V.S. Subrahmanian, Roberto Zicari

1st Edition

155860443X, 978-1558604438

Students also viewed these Databases questions

Question

=+2 How does the preparation and support for each type of IE vary?

Answered: 1 week ago

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago