Back to home page

Enduro/X

 
 

    


0001 TPLOGFPLOCK(3)
0002 ==============
0003 :doctype: manpage
0004 
0005 
0006 NAME
0007 ----
0008 tplogfplock - Lock log file FILE pointer
0009 
0010 
0011 SYNOPSIS
0012 --------
0013 #include <ndebug.h>
0014 
0015 ndrx_debug_t * tplogfplock(int 'lev', long 'flags');
0016 
0017 Link with '-lnstd -lpthread -lrt -lm'
0018 
0019 DESCRIPTION
0020 -----------
0021 Function locks the current FILE pointer for *tp* logging topic. When lock is acquired,
0022 any log rotate or log file changing manipulations by other threads would be delayed.
0023 
0024 This function typically must be called prior reading getting the FILE pointer by
0025 *tplogfpget(3)* function. The locked file pointer shall be released by *tplogfpunlock(3)*
0026 after it is no more in use.
0027 
0028 'lev' argument shall be set to log level planning to write the data to FILE pointer.
0029 If current log level is lower then 'lev' set, function returns *NULL*, meaning it is not
0030 locked and no logging needed. However if no log level check is needed, the 'lev' argument
0031 shall be passed as *-1*.
0032 
0033 'flags' is reserved for future use.
0034 
0035 RETURN VALUE
0036 ------------
0037 Pointer to debug descriptor or *NULL* if no logging is required.
0038 
0039 ERRORS
0040 ------
0041 N/A
0042 
0043 EXAMPLE
0044 -------
0045 See *atmitest/test031_logging/atmiclt31.c* for sample code.
0046 
0047 BUGS
0048 ----
0049 Report bugs to support@mavimax.com
0050 
0051 SEE ALSO
0052 --------
0053 *tplogfpget(3)* *tplogfpunlock(3)*
0054 
0055 COPYING
0056 -------
0057 (C) Mavimax, Ltd
0058