1 | @c |
---|
2 | @c COPYRIGHT (c) 1988-1998. |
---|
3 | @c On-Line Applications Research Corporation (OAR). |
---|
4 | @c All rights reserved. |
---|
5 | @c |
---|
6 | @c $Id$ |
---|
7 | @c |
---|
8 | |
---|
9 | @chapter Event Logging Manager |
---|
10 | |
---|
11 | @section Introduction |
---|
12 | |
---|
13 | The event logging manager provides a portable method for logging |
---|
14 | system and application events and subsequent processing of those |
---|
15 | events. The capabilities in this manager were defined in the POSIX |
---|
16 | 1003.1h/D3 proposed standard titled @b{Services for Reliable, |
---|
17 | Available, and Serviceable Systems}. |
---|
18 | |
---|
19 | The directives provided by the event logging manager are: |
---|
20 | |
---|
21 | @itemize @bullet |
---|
22 | @item @code{log_write} - Write to the Log |
---|
23 | @item @code{log_open} - Open a log file |
---|
24 | @item @code{log_read} - Read from the system Log |
---|
25 | @item @code{log_notify} - Notify Process of writes to the system log |
---|
26 | @item @code{log_close} - Close log descriptor |
---|
27 | @item @code{log_seek} - Reposition log file offset |
---|
28 | @item @code{log_severity_before} - Compare event record severities |
---|
29 | @item @code{log_facilityemptyset} - Manipulate log facility sets |
---|
30 | @item @code{log_facilityfillset} - Manipulate log facility sets |
---|
31 | @item @code{log_facilityaddset} - Manipulate log facility sets |
---|
32 | @item @code{log_facilitydelset} - Manipulate log facility sets |
---|
33 | @item @code{log_facilityismember} - Manipulate log facility sets |
---|
34 | @end itemize |
---|
35 | |
---|
36 | @section Background |
---|
37 | |
---|
38 | @subsection Log Files and Events |
---|
39 | |
---|
40 | System log |
---|
41 | |
---|
42 | Non-system logs |
---|
43 | |
---|
44 | Events, facility, severity |
---|
45 | |
---|
46 | @subsection Queries |
---|
47 | |
---|
48 | @section Operations |
---|
49 | |
---|
50 | @subsection Creating and Writing a non-System Log |
---|
51 | |
---|
52 | Discuss creating and writing to a non-system log. |
---|
53 | |
---|
54 | @example |
---|
55 | log_create |
---|
56 | log_write loop |
---|
57 | @end example |
---|
58 | |
---|
59 | @subsection Reading a Log |
---|
60 | |
---|
61 | Discuss opening and reading from a log. |
---|
62 | |
---|
63 | @example |
---|
64 | build a query |
---|
65 | log_open |
---|
66 | log_read loop |
---|
67 | @end example |
---|
68 | |
---|
69 | @section Directives |
---|
70 | |
---|
71 | This section details the event logging manager's directives. |
---|
72 | A subsection is dedicated to each of this manager's directives |
---|
73 | and describes the calling sequence, related constants, usage, |
---|
74 | and status codes. |
---|
75 | |
---|
76 | @page |
---|
77 | @subsection log_write - Write to the Log |
---|
78 | |
---|
79 | @subheading CALLING SEQUENCE: |
---|
80 | |
---|
81 | @ifset is-C |
---|
82 | @example |
---|
83 | int log_write( |
---|
84 | const log_facility_t facility, |
---|
85 | const int event_id, |
---|
86 | const log_severity_t severity, |
---|
87 | const void *buf, |
---|
88 | const size_t len |
---|
89 | ); |
---|
90 | @end example |
---|
91 | @end ifset |
---|
92 | |
---|
93 | @ifset is-Ada |
---|
94 | @end ifset |
---|
95 | |
---|
96 | @subheading STATUS CODES: |
---|
97 | |
---|
98 | @table @b |
---|
99 | @item EINVAL |
---|
100 | The facility argument is not a valid log_facility. |
---|
101 | |
---|
102 | @item EINVAL |
---|
103 | The severity argument exceeds @code{LOG_SEVERITY_MAX} |
---|
104 | |
---|
105 | @item EINVAL |
---|
106 | The len argument exceeds @code{LOG_ENTRY_MAXLEN} |
---|
107 | |
---|
108 | @item ENOSPC |
---|
109 | The log file has run out of space on the device. |
---|
110 | |
---|
111 | @item EPERM |
---|
112 | The caller does not have appropriate permission for writing to |
---|
113 | the given facility. |
---|
114 | |
---|
115 | @item EIO |
---|
116 | An I/O error occurred in writing to the system event log. |
---|
117 | |
---|
118 | @end table |
---|
119 | |
---|
120 | @subheading DESCRIPTION: |
---|
121 | |
---|
122 | The @code{log_write} function writes an event record, consisting |
---|
123 | of event attributes, and the data identified by the @code{buf} |
---|
124 | argument, to the system log. The @code{len} argument specifies |
---|
125 | the length in bytes of the buffer pointed to by @code{buf}. The |
---|
126 | @code{len} argument shall specify the value of the event record |
---|
127 | length attribute. The value of @code{len} shall be less than or |
---|
128 | equal to @code{LOG_ENTRY_MAXLEN} or the @code{log_write} shall fail. |
---|
129 | |
---|
130 | The @code{event_id} argument identifies the type of event record |
---|
131 | being written. The @code{event_id} argument shall specify the value |
---|
132 | of the event ID attribute of the event record. |
---|
133 | |
---|
134 | The argument @code{facility} indicates the facility from which the |
---|
135 | event type is drawn. The @code{facility} argument shall specify the |
---|
136 | value of the event record facility attribute. The value of the |
---|
137 | @code{facility} argument shall be a valid log facility or the |
---|
138 | @code{log_write} function shall fail. |
---|
139 | |
---|
140 | The @code{severity} argument indicates the severity level of the |
---|
141 | event record. The @code{severity} argument shall specify the value |
---|
142 | of the event record severity attribute. The value of the |
---|
143 | @code{severity} argument shall be less than or equal to |
---|
144 | @code{LOG_SEVERITY_MAX} or the @code{log_write} function shall fail. |
---|
145 | |
---|
146 | The effective_UID of the calling process shall specify the event |
---|
147 | record UID attribute. The effective-GID of the calling process |
---|
148 | shall specify the event record GID attribute. The process ID |
---|
149 | of the calling process shall specify the event record process ID |
---|
150 | attribute. The process group ID of the calling process shall |
---|
151 | specify the event record process group ID attribute. The current |
---|
152 | value of the system clock shall specify the event record timestamp |
---|
153 | attribute. |
---|
154 | |
---|
155 | @subheading NOTES: |
---|
156 | |
---|
157 | The @code{_POSIX_LOGGING} feature flag is defined to indicate |
---|
158 | this service is available. |
---|
159 | |
---|
160 | @page |
---|
161 | @subsection log_open - Open a log file |
---|
162 | |
---|
163 | @subheading CALLING SEQUENCE: |
---|
164 | |
---|
165 | @ifset is-C |
---|
166 | @example |
---|
167 | int log_open( |
---|
168 | const logd_t *logdes, |
---|
169 | const char *path, |
---|
170 | const log_query_t *query |
---|
171 | ); |
---|
172 | @end example |
---|
173 | @end ifset |
---|
174 | |
---|
175 | @ifset is-Ada |
---|
176 | @end ifset |
---|
177 | |
---|
178 | @subheading STATUS CODES: |
---|
179 | |
---|
180 | @table @b |
---|
181 | @item EACCES |
---|
182 | Search permission is denied on a component of the path prefix, |
---|
183 | or the log file exists and read permission is denied. |
---|
184 | |
---|
185 | @item EINTR |
---|
186 | A signal interrupted the call to log_open(). |
---|
187 | |
---|
188 | @item EINVAL |
---|
189 | The log_facility field of the query argument is not a valid |
---|
190 | facility set. |
---|
191 | |
---|
192 | @item EINVAL |
---|
193 | The log_severity field of the query argument exceeds |
---|
194 | @code{LOG_SEVERITY_MAX}. |
---|
195 | |
---|
196 | @item EINVAL |
---|
197 | The path argument referred to a file that was not a log file. |
---|
198 | |
---|
199 | @item EMFILE |
---|
200 | Too many log file descriptors are currently in use by this |
---|
201 | process. |
---|
202 | |
---|
203 | @item ENAMETOOLONG |
---|
204 | The length of the path string exceeds @code{PATH_MAX}, or a pathname |
---|
205 | component is longer than @code{NAME_MAX} while @code{_POSIX_NO_TRUNC} is |
---|
206 | in effect. |
---|
207 | |
---|
208 | @item ENFILE |
---|
209 | Too many files are currently open in the system. |
---|
210 | |
---|
211 | @item ENOENT |
---|
212 | The file specified by the path argument does not exist. |
---|
213 | |
---|
214 | @item ENOTDIR |
---|
215 | A component of the path prefix is not a directory. |
---|
216 | |
---|
217 | @end table |
---|
218 | |
---|
219 | @subheading DESCRIPTION: |
---|
220 | |
---|
221 | The @code{log_open} function establishes the connection between a |
---|
222 | log file and a log file descriptor. It creates an open log file |
---|
223 | description that refers to a log file and a log file descriptor that |
---|
224 | refers to that open log file description. The log file descriptor is |
---|
225 | used by other log functions to refer to that log file. The @code{path} |
---|
226 | argument points to a pathname naming a log file. A @code{path} |
---|
227 | argument of NULL specifies the current system log file. |
---|
228 | |
---|
229 | The @code{query} argument points to a log query specification that |
---|
230 | restricts log operations using the returned log file descriptor to |
---|
231 | to event records from the log file which match the query. The |
---|
232 | predicate which determines the success of the match operation is the |
---|
233 | logical AND of the individual comparison predicates for each member |
---|
234 | of the log query specification. The query attribute of the open file |
---|
235 | description is set to filter as specified by the @code{query} argument. |
---|
236 | If the value of the query argument is not NULL, the value of the |
---|
237 | @code{log_facility} member of the @code{query} specification shall be |
---|
238 | a set of valid log facilities or the @code{log_open} shall fail. If |
---|
239 | the value of the @code{query} argument is not NULL, the value of the |
---|
240 | @code{log_severity} member of the @code{query} specification shall be |
---|
241 | less than or equal to @code{LOG_SEVERITY_MAX} or the @code{log_open} |
---|
242 | shall fail. If the value of the @code{query} argument is NULL, no |
---|
243 | query filter shall be applied. |
---|
244 | |
---|
245 | @subheading NOTES: |
---|
246 | |
---|
247 | The @code{_POSIX_LOGGING} feature flag is defined to indicate |
---|
248 | this service is available. |
---|
249 | |
---|
250 | @page |
---|
251 | @subsection log_read - Read from the system Log |
---|
252 | |
---|
253 | @subheading CALLING SEQUENCE: |
---|
254 | |
---|
255 | @ifset is-C |
---|
256 | @example |
---|
257 | int log_read( |
---|
258 | const logd_t logdes, |
---|
259 | struct log_entry *entry, |
---|
260 | void *log_buf, |
---|
261 | const size_t log_len, |
---|
262 | const size_t *log_sizeread |
---|
263 | ); |
---|
264 | @end example |
---|
265 | @end ifset |
---|
266 | |
---|
267 | @ifset is-Ada |
---|
268 | @end ifset |
---|
269 | |
---|
270 | @subheading STATUS CODES: |
---|
271 | |
---|
272 | @table @b |
---|
273 | @item EBADF |
---|
274 | The logdes argument is not a valid log file descriptor. |
---|
275 | |
---|
276 | @item EBUSY |
---|
277 | No data available. The open log file descriptor references |
---|
278 | the current system log. and there are no unread event records |
---|
279 | remaining. |
---|
280 | |
---|
281 | @item EINTR |
---|
282 | A signal interrupted the call to log_read(). |
---|
283 | |
---|
284 | @item EIO |
---|
285 | An I/O error occurred in reading from the event log. |
---|
286 | |
---|
287 | @end table |
---|
288 | |
---|
289 | @subheading DESCRIPTION: |
---|
290 | |
---|
291 | The @code{log_read} function shall attempt to read the @code{log_entry} |
---|
292 | structure and @code{log_len} bytes of data from the next event record |
---|
293 | of the log file associated with the open log file descriptor @code{logdes}, |
---|
294 | placing the @code{log_entry} structure into the buffer pointed to by |
---|
295 | @code{entry}, and the data into the buffer pointed to by @code{log_buf}. |
---|
296 | The log record ID of the returned event record shall be stored in the |
---|
297 | @code{log_recid} member of the @code{log_entry} structure for the event |
---|
298 | record. |
---|
299 | |
---|
300 | If the query attribute of the open log file description associated with |
---|
301 | the @code{logdes} is set, the event record read shall match that query. |
---|
302 | If the @code{entry} argument is not NULL it will point to a @code{log_entry} |
---|
303 | structure which shall be filled with the creation information for this log |
---|
304 | entry. If the argument @code{log_buf} is not NULL the data written with the |
---|
305 | log entry will be placed in the buffer. The size of the buffer is specified |
---|
306 | by the argument @code{log_len}. |
---|
307 | |
---|
308 | If the @code{log_read} is successful the call shall store the actual length |
---|
309 | of the data associated with the event record into the location specified by |
---|
310 | @code{log_sizeread}. This number may be smaller or greater than |
---|
311 | @code{log_len}. |
---|
312 | |
---|
313 | @subheading NOTES: |
---|
314 | |
---|
315 | The @code{_POSIX_LOGGING} feature flag is defined to indicate |
---|
316 | this service is available. |
---|
317 | |
---|
318 | @page |
---|
319 | @subsection log_notify - Notify Process of writes to the system log. |
---|
320 | |
---|
321 | @subheading CALLING SEQUENCE: |
---|
322 | |
---|
323 | @ifset is-C |
---|
324 | @example |
---|
325 | int log_notify( |
---|
326 | const logd_t logdes, |
---|
327 | const struct sigevent *notification |
---|
328 | ); |
---|
329 | @end example |
---|
330 | @end ifset |
---|
331 | |
---|
332 | @ifset is-Ada |
---|
333 | @end ifset |
---|
334 | |
---|
335 | @subheading STATUS CODES: |
---|
336 | |
---|
337 | @table @b |
---|
338 | @item EBADF |
---|
339 | The logdes argument is not a valid log file descriptor. |
---|
340 | |
---|
341 | @item EINVAL |
---|
342 | The notification argument specifies an invalid signal. |
---|
343 | |
---|
344 | @item EINVAL |
---|
345 | The process has requested a notify on a log that will not be |
---|
346 | written to. |
---|
347 | |
---|
348 | @item ENOSY |
---|
349 | The function log_notify() is not supported by this implementation. |
---|
350 | |
---|
351 | @end table |
---|
352 | |
---|
353 | @subheading DESCRIPTION: |
---|
354 | |
---|
355 | If the argument @code{notification} is not NULL this function registers |
---|
356 | the calling process to be notified of event records received by the system |
---|
357 | log, which match the query parameters associated with the open log descriptor |
---|
358 | specified by @code{logdes}. The notification specified by the |
---|
359 | @code{notification} argument shall be sent to the process when an event |
---|
360 | record received by the system log is matched by the query attribute of the |
---|
361 | open log file description associated with the @code{logdes} log file |
---|
362 | descriptor. If the calling process has already registered a notification |
---|
363 | for the @code{logdes} log file descriptor, the new notification shall |
---|
364 | replace the existing notification registration. |
---|
365 | |
---|
366 | If the @code{notification} argument is NULL and the calling process is |
---|
367 | currently registered to be notified for the @code{logdes} log file |
---|
368 | descriptor, the existing registration shall be removed. |
---|
369 | |
---|
370 | @subheading NOTES: |
---|
371 | |
---|
372 | The @code{_POSIX_LOGGING} feature flag is defined to indicate |
---|
373 | this service is available. |
---|
374 | |
---|
375 | @page |
---|
376 | @subsection log_close - Close log descriptor |
---|
377 | |
---|
378 | @subheading CALLING SEQUENCE: |
---|
379 | |
---|
380 | @ifset is-C |
---|
381 | @example |
---|
382 | int log_close( |
---|
383 | const logd_t logdes |
---|
384 | ); |
---|
385 | @end example |
---|
386 | @end ifset |
---|
387 | |
---|
388 | @ifset is-Ada |
---|
389 | @end ifset |
---|
390 | |
---|
391 | @subheading STATUS CODES: |
---|
392 | |
---|
393 | @table @b |
---|
394 | @item EBADF |
---|
395 | The logdes argument is not a valid log file descriptor. |
---|
396 | |
---|
397 | @end table |
---|
398 | |
---|
399 | @subheading DESCRIPTION: |
---|
400 | |
---|
401 | The @code{log_close} function deallocates the open log file descriptor |
---|
402 | indicated by @code{log_des}. |
---|
403 | |
---|
404 | When all log file descriptors associated with an open log file description |
---|
405 | have been closed, the open log file description shall be freed. |
---|
406 | |
---|
407 | If the link count of the log file is zero, when all log file descriptors |
---|
408 | have been closed, the space occupied by the log file shall be freed and the |
---|
409 | log file shall no longer be accessible. |
---|
410 | |
---|
411 | If the process has successfully registered a notification request for the |
---|
412 | log file descriptor, the registration shall be removed. |
---|
413 | |
---|
414 | @subheading NOTES: |
---|
415 | |
---|
416 | The @code{_POSIX_LOGGING} feature flag is defined to indicate |
---|
417 | this service is available. |
---|
418 | |
---|
419 | @page |
---|
420 | @subsection log_seek - Reposition log file offset |
---|
421 | |
---|
422 | @subheading CALLING SEQUENCE: |
---|
423 | |
---|
424 | @ifset is-C |
---|
425 | @example |
---|
426 | int log_seek( |
---|
427 | const logd_t logdes, |
---|
428 | log_recid_t log_recid |
---|
429 | ); |
---|
430 | @end example |
---|
431 | @end ifset |
---|
432 | |
---|
433 | @ifset is-Ada |
---|
434 | @end ifset |
---|
435 | |
---|
436 | @subheading STATUS CODES: |
---|
437 | |
---|
438 | @table @b |
---|
439 | @item EBADF |
---|
440 | The logdes argument is not a valid log file descriptor. |
---|
441 | |
---|
442 | @item EINTR |
---|
443 | The log_seek() function was interrupted by a signal. |
---|
444 | |
---|
445 | @item EINVAL |
---|
446 | The log_recid argument is not a valid record id. |
---|
447 | |
---|
448 | @end table |
---|
449 | |
---|
450 | @subheading DESCRIPTION: |
---|
451 | |
---|
452 | The @code{log_seek} function shall set the log file offset of the open |
---|
453 | log description associated with the @code{logdes} log file descriptor |
---|
454 | to the event record in the log file identified by @code{log_recid}. |
---|
455 | The @code{log_recid} argument is either the record id of a valid event |
---|
456 | record or one of the following values, as defined in the header <evlog.h>: |
---|
457 | |
---|
458 | @table @b |
---|
459 | @item LOG_SEEK_START |
---|
460 | Set log file position to point at the first event |
---|
461 | record in the log file |
---|
462 | |
---|
463 | @item LOG_SEEK_END |
---|
464 | Set log file position to point after the last event |
---|
465 | record in the log file |
---|
466 | |
---|
467 | @end table |
---|
468 | |
---|
469 | If the @code{log_seek} function is interrupted, the state of the open log |
---|
470 | file description associated with @code{logdes} is unspecified. |
---|
471 | |
---|
472 | @subheading NOTES: |
---|
473 | |
---|
474 | The @code{_POSIX_LOGGING} feature flag is defined to indicate |
---|
475 | this service is available. |
---|
476 | |
---|
477 | @page |
---|
478 | @subsection log_severity_before - Compare event record severities |
---|
479 | |
---|
480 | @subheading CALLING SEQUENCE: |
---|
481 | |
---|
482 | @ifset is-C |
---|
483 | @example |
---|
484 | int log_severity_before( |
---|
485 | log_severity_t s1, |
---|
486 | log_severity_t s2 |
---|
487 | ); |
---|
488 | @end example |
---|
489 | @end ifset |
---|
490 | |
---|
491 | @ifset is-Ada |
---|
492 | @end ifset |
---|
493 | |
---|
494 | @subheading STATUS CODES: |
---|
495 | |
---|
496 | @table @b |
---|
497 | @item EINVAL |
---|
498 | The value of either s1 or s2 exceeds @code{LOG_SEVERITY_MAX}. |
---|
499 | |
---|
500 | @end table |
---|
501 | |
---|
502 | @subheading DESCRIPTION: |
---|
503 | |
---|
504 | The @code{log_severity_before} function shall compare the severity order |
---|
505 | of the @code{s1} and @code{s2} arguments. Severity values ordered |
---|
506 | according to this function shall be according to decreasing severity. |
---|
507 | |
---|
508 | If @code{s1} is ordered before or is equal to @code{s2} then the ordering |
---|
509 | predicate shall return 1, otherwise the predicate shall return 0. If |
---|
510 | either @code{s1} or @code{s2} specify invalid severity values, the return |
---|
511 | value of @code{log_severity_before} is unspecified. |
---|
512 | |
---|
513 | @subheading NOTES: |
---|
514 | |
---|
515 | The @code{_POSIX_LOGGING} feature flag is defined to indicate |
---|
516 | this service is available. |
---|
517 | |
---|
518 | @page |
---|
519 | @subsection log_facilityemptyset - Manipulate log facility sets |
---|
520 | |
---|
521 | @subheading CALLING SEQUENCE: |
---|
522 | |
---|
523 | @ifset is-C |
---|
524 | @example |
---|
525 | int log_facilityemptyset( |
---|
526 | log_facility_set_t *set |
---|
527 | ); |
---|
528 | @end example |
---|
529 | @end ifset |
---|
530 | |
---|
531 | @ifset is-Ada |
---|
532 | @end ifset |
---|
533 | |
---|
534 | @subheading STATUS CODES: |
---|
535 | |
---|
536 | @table @b |
---|
537 | @item EINVAL |
---|
538 | The facilityno argument is not a valid facility. |
---|
539 | |
---|
540 | @end table |
---|
541 | |
---|
542 | @subheading DESCRIPTION: |
---|
543 | |
---|
544 | The facilitysetops primitives manipulate sets of facilities. They |
---|
545 | operate on data objects addressable by the application. |
---|
546 | |
---|
547 | The @code{log_facilityemptyset} function initializes the facility |
---|
548 | set pointed to by the argument @code{set}, such that all facilities |
---|
549 | are included. |
---|
550 | |
---|
551 | Applications shall call either @code{log_facilityemptyset} or |
---|
552 | @code{log_facilityfillset} at least once for each object of type |
---|
553 | @code{log_facilityset_t} prior to any other use of that object. If |
---|
554 | such an object is not initialized in this way, but is nonetheless |
---|
555 | supplied as an argument to any of the @code{log_facilityaddset}, |
---|
556 | @code{logfacilitydelset}, @code{log_facilityismember} or |
---|
557 | @code{log_open} functions, the results are undefined. |
---|
558 | |
---|
559 | The @code{log_facilityaddset} and @code{log_facilitydelset} functions |
---|
560 | respectively add or delete the individual facility specified by the |
---|
561 | value of the argument @code{facilityno} to or from the facility set |
---|
562 | pointed to by the argument @code{set} |
---|
563 | |
---|
564 | The @code{log_facilityismember} function tests whether the facility |
---|
565 | specified by the value of the argument @code{facilityno} is a member |
---|
566 | of the set pointed to by the argument @code{set}. Upon successful |
---|
567 | completion, the @code{log_facilityismember} function either returns |
---|
568 | a value of one to the location specified by @code{member} if the |
---|
569 | specified facility is a member of the specified set or returns a |
---|
570 | value of zero to the location specified by @code{member} if the |
---|
571 | specified facility is not a member of the specified set. |
---|
572 | |
---|
573 | @subheading NOTES: |
---|
574 | |
---|
575 | The @code{_POSIX_LOGGING} feature flag is defined to indicate |
---|
576 | this service is available. |
---|
577 | |
---|
578 | @page |
---|
579 | @subsection log_facilityfillset - Manipulate log facility sets |
---|
580 | |
---|
581 | @subheading CALLING SEQUENCE: |
---|
582 | |
---|
583 | @ifset is-C |
---|
584 | @example |
---|
585 | int log_facilityfillset( |
---|
586 | log_facility_set_t *set |
---|
587 | ); |
---|
588 | @end example |
---|
589 | @end ifset |
---|
590 | |
---|
591 | @ifset is-Ada |
---|
592 | @end ifset |
---|
593 | |
---|
594 | @subheading STATUS CODES: |
---|
595 | |
---|
596 | @table @b |
---|
597 | @item EINVAL |
---|
598 | The facilityno argument is not a valid facility. |
---|
599 | |
---|
600 | @end table |
---|
601 | |
---|
602 | @subheading DESCRIPTION: |
---|
603 | |
---|
604 | The facilitysetops primitives manipulate sets of facilities. They |
---|
605 | operate on data objects addressable by the application. |
---|
606 | |
---|
607 | The @code{log_facilityemptyset} function initializes the facility |
---|
608 | set pointed to by the argument @code{set}, such that all facilities |
---|
609 | are included. |
---|
610 | |
---|
611 | Applications shall call either @code{log_facilityemptyset} or |
---|
612 | @code{log_facilityfillset} at least once for each object of type |
---|
613 | @code{log_facilityset_t} prior to any other use of that object. If |
---|
614 | such an object is not initialized in this way, but is nonetheless |
---|
615 | supplied as an argument to any of the @code{log_facilityaddset}, |
---|
616 | @code{logfacilitydelset}, @code{log_facilityismember} or |
---|
617 | @code{log_open} functions, the results are undefined. |
---|
618 | |
---|
619 | The @code{log_facilityaddset} and @code{log_facilitydelset} functions |
---|
620 | respectively add or delete the individual facility specified by the |
---|
621 | value of the argument @code{facilityno} to or from the facility set |
---|
622 | pointed to by the argument @code{set} |
---|
623 | |
---|
624 | The @code{log_facilityismember} function tests whether the facility |
---|
625 | specified by the value of the argument @code{facilityno} is a member |
---|
626 | of the set pointed to by the argument @code{set}. Upon successful |
---|
627 | completion, the @code{log_facilityismember} function either returns |
---|
628 | a value of one to the location specified by @code{member} if the |
---|
629 | specified facility is a member of the specified set or returns a |
---|
630 | value of zero to the location specified by @code{member} if the |
---|
631 | specified facility is not a member of the specified set. |
---|
632 | |
---|
633 | @subheading NOTES: |
---|
634 | |
---|
635 | The @code{_POSIX_LOGGING} feature flag is defined to indicate |
---|
636 | this service is available. |
---|
637 | |
---|
638 | @page |
---|
639 | @subsection log_facilityaddset - Manipulate log facility sets |
---|
640 | |
---|
641 | @subheading CALLING SEQUENCE: |
---|
642 | |
---|
643 | @ifset is-C |
---|
644 | @example |
---|
645 | int log_facilityaddset( |
---|
646 | log_facility_set_t *set, |
---|
647 | log_facility_t facilityno |
---|
648 | ); |
---|
649 | @end example |
---|
650 | @end ifset |
---|
651 | |
---|
652 | @ifset is-Ada |
---|
653 | @end ifset |
---|
654 | |
---|
655 | @subheading STATUS CODES: |
---|
656 | |
---|
657 | @table @b |
---|
658 | @item EINVAL |
---|
659 | The facilityno argument is not a valid facility. |
---|
660 | |
---|
661 | @end table |
---|
662 | |
---|
663 | @subheading DESCRIPTION: |
---|
664 | |
---|
665 | The facilitysetops primitives manipulate sets of facilities. They |
---|
666 | operate on data objects addressable by the application. |
---|
667 | |
---|
668 | The @code{log_facilityemptyset} function initializes the facility |
---|
669 | set pointed to by the argument @code{set}, such that all facilities |
---|
670 | are included. |
---|
671 | |
---|
672 | Applications shall call either @code{log_facilityemptyset} or |
---|
673 | @code{log_facilityfillset} at least once for each object of type |
---|
674 | @code{log_facilityset_t} prior to any other use of that object. If |
---|
675 | such an object is not initialized in this way, but is nonetheless |
---|
676 | supplied as an argument to any of the @code{log_facilityaddset}, |
---|
677 | @code{logfacilitydelset}, @code{log_facilityismember} or |
---|
678 | @code{log_open} functions, the results are undefined. |
---|
679 | |
---|
680 | The @code{log_facilityaddset} and @code{log_facilitydelset} functions |
---|
681 | respectively add or delete the individual facility specified by the |
---|
682 | value of the argument @code{facilityno} to or from the facility set |
---|
683 | pointed to by the argument @code{set} |
---|
684 | |
---|
685 | The @code{log_facilityismember} function tests whether the facility |
---|
686 | specified by the value of the argument @code{facilityno} is a member |
---|
687 | of the set pointed to by the argument @code{set}. Upon successful |
---|
688 | completion, the @code{log_facilityismember} function either returns |
---|
689 | a value of one to the location specified by @code{member} if the |
---|
690 | specified facility is a member of the specified set or returns a |
---|
691 | value of zero to the location specified by @code{member} if the |
---|
692 | specified facility is not a member of the specified set. |
---|
693 | |
---|
694 | @subheading NOTES: |
---|
695 | |
---|
696 | The @code{_POSIX_LOGGING} feature flag is defined to indicate |
---|
697 | this service is available. |
---|
698 | |
---|
699 | @page |
---|
700 | @subsection log_facilitydelset - Manipulate log facility sets |
---|
701 | |
---|
702 | @subheading CALLING SEQUENCE: |
---|
703 | |
---|
704 | @ifset is-C |
---|
705 | @example |
---|
706 | int log_facilitydelset( |
---|
707 | log_facility_set_t *set, |
---|
708 | log_facility_t facilityno |
---|
709 | ); |
---|
710 | @end example |
---|
711 | @end ifset |
---|
712 | |
---|
713 | @ifset is-Ada |
---|
714 | @end ifset |
---|
715 | |
---|
716 | @subheading STATUS CODES: |
---|
717 | |
---|
718 | @table @b |
---|
719 | @item EINVAL |
---|
720 | The facilityno argument is not a valid facility. |
---|
721 | |
---|
722 | @end table |
---|
723 | |
---|
724 | @subheading DESCRIPTION: |
---|
725 | |
---|
726 | The facilitysetops primitives manipulate sets of facilities. They |
---|
727 | operate on data objects addressable by the application. |
---|
728 | |
---|
729 | The @code{log_facilityemptyset} function initializes the facility |
---|
730 | set pointed to by the argument @code{set}, such that all facilities |
---|
731 | are included. |
---|
732 | |
---|
733 | Applications shall call either @code{log_facilityemptyset} or |
---|
734 | @code{log_facilityfillset} at least once for each object of type |
---|
735 | @code{log_facilityset_t} prior to any other use of that object. If |
---|
736 | such an object is not initialized in this way, but is nonetheless |
---|
737 | supplied as an argument to any of the @code{log_facilityaddset}, |
---|
738 | @code{logfacilitydelset}, @code{log_facilityismember} or |
---|
739 | @code{log_open} functions, the results are undefined. |
---|
740 | |
---|
741 | The @code{log_facilityaddset} and @code{log_facilitydelset} functions |
---|
742 | respectively add or delete the individual facility specified by the |
---|
743 | value of the argument @code{facilityno} to or from the facility set |
---|
744 | pointed to by the argument @code{set} |
---|
745 | |
---|
746 | The @code{log_facilityismember} function tests whether the facility |
---|
747 | specified by the value of the argument @code{facilityno} is a member |
---|
748 | of the set pointed to by the argument @code{set}. Upon successful |
---|
749 | completion, the @code{log_facilityismember} function either returns |
---|
750 | a value of one to the location specified by @code{member} if the |
---|
751 | specified facility is a member of the specified set or returns a |
---|
752 | value of zero to the location specified by @code{member} if the |
---|
753 | specified facility is not a member of the specified set. |
---|
754 | |
---|
755 | @subheading NOTES: |
---|
756 | |
---|
757 | The @code{_POSIX_LOGGING} feature flag is defined to indicate |
---|
758 | this service is available. |
---|
759 | |
---|
760 | @page |
---|
761 | @subsection log_facilityismember - Manipulate log facility sets |
---|
762 | |
---|
763 | @subheading CALLING SEQUENCE: |
---|
764 | |
---|
765 | @ifset is-C |
---|
766 | @example |
---|
767 | int log_facilityismember( |
---|
768 | const log_facility_set_t *set, |
---|
769 | log_facility_t facilityno, |
---|
770 | const int *member |
---|
771 | ); |
---|
772 | @end example |
---|
773 | @end ifset |
---|
774 | |
---|
775 | @ifset is-Ada |
---|
776 | @end ifset |
---|
777 | |
---|
778 | @subheading STATUS CODES: |
---|
779 | |
---|
780 | @table @b |
---|
781 | @item EINVAL |
---|
782 | The facilityno argument is not a valid facility. |
---|
783 | |
---|
784 | @end table |
---|
785 | |
---|
786 | @subheading DESCRIPTION: |
---|
787 | |
---|
788 | The facilitysetops primitives manipulate sets of facilities. They |
---|
789 | operate on data objects addressable by the application. |
---|
790 | |
---|
791 | The @code{log_facilityemptyset} function initializes the facility |
---|
792 | set pointed to by the argument @code{set}, such that all facilities |
---|
793 | are included. |
---|
794 | |
---|
795 | Applications shall call either @code{log_facilityemptyset} or |
---|
796 | @code{log_facilityfillset} at least once for each object of type |
---|
797 | @code{log_facilityset_t} prior to any other use of that object. If |
---|
798 | such an object is not initialized in this way, but is nonetheless |
---|
799 | supplied as an argument to any of the @code{log_facilityaddset}, |
---|
800 | @code{logfacilitydelset}, @code{log_facilityismember} or |
---|
801 | @code{log_open} functions, the results are undefined. |
---|
802 | |
---|
803 | The @code{log_facilityaddset} and @code{log_facilitydelset} functions |
---|
804 | respectively add or delete the individual facility specified by the |
---|
805 | value of the argument @code{facilityno} to or from the facility set |
---|
806 | pointed to by the argument @code{set} |
---|
807 | |
---|
808 | The @code{log_facilityismember} function tests whether the facility |
---|
809 | specified by the value of the argument @code{facilityno} is a member |
---|
810 | of the set pointed to by the argument @code{set}. Upon successful |
---|
811 | completion, the @code{log_facilityismember} function either returns |
---|
812 | a value of one to the location specified by @code{member} if the |
---|
813 | specified facility is a member of the specified set or returns a |
---|
814 | value of zero to the location specified by @code{member} if the |
---|
815 | specified facility is not a member of the specified set. |
---|
816 | |
---|
817 | @subheading NOTES: |
---|
818 | |
---|
819 | The @code{_POSIX_LOGGING} feature flag is defined to indicate |
---|
820 | this service is available. |
---|
821 | |
---|
822 | @page |
---|
823 | @subsection log_create - Creates a log file |
---|
824 | |
---|
825 | @subheading CALLING SEQUENCE: |
---|
826 | |
---|
827 | @ifset is-C |
---|
828 | @example |
---|
829 | int log_create( |
---|
830 | logd_t *ld, |
---|
831 | const char *path, |
---|
832 | ); |
---|
833 | @end example |
---|
834 | @end ifset |
---|
835 | |
---|
836 | @ifset is-Ada |
---|
837 | @end ifset |
---|
838 | |
---|
839 | @subheading STATUS CODES: |
---|
840 | |
---|
841 | @table @b |
---|
842 | @item ENOMEM |
---|
843 | The is ???????????? |
---|
844 | |
---|
845 | @end table |
---|
846 | |
---|
847 | @subheading DESCRIPTION: |
---|
848 | |
---|
849 | This function dynamically allocates memory for the @code{ld}, associates |
---|
850 | a directory path to the @code{Ld}, and provides access permissions to the |
---|
851 | @code{ld}. |
---|
852 | |
---|
853 | @subheading NOTES: |
---|
854 | |
---|
855 | The @code{_POSIX_LOGGING} feature flag is defined to indicate |
---|
856 | this service is available. |
---|
857 | |
---|
858 | @page |
---|
859 | @subsection log_sys_create - Creates a system log file |
---|
860 | |
---|
861 | @subheading CALLING SEQUENCE: |
---|
862 | |
---|
863 | @ifset is-C |
---|
864 | @example |
---|
865 | int log_sys_create(); |
---|
866 | @end example |
---|
867 | @end ifset |
---|
868 | |
---|
869 | @ifset is-Ada |
---|
870 | @end ifset |
---|
871 | |
---|
872 | @subheading STATUS CODES: |
---|
873 | |
---|
874 | @table @b |
---|
875 | @item EEXIST |
---|
876 | The directory path to the system log already exist. |
---|
877 | |
---|
878 | @end table |
---|
879 | |
---|
880 | @subheading DESCRIPTION: |
---|
881 | |
---|
882 | This function will create a predefined system log directory path and |
---|
883 | system log file if they do not already exist. |
---|
884 | |
---|
885 | @subheading NOTES: |
---|
886 | |
---|
887 | The @code{_POSIX_LOGGING} feature flag is defined to indicate |
---|
888 | this service is available. |
---|