300698 Operating Systems Programming Assignment

Assignment Help Operating System
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

Reference no: EM132872604

Questions Cloud

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

Reviews

Write a Review

Operating System Questions & Answers

  What are entities that are swapped out of the main memory

What are the entities that are swapped out of the main memory while swapping the process out of the main memory? What is Fork swap?

  Stand alone child process

Forking the child process

  Value of semaphore before entering into critical section

Give a solution using Monitor that is starvation-free. What would be value of semaphore before entering into Critical Section and after leaving it.

  Explain the sorting algorithm

Throughout the statement and solution to this problem, a caret ("^") denotes that the number immediately following it is an exponent.

  Write bash shell script for number files in directories

Write a bash shell script filestatic. The script should examine the number files in directories given as arguments (parameters) to this script.

  Information technology security

Assume you are an independent consultant who specializes in IT security issues. You have been retained through the Designer Distributions corporation, a mid-sized and growing customer goods distribution corporation.

  Explain the properties of deadlock

Suppose you build a system using a staged architecture with some fixed number of threads operating on stage. Assuming each stage is individually deadlock free.

  Write the commands you will issue to complete

Open your terminal and connect to snowball server. Change your directory to your home directory.

  Calculate the required block size

Calculate the required block size (actual request size) by adding the size of the required metadata and rounding the allocation size up to the next 8-byte

  C language code that reads a lowercase

Required some guidance writing a program in C code that reads a lowercase string of characters from a text document named "data.txt",

  Describe the lookup steps within the page tables

Describe the lookup steps within the page tables to find the physical address of the logical address 0x00403004 - How many page-table pages are required

  What about pipelines and discuss the problems

You picked pipe, which creates the pipes used to send byte streams from one process to another. Is it still possible to implement I/O redirection somehow? What about pipelines? Discuss the problems and possible solutions.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd