trace_logf()

QNX SDP8.0C Library ReferenceAPIDeveloper

Insert a user string trace event

Synopsis:

#include <sys/neutrino.h>
#include <sys/trace.h>

int trace_logf( int code,
                const char *fmt, ...);

Arguments:

code
The event code, which must be in the range from _NTO_TRACE_USERFIRST through _NTO_TRACE_USERLAST.
fmt
A printf()-style formatting string. This must be followed by additional arguments that provide the items required by the fmt string.
Note:
You can't use any floating-point formatting codes or parameters; use a function such as sprintf() to format floating-point data in a temporary buffer, and then pass it to trace_logf() using a %s format.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The trace_logf() function calls TraceEvent() to insert a user string event of class _NTO_TRACE_USER, and of the type specified by code.

Returns:

The number of bytes written in the log, including the terminating null character, or -1 if an error occurred (errno is set).

Errors:

ENOMEM
Insufficient memory to complete the operation.

Classification:

QNX OS

Safety:
Cancellation pointNo
Signal handlerYes
ThreadYes
Page updated: