source: rtems/doc/new_chapters/eventlog.t @ 82db2d3a

4.104.114.84.95
Last change on this file since 82db2d3a was 82db2d3a, checked in by Joel Sherrill <joel.sherrill@…>, on 08/28/98 at 19:59:44

Reviewed log_read().

  • Property mode set to 100644
File size: 26.3 KB
Line 
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
13The event logging manager provides a portable method for logging
14system and application events and subsequent processing of those
15events.  The capabilities in this manager were defined in the POSIX
161003.1h/D3 proposed standard titled @b{Services for Reliable,
17Available, and Serviceable Systems}.
18
19The directives provided by the event logging manager are:
20
21@itemize @bullet
22@item @code{log_write} - Write to the system Log
23@item @code{log_write_any} - Write to any log file
24@item @code{log_write_entry} - Write entry to any log file
25@item @code{log_open} - Open a log file
26@item @code{log_read} - Read from a log file
27@item @code{log_notify} - Notify Process of writes to the system log
28@item @code{log_close} - Close log descriptor
29@item @code{log_seek} - Reposition log file offset
30@item @code{log_severity_before} - Compare event record severities
31@item @code{log_facilityemptyset} - Manipulate log facility sets
32@item @code{log_facilityfillset} - Manipulate log facility sets
33@item @code{log_facilityaddset} - Manipulate log facility sets
34@item @code{log_facilitydelset} - Manipulate log facility sets
35@item @code{log_facilityismember} - Manipulate log facility sets
36@end itemize
37
38@section Background
39
40@subsection Log Files and Events
41
42System log
43
44Non-system logs
45
46Events, facility, severity
47
48@subsection Queries
49
50@section Operations
51
52@subsection Creating and Writing a non-System Log
53
54Discuss creating and writing to a non-system log.
55
56@example
57  log_create
58  log_write loop
59@end example
60
61@subsection Reading a Log
62
63Discuss opening and reading from a log.
64
65@example
66  build a query
67  log_open
68  log_read loop
69@end example
70
71@section Directives
72
73This section details the event logging manager's directives.
74A subsection is dedicated to each of this manager's directives
75and describes the calling sequence, related constants, usage,
76and status codes.
77
78@page
79@subsection log_write - Write to the system Log
80
81@subheading CALLING SEQUENCE:
82
83@ifset is-C
84@example
85#include <evlog.h>
86
87int log_write(
88  const log_facility_t  facility,
89  const int             event_id,
90  const log_severity_t  severity,
91  const void           *buf,
92  const size_t          len
93);
94@end example
95@end ifset
96
97@ifset is-Ada
98@end ifset
99
100@subheading STATUS CODES:
101
102@table @b
103@item E2BIG
104This error indicates an inconsistency in the implementation.
105Report this as a bug.
106
107@item EINVAL
108The @code{facility} argument is not a valid log facility.
109
110@item EINVAL
111The @code{severity} argument exceeds @code{LOG_SEVERITY_MAX}.
112
113@item EINVAL
114The @code{len} argument exceeds @code{LOG_MAXIUM_BUFFER_SIZE}.
115
116@item EINVAL
117The @code{len} argument was non-zero and @code{buf} is NULL.
118
119@item ENOSPC
120The device which contains the log file has run out of space.
121
122@item EIO
123An I/O error occurred in writing to the log file.
124
125@end table
126
127@subheading DESCRIPTION:
128
129The @code{log_write_any} function writes an event record to the
130system log file.  The event record written consists of the
131event attributes specified by the @code{facility}, @code{event_id},
132and @code{severity} arguments as well as the data identified by the
133@code{buf} and @code{len} arguments.  The fields of the event record
134structure to be written are filled in as follows:
135
136@table @b
137@item log_recid
138This is set to a monotonically increasing log record id
139maintained by the system for this individual log file.
140
141@item log_size
142This is set to the value of the @code{len} argument.
143
144@item log_event_id
145This is set to the value of the @code{event_id} argument.
146
147@item log_facility
148This is set to the value of the @code{facility} argument.
149
150@item log_severity
151This is set to the value of the @code{severity} argument.
152
153@item log_uid
154This is set to the value returned by @code{geteuid}.
155
156@item log_gid
157This is set to the value returned by @code{getegid}.
158
159@item log_pid
160This is set to the value returned by @code{getpid}.
161
162@item log_pgrp
163This is set to the value returned by @code{getpgrp}.
164
165@item log_time
166This is set to the value returned by @code{clock_gettime} for the
167CLOCK_REALTIME clock source.
168
169@end table
170
171@subheading NOTES:
172
173The @code{_POSIX_LOGGING} feature flag is defined to indicate
174this service is available.
175
176This implementation can not return the @code{EPERM} error.
177
178@page
179@subsection log_write_any - Write to the any log file
180
181@subheading CALLING SEQUENCE:
182
183@ifset is-C
184@example
185#include <evlog.h>
186
187int log_write_any(
188  const logd_t          logdes,
189  const log_facility_t  facility,
190  const int             event_id,
191  const log_severity_t  severity,
192  const void           *buf,
193  const size_t          len
194);
195@end example
196@end ifset
197 
198@ifset is-Ada
199@end ifset
200
201@subheading STATUS CODES:
202
203@table @b
204@item E2BIG
205This error indicates an inconsistency in the implementation.
206Report this as a bug.
207
208@item EBADF
209The @code{logdes} argument is not a valid log descriptor.
210
211@item EINVAL
212The @code{facility} argument is not a valid log facility.
213
214@item EINVAL
215The @code{severity} argument exceeds @code{LOG_SEVERITY_MAX}.
216
217@item EINVAL
218The @code{len} argument exceeds @code{LOG_MAXIMUM_BUFFER_SIZE}.
219
220@item EINVAL
221The @code{len} argument was non-zero and @code{buf} is NULL.
222
223@item ENOSPC
224The device which contains the log file has run out of space.
225
226@item EIO
227An I/O error occurred in writing to the log file.
228
229@end table
230
231@subheading DESCRIPTION:
232
233The @code{log_write_any} function writes an event record to the log file
234specified by @code{logdes}.  The event record written consists of the
235event attributes specified by the @code{facility}, @code{event_id},
236and @code{severity} arguments as well as the data identified by the
237@code{buf} and @code{len} arguments.  The fields of the event record
238structure to be written are filled in as follows:
239
240@table @b
241@item log_recid
242This is set to a monotonically increasing log record id
243maintained by the system for this individual log file.
244
245@item log_size
246This is set to the value of the @code{len} argument.
247
248@item log_event_id
249This is set to the value of the @code{event_id} argument.
250
251@item log_facility
252This is set to the value of the @code{facility} argument.
253
254@item log_severity
255This is set to the value of the @code{severity} argument.
256
257@item log_uid
258This is set to the value returned by @code{geteuid}.
259
260@item log_gid
261This is set to the value returned by @code{getegid}.
262
263@item log_pid
264This is set to the value returned by @code{getpid}.
265
266@item log_pgrp
267This is set to the value returned by @code{getpgrp}.
268
269@item log_time
270This is set to the value returned by @code{clock_gettime} for the
271CLOCK_REALTIME clock source.
272
273@end table
274
275@subheading NOTES:
276
277The @code{_POSIX_LOGGING} feature flag is defined to indicate
278this service is available.
279
280This implementation can not return the @code{EPERM} error.
281
282This function is not defined in the POSIX specification.  It is
283an extension provided by this implementation.
284
285@page
286@subsection log_write_entry - Write entry to any log file
287
288@subheading CALLING SEQUENCE:
289
290@ifset is-C
291@example
292#include <evlog.h>
293
294int log_write_entry(
295  const logd_t      logdes,
296  struct log_entry *entry,
297  const void       *buf,
298  const size_t      len
299);
300@end example
301@end ifset
302 
303@ifset is-Ada
304@end ifset
305
306@subheading STATUS CODES:
307
308@table @b
309@item E2BIG
310This error indicates an inconsistency in the implementation.
311Report this as a bug.
312
313@item EBADF
314The @code{logdes} argument is not a valid log descriptor.
315
316@item EFAULT
317The @code{entry} argument is not a valid pointer to a log entry.
318
319@item EINVAL
320The @code{facility} field in @code{entry} is not a valid log facility.
321
322@item EINVAL
323The @code{severity} field in @code{entry} exceeds @code{LOG_SEVERITY_MAX}.
324
325@item EINVAL
326The @code{len} argument exceeds @code{LOG_MAXIMUM_BUFFER_SIZE}.
327
328@item EINVAL
329The @code{len} argument was non-zero and @code{buf} is NULL.
330
331@item ENOSPC
332The device which contains the log file has run out of space.
333
334@item EIO
335An I/O error occurred in writing to the log file.
336
337@end table
338
339@subheading DESCRIPTION:
340
341The @code{log_write_entry} function writes an event record
342specified by the @code{entry}, @code{buf}, and @code{len} arguments.
343Most of the fields of the event record pointed to by @code{entry}
344are left intact.  The following fields are filled in as follows:
345
346@table @b
347@item log_recid
348This is set to a monotonically increasing log record id
349maintained by the system for this individual log file.
350
351@item log_size
352This is set to the value of the @code{len} argument.
353
354@end table
355
356This allows existing log entries from one log file to be written to
357another log file without destroying the logged information.
358
359@subheading NOTES:
360
361The @code{_POSIX_LOGGING} feature flag is defined to indicate
362this service is available.
363
364This implementation can not return the @code{EPERM} error.
365
366This function is not defined in the POSIX specification.  It is
367an extension provided by this implementation.
368
369@page
370@subsection log_open - Open a log file
371
372@subheading CALLING SEQUENCE:
373
374@ifset is-C
375@example
376#include <evlog.h>
377
378int log_open(
379  logd_t               *logdes,
380  const char           *path,
381  const log_query_t    *query
382);
383@end example
384@end ifset
385
386@ifset is-Ada
387@end ifset
388
389@subheading STATUS CODES:
390
391@table @b
392@item EACCES
393Search permission is denied on a component of the path prefix,
394or the log file exists and read permission is denied.
395
396@item  EINTR
397A signal interrupted the call to log_open().
398
399@item EINVAL
400The log_severity field of the query argument exceeds
401@code{LOG_SEVERITY_MAX}.
402
403@item EINVAL
404The path argument referred to a file that was not a log file.
405
406@item EMFILE
407Too many log file descriptors are currently in use by this
408process.
409
410@item ENAMETOOLONG
411The length of the path string exceeds @code{PATH_MAX}, or a pathname
412component is longer than @code{NAME_MAX} while @code{_POSIX_NO_TRUNC} is
413in effect.
414
415@item ENFILE
416Too many files are currently open in the system.
417
418@item ENOENT
419The file specified by the path argument does not exist.
420
421@item ENOTDIR
422A component of the path prefix is not a directory.
423
424@end table
425
426@subheading DESCRIPTION:
427
428The @code{log_open} function establishes the connection between a
429log file and a log file descriptor.  It creates an open log file
430descriptor that refers to this query stream on the specified log file
431The log file descriptor is used by the other log functions to refer
432to that log query stream.  The @code{path} argument points to a
433pathname for a log file.  A @code{path} argument of NULL specifies
434the current system log file. 
435
436The @code{query} argument is not NULL, then it points to a log query
437specification that is used to filter the records in the log file on
438subsequent @code{log_read} operations.  This restricts the set of
439event records read using the returned log file descriptor to those
440which match the query.  A query match occurs for a given record when
441that record's facility is a member of the query's facility set and
442the record's severity is greater than or equal to the severity specified
443in the query.
444
445If the value of the @code{query} argument is NULL, no query filter
446shall be applied.
447
448@subheading NOTES:
449
450The @code{_POSIX_LOGGING} feature flag is defined to indicate
451this service is available.
452
453POSIX specifies that @code{EINVAL} will be returned if the
454@code{log_facilities} field of the @code{query} argument is not
455a valid facility set.  In this implementation, this condition
456can never occur.
457
458Many error codes that POSIX specifies to be returned by @code{log_open}
459should actually be detected by @code{open} and passed back by the
460@code{log_open} implementation.  In this implementation, @code{EACCESS},
461@code{EMFILE}, @code{ENAMETOOLONG}, @code{ENFILE}, @code{ENOENT},
462and @code{ENOTDIR} are detected in this manner.
463
464@page
465@subsection log_read - Read from a log file
466
467@subheading CALLING SEQUENCE:
468
469@ifset is-C
470@example
471#include <evlog.h>
472
473int log_read(
474  const logd_t      logdes,
475  struct log_entry *entry,
476  void             *log_buf,
477  const size_t      log_len,
478  const size_t     *log_sizeread
479);
480@end example
481@end ifset
482
483@ifset is-Ada
484@end ifset
485
486@subheading STATUS CODES:
487
488@table @b
489@item E2BIG
490This error indicates an inconsistency in the implementation.
491Report this as a bug.
492
493@item EBADF
494The @code{logdes} argument is not a valid log file descriptor.
495
496@item EFAULT
497The @code{entry} argument is not a valid pointer to a log entry structure.
498
499@item EFAULT
500The @code{log_sizeread} argument is not a valid pointer to a size_t.
501
502@item EBUSY
503No data available.  There are no unread event records remaining
504in this log file.
505
506@item EINTR
507A signal interrupted the call to log_read().
508
509@item EIO
510An I/O error occurred in reading from the event log.
511
512@item EINVAL
513The matching event record has data associated with it and
514@code{log_buf} was not a valid pointer.
515
516@item EINVAL
517The matching event record has data associated with it which is
518longer than @code{log_len}.
519
520@end table
521
522@subheading DESCRIPTION:
523
524The @code{log_read} function reads the @code{log_entry}
525structure and up to @code{log_len} bytes of data from the next
526event record of the log file associated with the open log file
527descriptor @code{logdes}.  The event record read is placed
528into the @code{log_entry} structure pointed to by
529@code{entry} and any data into the buffer pointed to by @code{log_buf}.
530The log record ID of the returned event record is be stored in the
531@code{log_recid} member of the @code{log_entry} structure for the event
532record.
533
534If the query attribute of the open log file description associated with
535the @code{logdes} is set, the event record read will match that query.
536
537If the @code{log_read} is successful the call stores the actual length
538of the data associated with the event record into the location specified by
539@code{log_sizeread}.  This number will be less than or equal to
540@code{log_len}.
541
542@subheading NOTES:
543
544The @code{_POSIX_LOGGING} feature flag is defined to indicate
545this service is available.
546
547When @code{EINVAL} is returned, then no data is returned although the
548event record is returned.  This is an extension to the POSIX specification.
549
550The POSIX specification specifically allows @code{log_read} to write
551greater than @code{log_len} bytes into @code{log_buf}.  This is highly
552undesirable and this implementation will NOT do this.
553
554@page
555@subsection log_notify - Notify Process of writes to the system log.
556
557@subheading CALLING SEQUENCE:
558
559@ifset is-C
560@example
561#include <evlog.h>
562
563int log_notify(
564  const logd_t           logdes,
565  const struct sigevent *notification
566);
567@end example
568@end ifset
569
570@ifset is-Ada
571@end ifset
572
573@subheading STATUS CODES:
574
575@table @b
576@item EBADF
577The logdes argument is not a valid log file descriptor.
578
579@item EINVAL
580The notification argument specifies an invalid signal.
581
582@item EINVAL
583The process has requested a notify on a log that will not be
584written to.
585
586@item ENOSYS
587The function log_notify() is not supported by this implementation.
588
589@end table
590
591@subheading DESCRIPTION:
592
593If the argument @code{notification} is not NULL this function registers
594the calling process to be notified of event records received by the system
595log, which match the query parameters associated with the open log descriptor
596specified by @code{logdes}.  The notification specified by the
597@code{notification} argument shall be sent to the process when an event
598record received by the system log is matched by the query attribute of the
599open log file description associated with the @code{logdes} log file
600descriptor.  If the calling process has already registered a notification
601for the @code{logdes} log file descriptor, the new notification shall
602replace the existing notification registration.
603
604If the @code{notification} argument is NULL and the calling process is
605currently registered to be notified for the @code{logdes} log file
606descriptor, the existing registration shall be removed.
607
608@subheading NOTES:
609
610The @code{_POSIX_LOGGING} feature flag is defined to indicate
611this service is available.
612
613@page
614@subsection log_close - Close log descriptor
615
616@subheading CALLING SEQUENCE:
617
618@ifset is-C
619@example
620#include <evlog.h>
621
622int log_close(
623  const logd_t   logdes
624);
625@end example
626@end ifset
627
628@ifset is-Ada
629@end ifset
630
631@subheading STATUS CODES:
632
633@table @b
634@item EBADF
635The logdes argument is not a valid log file descriptor.
636
637@end table
638
639@subheading DESCRIPTION:
640
641The @code{log_close} function deallocates the open log file descriptor
642indicated by @code{log_des}.
643
644When all log file descriptors associated with an open log file description
645have been closed, the open log file description is freed.
646
647If the link count of the log file is zero, when all log file descriptors
648have been closed, the space occupied by the log file is freed and the
649log file shall no longer be accessible.
650
651If the process has successfully registered a notification request for the
652log file descriptor, the registration is removed.
653
654@subheading NOTES:
655
656The @code{_POSIX_LOGGING} feature flag is defined to indicate
657this service is available.
658
659@page
660@subsection log_seek - Reposition log file offset
661
662@subheading CALLING SEQUENCE:
663
664@ifset is-C
665@example
666#include <evlog.h>
667
668int log_seek(
669  const logd_t    logdes,
670  log_recid_t     log_recid
671);
672@end example
673@end ifset
674
675@ifset is-Ada
676@end ifset
677
678@subheading STATUS CODES:
679
680@table @b
681@item EBADF
682The @code{logdes} argument is not a valid log file descriptor.
683
684@end table
685
686@subheading DESCRIPTION:
687
688The @code{log_seek} function sets the log file offset of the open
689log description associated with the @code{logdes} log file descriptor
690to the event record in the log file identified by @code{log_recid}. 
691The @code{log_recid} argument is either the record id of a valid event
692record or one of the following values, as defined in the header <evlog.h>:
693
694@table @b
695@item LOG_SEEK_START
696Set log file position to point at the first event
697record in the log file.
698
699@item LOG_SEEK_END
700Set log file position to point after the last event
701record in the log file.
702
703@end table
704
705@subheading NOTES:
706
707The @code{_POSIX_LOGGING} feature flag is defined to indicate
708this service is available.
709
710This implementation can not return @code{EINTR}.
711
712This implementation can not return @code{EINVAL} to indicate that
713the @code{log_recid} argument is not a valid record id.
714
715@page
716@subsection log_severity_before - Compare event record severities
717
718@subheading CALLING SEQUENCE:
719
720@ifset is-C
721@example
722#include <evlog.h>
723
724int log_severity_before(
725  log_severity_t  s1,
726  log_severity_t  s2
727);
728@end example
729@end ifset
730
731@ifset is-Ada
732@end ifset
733
734@subheading STATUS CODES:
735
736@table @b
737@item 0
738The severity of @code{s1} is less than that of @code{s2}.
739
740@item 1
741The severity of @code{s1} is greater than or equal that of @code{s2}.
742
743@item EINVAL
744The value of either s1 or s2 exceeds @code{LOG_SEVERITY_MAX}.
745
746@end table
747
748@subheading DESCRIPTION:
749
750The @code{log_severity_before} function compares the severity order
751of the @code{s1} and @code{s2} arguments.  If @code{s1} is of
752severity greater than or equal to that of @code{s2}, then this
753function returns 1.  Otherwise, it returns 0.
754
755If either @code{s1} or @code{s2} specify invalid severity values, the
756return value of @code{log_severity_before} is unspecified.
757
758@subheading NOTES:
759
760The @code{_POSIX_LOGGING} feature flag is defined to indicate
761this service is available.
762
763The POSIX specification of the return value for this function is ambiguous.
764If @code{EINVAL} is equal to 1 in an implementation, then the application
765can not distinguish between greater than and an error condition.
766
767@page
768@subsection log_facilityemptyset - Manipulate log facility sets
769
770@subheading CALLING SEQUENCE:
771
772@ifset is-C
773@example
774#include <evlog.h>
775
776int log_facilityemptyset(
777  log_facility_set_t  *set
778);
779@end example
780@end ifset
781
782@ifset is-Ada
783@end ifset
784
785@subheading STATUS CODES:
786
787@table @b
788@item EFAULT
789The @code{set} argument is an invalid pointer.
790
791@end table
792
793@subheading DESCRIPTION:
794
795The @code{log_facilityemptyset} function initializes the facility
796set pointed to by the argument @code{set}, such that all facilities
797are excluded.
798
799@subheading NOTES:
800
801The @code{_POSIX_LOGGING} feature flag is defined to indicate
802this service is available.
803
804Applications shall call either @code{log_facilityemptyset} or
805@code{log_facilityfillset} at least once for each object of type
806@code{log_facilityset_t} prior to any other use of that object.  If
807such an object is not initialized in this way, but is nonetheless
808supplied as an argument to any of the @code{log_facilityaddset},
809@code{logfacilitydelset}, @code{log_facilityismember} or
810@code{log_open} functions, the results are undefined.
811
812@page
813@subsection log_facilityfillset - Manipulate log facility sets
814
815@subheading CALLING SEQUENCE:
816
817@ifset is-C
818@example
819#include <evlog.h>
820
821int log_facilityfillset(
822  log_facility_set_t  *set
823);
824@end example
825@end ifset
826
827@ifset is-Ada
828@end ifset
829
830@subheading STATUS CODES:
831
832@table @b
833@item EFAULT
834The @code{set} argument is an invalid pointer.
835
836@end table
837
838@subheading DESCRIPTION:
839
840The @code{log_facilityfillset} function initializes the facility
841set pointed to by the argument @code{set}, such that all facilities
842are included.
843
844@subheading NOTES:
845
846The @code{_POSIX_LOGGING} feature flag is defined to indicate
847this service is available.
848
849Applications shall call either @code{log_facilityemptyset} or
850@code{log_facilityfillset} at least once for each object of type
851@code{log_facilityset_t} prior to any other use of that object.  If
852such an object is not initialized in this way, but is nonetheless
853supplied as an argument to any of the @code{log_facilityaddset},
854@code{logfacilitydelset}, @code{log_facilityismember} or
855@code{log_open} functions, the results are undefined.
856
857@page
858@subsection log_facilityaddset - Manipulate log facility sets
859
860@subheading CALLING SEQUENCE:
861
862@ifset is-C
863@example
864#include <evlog.h>
865
866int log_facilityaddset(
867  log_facility_set_t  *set,
868  log_facility_t       facilityno
869);
870@end example
871@end ifset
872
873@ifset is-Ada
874@end ifset
875
876@subheading STATUS CODES:
877
878@table @b
879@item EFAULT
880The @code{set} argument is an invalid pointer.
881
882@item EINVAL
883The @code{facilityno} argument is not a valid facility.
884
885@end table
886
887@subheading DESCRIPTION:
888
889The @code{log_facilityaddset} function adds the individual
890facility specified by the value of the argument @code{facilityno}
891to the facility set pointed to by the argument @code{set}.
892
893@subheading NOTES:
894
895The @code{_POSIX_LOGGING} feature flag is defined to indicate
896this service is available.
897
898Applications shall call either @code{log_facilityemptyset} or
899@code{log_facilityfillset} at least once for each object of type
900@code{log_facilityset_t} prior to any other use of that object.  If
901such an object is not initialized in this way, but is nonetheless
902supplied as an argument to any of the @code{log_facilityaddset},
903@code{logfacilitydelset}, @code{log_facilityismember} or
904@code{log_open} functions, the results are undefined.
905
906@page
907@subsection log_facilitydelset - Manipulate log facility sets
908
909@subheading CALLING SEQUENCE:
910
911@ifset is-C
912@example
913#include <evlog.h>
914
915int log_facilitydelset(
916  log_facility_set_t  *set,
917  log_facility_t       facilityno
918);
919@end example
920@end ifset
921
922@ifset is-Ada
923@end ifset
924
925@subheading STATUS CODES:
926
927@table @b
928@item EFAULT
929The @code{set} argument is an invalid pointer.
930
931@item EINVAL
932The @code{facilityno} argument is not a valid facility.
933
934@end table
935
936@subheading DESCRIPTION:
937
938The @code{log_facilitydelset} function deletes the individual
939facility specified by the value of the argument @code{facilityno}
940from the facility set pointed to by the argument @code{set}.
941
942@subheading NOTES:
943
944The @code{_POSIX_LOGGING} feature flag is defined to indicate
945this service is available.
946
947Applications shall call either @code{log_facilityemptyset} or
948@code{log_facilityfillset} at least once for each object of type
949@code{log_facilityset_t} prior to any other use of that object.  If
950such an object is not initialized in this way, but is nonetheless
951supplied as an argument to any of the @code{log_facilityaddset},
952@code{logfacilitydelset}, @code{log_facilityismember} or
953@code{log_open} functions, the results are undefined.
954
955@page
956@subsection log_facilityismember - Manipulate log facility sets
957
958@subheading CALLING SEQUENCE:
959
960@ifset is-C
961@example
962#include <evlog.h>
963
964int log_facilityismember(
965  const log_facility_set_t *set,
966  log_facility_t            facilityno,
967  const int                *member
968);
969@end example
970@end ifset
971
972@ifset is-Ada
973@end ifset
974
975@subheading STATUS CODES:
976
977@table @b
978@item EFAULT
979The @code{set} or @code{member} argument is an invalid pointer.
980
981@item EINVAL
982The @code{facilityno} argument is not a valid facility.
983
984@end table
985
986@subheading DESCRIPTION:
987
988The @code{log_facilityismember} function tests whether the facility
989specified by the value of the argument @code{facilityno} is a member
990of the set pointed to by the argument @code{set}.  Upon successful
991completion, the @code{log_facilityismember} function either returns
992a value of one to the location specified by @code{member} if the
993specified facility is a member of the specified set or value of
994zero to the location specified by @code{member} if the specified
995facility is not a member of the specified set.
996
997@subheading NOTES:
998
999The @code{_POSIX_LOGGING} feature flag is defined to indicate
1000this service is available.
1001
1002Applications shall call either @code{log_facilityemptyset} or
1003@code{log_facilityfillset} at least once for each object of type
1004@code{log_facilityset_t} prior to any other use of that object.  If
1005such an object is not initialized in this way, but is nonetheless
1006supplied as an argument to any of the @code{log_facilityaddset},
1007@code{logfacilitydelset}, @code{log_facilityismember} or
1008@code{log_open} functions, the results are undefined.
1009
1010@page
1011@subsection log_create - Creates a log file
1012
1013@subheading CALLING SEQUENCE:
1014
1015@ifset is-C
1016@example
1017#include <evlog.h>
1018
1019int log_create(
1020  logd_t       *ld,
1021  const char   *path,
1022);
1023@end example
1024@end ifset
1025
1026@ifset is-Ada
1027@end ifset
1028
1029@subheading STATUS CODES:
1030
1031@table @b
1032@item ENOMEM
1033The is ????????????
1034
1035@end table
1036
1037@subheading DESCRIPTION:
1038
1039This function dynamically allocates memory for the @code{ld}, associates
1040a directory path to the @code{ld}, and provides access permissions to the
1041@code{ld}.
1042
1043@subheading NOTES:
1044
1045The @code{_POSIX_LOGGING} feature flag is defined to indicate
1046this service is available.
1047
1048@page
1049@subsection log_sys_create - Creates a system log file
1050
1051@subheading CALLING SEQUENCE:
1052
1053@ifset is-C
1054@example
1055#include <evlog.h>
1056
1057int log_sys_create();
1058@end example
1059@end ifset
1060
1061@ifset is-Ada
1062@end ifset
1063
1064@subheading STATUS CODES:
1065
1066@table @b
1067@item EEXIST
1068The directory path to the system log already exist.
1069
1070@end table
1071
1072@subheading DESCRIPTION:
1073
1074This function will create a predefined system log directory path and
1075system log file if they do not already exist.
1076
1077@subheading NOTES:
1078
1079The @code{_POSIX_LOGGING} feature flag is defined to indicate
1080this service is available.
Note: See TracBrowser for help on using the repository browser.