orderd [-aB] [-l key:size] inkey outkey shmsize limit [ logfile ]
Usually, the recvt(1W) process writes data in the input side shared memory. When required to sort data, order collects "the chronologically oldest data from the data written in the input-side shared memory in limit seconds from the current time but not yet copied to the output-side shared memory" and copies them to the output-side shared memory. Consequently, of the data packets with the same (data) time label, ones that arrive more than limit seconds later than the one that arrives earliest will be read and dumped without being written out. Therefore, even when its resource is running low, the input-side shared memory must have a minimum capacity left for win format data for limit seconds.
On the other hand, the number of seconds of limit must be determined with consideration of the real time-to-delay time width that data packets arriving at the input side from different systems can have.
Between the input and output sides of order, there can be a maximum delay time of limit seconds. The output data will be also delayed from the real time by at least limit seconds.
Orderd is initiated in daemon mode. It is the same operation as when option -D is specified by order.
When log file name logfile is specified, operation log is set here. When it is not specified, log information is sent to the standard output (however, it is sent to syslogd(8) when operation is made in the daemon mode). The log file is opened/closed in each write.
If order is initiated without argument, brief usage is displayed.
(1) 4-byte block size (bytes) (2) 6-byte time header (1 byte each for yr, mth, day, hr, min, and sec, BCD format) Last two digits of year (00 to 99), month (01 to 12), day (01 to 31), hour (00 to 23), minute (00 to 59), second (00 to 59) (3) Data for one or more channels at the same time (win format)
The shared memory segment has the following structure as a whole:
struct Shm { unsigned long p; /* write point */ unsigned long pl; /* write limit */ unsigned long r; /* latest */ unsigned long c; /* counter */ unsigned char d[SIZE]; /* data buffer */ } *sh;p, pl, r, and c are administrative variables, and d is the data area. These are all written by a single write-side process. The corresponding read-side process synchronizes itself with these variables to read the data.
(1) 4-byte block size (bytes) (2) 6-byte time header (1 byte each for yr, mth, day, hr, min, and sec, BCD format) Last two digits of year (00 to 99), month (01 to 12), day (01 to 31), hour (00 to 23), minute (00 to 59), second (00 to 59) (3) Data for one or more channels at the same time (win format) (4) 4-byte block size (bytes)
Alternative format to write in the shared memory (D format):
Last two digits of year (00 to 99), month (01 to 12), day (01 to 31),
hour (00 to 23), minute (00 to 59), second (00 to 59)
(3) Data for 1 or more channel at the same time (win format)
This format differs from the default format only in the part of (4). (1) and (4) contain an identical value, which is the size of a single block with (1) to (4) all included. This format is used to allow backward search (from higher to lower addresses). In this format, the variable pl in the shared memory structure indicates the position (4) of the final block written immediately before returning back to the top of the shared memory. The read-side process can use not only pl as the "point beyond which data returns to the head without getting into the new 1 second block" but also as the starting point of backward search (point for returning to the head). Usually, the read-side program automatically determines if the shared memory is in this format.