4.4BSD/usr/share/man/cat3/verrx.0
ERR(3) BSD Programmer's Manual ERR(3)
NNAAMMEE
eerrrr, vveerrrr, eerrrrxx, vveerrrrxx, wwaarrnn, vvwwaarrnn, wwaarrnnxx, vvwwaarrnnxx - formatted error mes-
sages
SSYYNNOOPPSSIISS
##iinncclluuddee <<eerrrr..hh>>
_v_o_i_d
eerrrr(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.);
_v_o_i_d
vveerrrr(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s);
_v_o_i_d
eerrrrxx(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.);
_v_o_i_d
vveerrrrxx(_i_n_t _e_v_a_l, _c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s);
_v_o_i_d
wwaarrnn(_c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.);
_v_o_i_d
vvwwaarrnn(_c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s);
_v_o_i_d
wwaarrnnxx(_c_o_n_s_t _c_h_a_r _*_f_m_t, _._._.);
_v_o_i_d
vvwwaarrnnxx(_c_o_n_s_t _c_h_a_r _*_f_m_t, _v_a___l_i_s_t _a_r_g_s);
DDEESSCCRRIIPPTTIIOONN
The eerrrr() and wwaarrnn() family of functions display a formatted error mes-
sage on the standard error output. In all cases, the last component of
the program name, a colon character, and a space are output. If the _f_m_t
argument is not NULL, the formatted error message, a colon character, and
a space are output. In the case of the eerrrr(), vveerrrr(), wwaarrnn(), and
vvwwaarrnn() functions, the error message string affiliated with the current
value of the global variable _e_r_r_n_o is output. In all cases, the output
is followed by a newline character.
The eerrrr(), vveerrrr(), eerrrrxx(), and vveerrrrxx() functions do not return, but exit
with the value of the argument _e_v_a_l.
EEXXAAMMPPLLEESS
Display the current errno information string and exit:
if ((p = malloc(size)) == NULL)
err(1, NULL);
if ((fd = open(file_name, O_RDONLY, 0)) == -1)
err(1, "%s", file_name);
Display an error message and exit:
if (tm.tm_hour < START_TIME)
errx(1, "too early, wait until %s", start_time_string);
Warn of an error:
if ((fd = open(raw_device, O_RDONLY, 0)) == -1)
warnx("%s: %s: trying the block device",
raw_device, strerror(errno));
if ((fd = open(block_device, O_RDONLY, 0)) == -1)
err(1, "%s", block_device);
SSEEEE AALLSSOO
strerror(3)
HHIISSTTOORRYY
The eerrrr() and wwaarrnn() functions first appeared in 4.4BSD.
4th Berkeley Distribution June 9, 1993 2