IBM® Carrier Grade Server X3650 TRevision 3.0 7717. APPENDIX E – POSIX Logging API and QuerySpecification for SysCon17.1 Logging Functions17.1.1 Write to the LogFunction: syscon_log_write()17.1.1.1 Synopsis#include int syscon_log_write(syscon_log_event_type_t event_type, int event_type,syscon_log_severity_t severity, const void *buf, size_t len,int format);17.1.1.2 DescriptionThe syscon_log_write() function writes an event record to the syscon event log. The syscon_log_write()succeeds in writing a complete log record or it leaves the system log unchanged. The event recordconsists of a syscon_log_entry structure (or an implementation-defined object that includes the membersof struct syscon_log_entry) and a copy of the data (if any) referenced by the buf argument.The event record’s log_size member shall be set to the value of the len argument, or to zero if buf isNULL. The len argument specifies the length in bytes of the data referenced by buf. If buf is NULL, orthe len argument is zero, then only the syscon_log_entry structure is included in the event record.If the value of len is greater than {SYSCONLOG_ENTRY_MAXLEN} and buf is not NULL, the result ofthe syscon_log_write() shall be as follows:• If {SYSCONLOG_TRUNCATE} is not defined by the implementation, syscon_log_write() shall fail.• Otherwise, syscon_log_write() will set the {SYSCONLOG_TRUNCATE} flag in the event record’slog_flags member, the event record’s log_size member will be set to{SYSCONLOG_ENTRY_MAXLEN}, and only the first {SYSCONLOG_ENTRY_MAXLEN} bytes of thedata pointed to by buf will be included in the data portion of the event record. If the value of theformat argument is {SYSCONLOG_STRING}, a null character will be stored at the end of the dataportion of the record, so that the truncated string is null-terminated.1If buf is NULL, or the len argument is zero, the event record's log_format member will be set to{SYSCONLOG_NODATA}; otherwise, the event record's log_format member will be set to the value ofthe format argument. The interpretation of this value will be implementation-defined, with the followingexception:A format of {SYSCONLOG_STRING} shall indicate that buf points to a null-terminated character stringwhose length in bytes (including the terminating null character) is len.The event_type argument identifies the type of event record being written. Its value and interpretation areleft to the application or the implementation. The event record’s log_event_type member shall be set tothe value of the event_type argument.1 Note, however, that the implementation is not permitted to accomplish this by settingbuf[SYSCONLOG_ENTRY_MAXLEN-1] to the null character, since buf points to a const buffer.