Reference no: EM132872604
300698 Operating Systems Programming - Western Sydney University
Practical Case Study
Introduction
In this case study you will implement a simple logging service built on top of a message queue.
Specification
The task is broken into two parts, a message logging server, and a library to log messages. The message server listens to a message queue and extracts the log messages from it. The library provides a more convenient way access the message queue.
You have been provided with a program to test that your library communicates with your server. You will need to review the lecture notes, and the documentation supplied in Section 5 to implement these programs.
Message Logging Server
The message logging server should attempt to create the message queue, if this fails then it should terminate with an error message, it should not run if the message queue actually exists (IPC_EXCL will help here).
Once connected to the message queue, the program should sit in a loop, receiving a message, and printing it to the stdout. Messages should be formatted:
id: message
where id is the type from the message structure and message is the message 1eld.
The server should shutdown cleanly (i.e. delete the message queue) on receipt of a
SIGINT (generated by pressing control and C keys at the same time).
The sample code 1les logservice.h and logserver.c should form the basis of your solution for this part. There are a number of comments in this 1le to help you structure your code.
Messaging library
The messaging library consists of two functions, both de1ned in logservice.h:
int initLogService()
This function should initialise the message queue to log messages to, returning an id if successful, and -1 on error.
This function should not attempt to create the message queue, only attach it to
the process.
int logMessage(int id, char *message)
This function logs the message passed as the string message to the log service id. It should return 0 on success and -1 on error.
When sending a message, the function should encode the processes pid into the type 1eld of the message, and the string into the message 1eld.
It is your choice what to do if the message is too long (i.e. longer than MSGCHARS), sample behaviours include breaking the message up into smaller pieces or simply rejecting it. Whatever the choice, the documentation in the header 1le should re2ect this choice.
The sample code 1les logservice.h and logservice.c should form the basis of your solution for this part.
Attachment:- Operating Systems Programming.rar
State the amount of tammy gain or loss on the year sale
: Year 1 (April): Tammy purchases 1,000 shares of ABC Corp. stock for $36,000. State the amount of Tammy gain or loss on the year sale
|
Determine the amount to be appropriated as expenses
: In September 2019, a company bought working-time material, worth $30.000,00. Determine the amount to be appropriated as Expenses
|
What is cultural relativism
: Do we live in a cosmopolitan era? In other words, can we achieve global citizenship? Does it have universal weight, or is it a concept solely
|
When will the wizards record revenue and for what amount
: The Washington Wizards collects the money when customers reserve their season's tickets. When will the Wizards record revenue and for what amount
|
300698 Operating Systems Programming Assignment
: 300698 Operating Systems Programming Assignment Help and Solution, Western Sydney University - Assessment Writing Service
|
Why are government programs seldom terminated
: Example of a government program that should have been terminated and explain how it may have survived (think about stakeholders and their interests).
|
Prepare journal entries for each of foregoing transactions
: Prepare journal entries for each of the foregoing transactions in an Excel worksheet. Label each entry clearly and use Excel formulas for all calculated numbers
|
Why has the women movement declined in recent years
: Do you think this decline is permanent or is the movement simply in "abeyance, " with the possibility of springing back to life under the right conditions?
|
Make a schedule of cost of goods manufactured in good format
: Frosting corp. has provided the following relating to the most recent month (August 31, 2020) of operations, Make a schedule of cost of goods manufactured
|