hw4hw4hw4hw4hw4hw4hw4hw4hw4hw4hw4hw4hw4hw4hw4

Embed Size (px)

Citation preview

  • 8/12/2019 hw4hw4hw4hw4hw4hw4hw4hw4hw4hw4hw4hw4hw4hw4hw4

    1/2

    Operating Systems

    HW Assignment #4

    In this assignment, you will have to extend/refator the !logging system" you have developed in the

    assignment # to inlude some additional features$ %he new logging system will support &oth file

    and ''()&ased logging with relevant funtionality pa*ed into +s$

    -$ (irst, you have to develop two +s with the same set of exported funtions &ut with a &it

    different funtionality$ %he +s .alled mmflog$dll and filelog$dll0 should implement funtions

    for logging using ''( and dis* file storage respetively$ %he +s will exported following

    funtions1

    HA2+3 Startogging .5%S%6 logname,

    +WO6+ dwogSi7e,

    +WO6+ dw%imeout0

    a$ %his funtion will &e used &y writers and readers to initiali7e ''( or (ile)&ased log file

    &$ HA2+3 is 8 &it value .typedef 9OI+ HA2+30 that represents the log instane$ :se .HA2+30)- return value to for an error

    d$ dw%imeout to use for all synhroni7ations waits

    9OI+ Stopogging.HA2+3 hog0

    a$ %his funtion is used &y writers and the viewer to stop logging and to free all unneeded

    resoures .handles, memory ,files0

    &$ Aepts handle to a log file previously o&tained from Startogging funtion

    +WO6+ Writeog3ntry.HA2+3 hog0

    a$ %his funtion is used &y writers to write a log entry

    &$ 6eturns a se;uene num&er of suessfully written log entry

    ? pog3ntry0

    a$ %his funtion is used &y the viewer to read log entry

    &$ If there is no log entries, the funtion should return false .does not wait if log file is

    empty0

    $ O=32%6> is defined as strut @+WO6+ dw%ime+WO6+ dwSB2 +WO6+ dwI+,

    +WO6+ dwSumC

    HA2+3 =etogWaitO&Det.HA2+3 hog0

    a$ %his funtion is used &y the viewer proess to o&tain a handle for a win8 waita&le

    o&Det .e$g$ semaphore0 that is signaled when there are log entries in the log file

    8$ A proess .e$g$ writer proess0 should load one of these +s a&ove at run time depending on

    the ommand line argument it reeives$ In order to ma*e it easy for all future developers to use

    this funtionality, you will need to wrap the + loading proess into another + .glog$dll0

    whih will &e lin*ed to exeuta&les using ompile time &inding$ %his !generali7ed log" +

    should export following set of funtions1

  • 8/12/2019 hw4hw4hw4hw4hw4hw4hw4hw4hw4hw4hw4hw4hw4hw4hw4

    2/2

    =HA2+3 =Startogging

    . 5%S%6 logname, +WO6+ dwogSi7e, +WO6+ dw%imeout,