Back

logread

logread queries the state of the hospital. It prints which doctors and nurses are in the hospital or its rooms, and allows for various time-based queries of the state of the hospital. The following invocations must be supported:

logread -K <token> -S -F <log>
logread -K <token> -R (-D <name> | -N <name>) -F <log>

As per the above invocations, only one of -S or -R may be specified at once.

In what follows, we refer to doctors or nurses who are 'in the hospital'. Each person is expected to first enter the hospital (using logappend option -A) prior to entering any particular room of the hospital. Once in the hospital, they may enter and leave various rooms (using logappend options -A -R and options -L -R, respectively). Finally, the person will leave the hospital (using logappend option -L). During this whole sequence of events, a person is considered to be 'in the hospital'. See the examples for more information.

When output elements are comma-separated lists, there will be no spaces before or after the commas.

Return values and error conditions

If logread must exit with an error condition, or if the argument combination is incomplete or contradictory, logread should print "invalid" to stdout and exit, returning 255.

If logread must exit with an integrity violation, logread should print "integrity violation" to stdout and exit, returning 255.

Some examples of conditions that would result in printing "invalid" or "integrity violation" (and return 255):