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