Back to libut API Reference


    #include "libut/ut.h"
    int UT_shle(char *fmt, ...);


This function appends text to the error result buffer of the currently executing control port command.

This function is used only within a callback that implements a control port command. (See the COMMAND CALLBACK in UT_shl_cmd_create(3) for background information).

The fmt argument is a printf(3)-format string, followed by the required printf arguments. It can be called any number of times.

Note that the callback's return value (SHL_OK or SHL_ERROR) ultimately determine whether the command is considered to have succeeded or failed. The error result buffer is only written out to the control port if the callback returns SHL_ERROR.


This function always returns 0.


If libut invokes a command callback because it is parsing a configuration file containing that command, any output that the command generates using UT_shlf(3) or UT_shle(3) is logged (since there is no control port connection to which it can be written). When logged, newlines are converted to '\' characters and truncated if they are too long.


UT_shl_cmd_create(3), UT_shl_hdr(3), UT_shlf(3)


Troy D. Hanson <>