__smf_record() — Record an SMF record

Standards

Standards / Extensions C or C++ Dependencies
z/OS® UNIX both  

Format

#include <unistd.h>

int __smf_record(int smf_record_type,
                 int smf_record_subtype,
                 int smf_record_length,
                 char *smf_record);

General description

The __smf_record() function writes an SMF record pointed to by smf_record of length smf_record_length for SMF record type smf_record_type and subtype smf_record_subtype to the SMF data set.

The service can also be used to determine if a particular type or subtype of SMF record is being recorded to avoid the overhead of data collection if the SMF record is not going to be recorded. See z/OS MVS System Management Facilities (SMF) for more information on SMF record types and layout.

The caller of this service must be permitted to the BPX.SMF facility class profile or must be APF authorized. For information on creating and using this profile and the restrictions on its use, refer to z/OS UNIX System Services Planning.

Returned value

If successful, __smf_record() returns 0.

If unsuccessful, __smf_record() returns -1 and sets errno to one of the following values:
Error Code
Description
EINVAL
The value specified on the length operand was incorrect.
EMVSERR
The SMF service returned a nonzero return code. Use __errno2() to determine why the error occurred. The following reason codes can accompany the return code: JRSMFNotAccepting, JRSMFError, JRBadAddress, or JRInternalError.
ENOMEM
Not enough storage.
EPERM
The calling process is not permitted to the BPX.SMF facility class and the calling process is not APF authorized.

Related information

None.