C Language :To write a program that reads data from a data file and to perform the arithmetic operations listed within it. It must involve extensive use of signals and the handling of those signals.

Geschlossen Veröffentlicht Jun 19, 2009 Bezahlt bei Lieferung
Geschlossen Bezahlt bei Lieferung

**_Program specification_**

To write a program that reads data from a data file and to perform the arithmetic operations listed within it. It must involve extensive use of signals and the handling of those signals.

The program must be implemented to the following specification:

**General Specifications**

The following are program wide specifications

1. You must identify which tasks must be carried out before the fork.

2. All outputs are to files, none are to be displayed to screen.

3. Whenever a process (parent or child) terminates, it must do so gracefully (i.e. all appropriate housekeeping must be done) and must also make an entry in the relevant status file as to when the process completed.

4. Some operations are not guaranteed to succeed (e.g. fork), so all necessary checks must be done.

5. The parent is not allowed to write to the child status file and the child is not allowed to write to the parent status file (i.e. each process can only write to its own status file.

6. You must determine what signals might be generated from within the program and handle them appropriately.

7. Marks have been allocated for presentation (i.e. the structure of the program etc).

## Deliverables

**Parent Process**

1. Request from the user the length of time that they wish the program to run in seconds.

2. Four files are to be created that are to be used to store status messages and useful information from the parent process and the child processes in the following name format:

Results.*<time>*

ParentStatus.*<time>*

Child1Status.*<time>*

Child2Status.*<time>*

where <*time*> is the time and date of when the parent process is run.

1. All file handlesfor any files created must be stored in an array that holds file descriptors and any operations performed upon those files (read, write, open and close) must be performed upon this array.

2. The parent will spawn two child processes and then wait until they both finish.

3. The process must then create a pipe which will be used for communication between the child processes.

4. Once the results file name is obtained and the pipe has been created, output to the parent process status file the process id, various items of inode information of the parent status file and also the values of all the file descriptors in use.

**Child Process 1**

This process is primarily responsible for reading the random numbers from the pipe, performing a random arithmetic operation and writing it to the destination file.

1. A timer must be set that will cause this child process to terminate gracefully according to the time entered by the user from the parent or if the user enters control-C during the timer period.

2. STDIN\_FILENO must be set to read from the pipe, STDOUT\_FILENO must be set to write to the results file. All reads and writes is to be performed using scanf and printf.

3. This process must continually read two values from the pipe, then perform a random arithmetic operation upon them (+, -, * or /) and write the input data and result to the results file. The output from calculations to the results files should be of the format <operand1> <operator> <operand2> = <result> (e.g. 4 * 3 = 12)

4. The values should not be checked prior to calculations (i.e. you should not check for divide by 0). Where an error occurs from a calculation, a suitable error message must be written to the output file for that calculation. The child process should then continue to process the next line of calculation.

5. Suitable messages should be written to “Child1Status.*<time>*?? depending on events including the (randomly generated) value of the interval of which the process will run, signal handling messages, useful process information, and inode information relating to its status file.

**Child Process 2**

This process is primarily responsible for writing random numbers to the pipe.

1. STDOUT_FILENO must be set to write to the writing end of the pipe. All writes are to be performed using printf.

2. The process must then continually write random integers between 0 and 5 to STDOUT_FILENO.

3. Suitable messages should be written to “Child2status.*<time>*?? depending on events including signal handling messages, useful process information, and inode information relating to its status file.

**Deliverables**

The deliverables of the coursework are:

1. Printed program listing.

2. Results files and all status files from **3** runs of the program.

You must comment on the results of each of the runs in a brief report.

1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.

2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):

a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.

b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.

3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).

* * *This broadcast message was sent to all bidders on Wednesday Jun 24, 2009 6:20:59 PM:

can you do this in 1 day?and how much can you do it for?thank you landi

## Platform

the program needs to run on linux OS.

Ingenieurwesen Linux MySQL PHP Softwarearchitektur Testen von Software Training

Projekt-ID: #2685427

Über das Projekt

14 Vorschläge Remote Projekt Aktiv Jun 22, 2009

14 Freelancer bieten im Durchschnitt $84 für diesen Job

renardpaul

See private message.

$42.5 USD in 3 Tagen
(106 Bewertungen)
6.6
koles23

See private message.

$49.3 USD in 3 Tagen
(18 Bewertungen)
6.1
vw6868760vw

See private message.

$51 USD in 3 Tagen
(52 Bewertungen)
5.6
alexpast

See private message.

$85 USD in 3 Tagen
(27 Bewertungen)
5.3
JawwadSyed

See private message.

$42.5 USD in 3 Tagen
(23 Bewertungen)
5.0
akamaus

See private message.

$39.95 USD in 3 Tagen
(8 Bewertungen)
4.4
purraj

See private message.

$63.75 USD in 3 Tagen
(5 Bewertungen)
3.3
adnanwaheed

See private message.

$59.5 USD in 3 Tagen
(11 Bewertungen)
2.8
meetanshu

See private message.

$127.5 USD in 3 Tagen
(2 Bewertungen)
2.5
rkumars

See private message.

$85 USD in 3 Tagen
(2 Bewertungen)
2.1
liaisonsolu

See private message.

$301.75 USD in 3 Tagen
(3 Bewertungen)
1.3
planetdev

See private message.

$127.5 USD in 3 Tagen
(0 Bewertungen)
1.9
prachcho

See private message.

$85 USD in 3 Tagen
(0 Bewertungen)
0.0
karthikeyantvw

See private message.

$21.25 USD in 3 Tagen
(0 Bewertungen)
0.0