⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xlog.3

📁 牛顿插值方法求解多项式的系数
💻 3
字号:
.\"(c) Copyright 1992, 1993 by Panagiotis Tsirigotis.\"All rights reserved.  The file named COPYRIGHT specifies the terms .\"and conditions for redistribution..\".\" $Id: xlog.3,v 1.1.1.1 2003/02/19 17:29:27 bbraun Exp $.TH XLOG 3X "15 June 1993"xlog_parms, xlog_create, xlog_destroy, xlog_write, xlog_control -- general purpose logging facility.SH SYNOPSIS.LP.nf.ft B#include "xlog.h".LP.ft Bxlog_h xlog_create( type, id, flags, ... )xlog_e type ;char *id ;int flags ;.LP.ft Bint xlog_parms( type, ... )xlog_e type ;.LP.ft Bvoid xlog_destroy( xlog )xlog_h xlog ;.LP.ft Bvoid xlog_write( xlog, buf, len, flags, ... )xlog_h xlog ;char buf[] ;int len ;int flags ;.LP.ft Bint xlog_control( xlog, cmd, ... )xlog_h xlog ;xlog_cmd_e cmd ;.SH DESCRIPTIONThe purpose of this library is to provide a general purpose logging facilityby providing.I xlogs,logging objects that may be connected to various existent logging facilities.Currently, the only logging facilities supported are.I "syslog(3)"and logging to files.Log entries are timestamped lines which may contain arbitrary information..\" ********************* xlog_create ***********************.LP.B xlog_create()creates a new xlog of the specified.I type.Possible type values are:.RS.TP 20.SB XLOG_SYSLOGVarargs: \fIint facility, int priority\fP.The xlog will be connected to .I "syslog(3)." .I facilitydetermines the syslog facility to use for logged messages and .I priorityis the default message priority..TP.SB XLOG_FILELOGVarargs: \fIchar *pathname, int flags [, int flags]\fP.The xlog will be connected to the file identified by.I pathname.The variable part of the argument list has the same semantics as theargument list of the.I "open(2)"system call..RE.LPAll xlogs have an id, specified by the .I id argument. The.I flagsargument is formed by ORing one or more of the following constants:.RS.TP 20.SB XLOG_NO_ERRNOdo not replace .I "%m" with an explanation of the current value of errno..TP.SB XLOG_NO_SIZECHECK.I "(XLOG_FILELOG only)"do not perform size checks on the file..TP.SB XLOG_PRINT_IDprecede each log entry with the xlog id.TP.SB XLOG_PRINT_PIDprecede each log entry with the process id(the process id will follow the xlog id).RE.LPFlags that do not apply to the xlog are ignored.The contant.SM XLOG_NOFLAGScan be used if you don't want to specify any flags..\" ********************* xlog_parms ***********************.LP.B xlog_parms()sets default parameters for the specified xlog.I type:.RS.TP 20.SB XLOG_SYSLOG3 arguments are expected which correspond one-to-one to the arguments of .I "openlog(3)."The defaults, in case this function is not used, are:"XLOG", LOG_PID + LOG_NOWAIT, LOG_USER.TP.SB XLOG_FILELOGNo action..RE.LP.B xlog_parms()should be invoked before any xlogs of the specified typeare created..\" ********************* xlog_destroy ***********************.LP.B xlog_destroy()destroys an xlog. The action taken depends on the type of the xlog:.RS.TP 20.SB XLOG_SYSLOGif this is the last xlog using syslog, then.I "closelog(3)"is invoked..TP.SB XLOG_FILELOGThe file is closed..RE.\" ********************* xlog_control ***********************.LP.B xlog_control()applies control operations to an xlog. Certain operations are common toall xlogs while others are type-specific. The common ones are:.RS.TP 15.SB XLOG_LINKArgument list: \fIxlog_h link_to\fP.Link the specified xlog to the one provided as argument.(if the argument is.SM NULLany existent link is severed).Linking xlogs has the effect that if one finds an error it uses theother to report it..TP.SB XLOG_CALLBACKArgument list: \fIvoid (*callback)(), void *arg\fP.This function will be invoked in case of error while writing a logentry. It will be given3 arguments: the xlog handle, an integer that indicates the typeof error and the.I arg specified in this call. Possible errors include:.RS.TP 15.SB XLOG_ENOMEMlack of memory.TP.SB XLOG_EOPEN.I "open(2)"failed.TP.SB XLOG_EFSTAT.I "fstat(2)"failed.TP.SB XLOG_ESIZEhard limit exceeded.RE.TP.SB XLOG_SETFLAGArgument list: \fIint flag, int *value\fP.The value of.I flag(one of those listed before) is set according to.I "*value"which should be either 0 or 1.The old flag value is placed in .I "*value.".TP.SB XLOG_GETFLAGArgument list: \fIint flag, int *value\fP.The value of .I flag(one of those listed before) is placed in.I "*value.".RE.LPXlogs of type.B XLOG_SYSLOGalso support the following operations:.RS.TP 15.SB XLOG_FACILITYArgument list: \fIint facility\fP.Sets the syslog facility to the specified value..TP.SB XLOG_LEVELArgument list: \fIint level\fP.Sets the default syslog level for this xlog to the specified value..TP.SB XLOG_PREEXECArgument list: \fIvoid\fP.Prepares the xlog for an impending exec operation.TP.SB XLOG_POSTEXECArgument list: \fIvoid\fP.Informs the xlog that the exec failed.RE.LPXlogs of type.B XLOG_FILELOGalso support the following operations:.RS.TP 15.SB XLOG_LIMITSArgument list: \fIunsigned soft_limit, unsigned hard_limit\fP.Sets soft and hard limits on the size of the file.When any of the limits is exceeded a message is sent to the linked xlog.(if there is no linked xlog, no message is sent)When the soft limit is exceeded a warning message is sent to the linked xlog(if the linked xlog is of the.SB XLOG_SYSLOGtype, the message will be sent at the.I LOG_ALERTlevel).If the exceeded limit is the hard limit, logging is terminated.The actual file size is checked every time this operation is applied tothe file.If logging was terminated because the hard limit was exceeded andthis operation increases the hard limit beyond the actual file size,logging will be resumed..TP.SB XLOG_SIZECHECKArgument list: \fIvoid\fP.Checks the actual file size..TP.SB XLOG_GETFDArgument list: \fIint *value\fP.Places in.I "*value"the file descriptor of the log file..RE.\" ********************* xlog_write ***********************.LP.B xlog_write()writes a message to the specified xlog. A.SM NEWLINEis always appended to the message.The first occurrence of "%m" in.I bufis replaced by a string explaining the current value of.I errno.The.I flagsargument is formed in the same way as in .B xlog_create().One additional constant is available:.RS.TP 20.SB XLOG_SET_LEVEL.I "(XLOG_SYSLOG only)"the next argument is an integer that should be used as the syslog levelfor this message instead of the default level of the xlog..RE.SH "RETURN VALUES".B xlog_create()returns an xlog handle or.SM NULLif it fails..LP.B xlog_control()returns an error code (it returns.SM XLOG_ENOERRORif it is successful)..LP.B xlog_parms()returns an error code (it returns.SM XLOG_ENOERRORif it is successful)..SH "SEE ALSO"openlog(3), syslog(3), closelog(3).SH BUGS.LPOnly the first occurrence of.I "%m"is replaced by an errno explanation..LPThere is no check for cycles when linking xlogs. In particular it ispossible to link a xlog to itself.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -