OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [doc/] [new_chapters/] [eventlog.t] - Blame information for rev 1765

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.