source: rtems/doc/new_chapters/eventlog.t @ 90c60f7

4.104.114.84.95
Last change on this file since 90c60f7 was 90c60f7, checked in by Wade A Smith <warm38@…>, on 08/31/98 at 15:39:03

Updated the descriptions section for the log_create and log_sys_create
functions.d

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