Telah Dianugerahkan

Pengaturcaraan C Job by bighead612

Begin by reading the manual pages for signal (man signal) and wait (Linux: man 2 wait; Unix: man -s 3C wait).

Write a C/C++ program called [url removed, login to view] that waits a brief period of time (10 seconds; using the sleep function) to simulate a daemon process initializing and then waiting for an incoming request.

After this period, the parent process should fork/exec (don't use the system() function call) a child process (call it [url removed, login to view]). The parent process should then sleep for a longer period of time (2 minutes).

The parent process should determine when the child process exits. The parent process should report the child's PID and it's return/exit status.

The child process should also sleep for a period of time (30 seconds) to simulate a child process performing some work on behalf of the user. After the child process wakes up, it should simply exit with a value of 53.

At each step, both processes should output an informational message to help us understand what is happening, such as the following:

parent: forking child

child: going to sleep

etc.

Kemahiran: Pengaturcaraan C

Lihat lebih lanjut: signal system, project man, cpp, fork system call, call behalf, incoming call request, step project, unix project, using fork program, linux daemon process, project brief, project status report, reading project work, linux project report, signal linux, using exec program, project manual, program using fork exec, write project report, write program fork exec, signal project, wait linux, program exec fork, write unix, custom report

Tentang Majikan:
( 4 ulasan ) Philadelphia, United States

ID Projek: #1575855

1 pekerja bebas membida secara purata $40 untuk pekerjaan ini

minhtridn2001

Hired by the Employer

$40 USD dalam 2 hari
(17 Ulasan)
4.7