BSD 4_4 development
[unix-history] / usr / share / man / cat3 / errx.0
ERR(3) BSD Programmer's Manual ERR(3)
N\bNA\bAM\bME\bE
e\ber\brr\br, v\bve\ber\brr\br, e\ber\brr\brx\bx, v\bve\ber\brr\brx\bx, w\bwa\bar\brn\bn, v\bvw\bwa\bar\brn\bn, w\bwa\bar\brn\bnx\bx, v\bvw\bwa\bar\brn\bnx\bx - formatted error mes-
sages
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
#\b#i\bin\bnc\bcl\blu\bud\bde\be <\b<e\ber\brr\br.\b.h\bh>\b>
_\bv_\bo_\bi_\bd
e\ber\brr\br(_\bi_\bn_\bt _\be_\bv_\ba_\bl, _\bc_\bo_\bn_\bs_\bt _\bc_\bh_\ba_\br _\b*_\bf_\bm_\bt, _\b._\b._\b.);
_\bv_\bo_\bi_\bd
v\bve\ber\brr\br(_\bi_\bn_\bt _\be_\bv_\ba_\bl, _\bc_\bo_\bn_\bs_\bt _\bc_\bh_\ba_\br _\b*_\bf_\bm_\bt, _\bv_\ba_\b__\bl_\bi_\bs_\bt _\ba_\br_\bg_\bs);
_\bv_\bo_\bi_\bd
e\ber\brr\brx\bx(_\bi_\bn_\bt _\be_\bv_\ba_\bl, _\bc_\bo_\bn_\bs_\bt _\bc_\bh_\ba_\br _\b*_\bf_\bm_\bt, _\b._\b._\b.);
_\bv_\bo_\bi_\bd
v\bve\ber\brr\brx\bx(_\bi_\bn_\bt _\be_\bv_\ba_\bl, _\bc_\bo_\bn_\bs_\bt _\bc_\bh_\ba_\br _\b*_\bf_\bm_\bt, _\bv_\ba_\b__\bl_\bi_\bs_\bt _\ba_\br_\bg_\bs);
_\bv_\bo_\bi_\bd
w\bwa\bar\brn\bn(_\bc_\bo_\bn_\bs_\bt _\bc_\bh_\ba_\br _\b*_\bf_\bm_\bt, _\b._\b._\b.);
_\bv_\bo_\bi_\bd
v\bvw\bwa\bar\brn\bn(_\bc_\bo_\bn_\bs_\bt _\bc_\bh_\ba_\br _\b*_\bf_\bm_\bt, _\bv_\ba_\b__\bl_\bi_\bs_\bt _\ba_\br_\bg_\bs);
_\bv_\bo_\bi_\bd
w\bwa\bar\brn\bnx\bx(_\bc_\bo_\bn_\bs_\bt _\bc_\bh_\ba_\br _\b*_\bf_\bm_\bt, _\b._\b._\b.);
_\bv_\bo_\bi_\bd
v\bvw\bwa\bar\brn\bnx\bx(_\bc_\bo_\bn_\bs_\bt _\bc_\bh_\ba_\br _\b*_\bf_\bm_\bt, _\bv_\ba_\b__\bl_\bi_\bs_\bt _\ba_\br_\bg_\bs);
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
The e\ber\brr\br() and w\bwa\bar\brn\bn() 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 _\bf_\bm_\bt
argument is not NULL, the formatted error message, a colon character, and
a space are output. In the case of the e\ber\brr\br(), v\bve\ber\brr\br(), w\bwa\bar\brn\bn(), and
v\bvw\bwa\bar\brn\bn() functions, the error message string affiliated with the current
value of the global variable _\be_\br_\br_\bn_\bo is output. In all cases, the output
is followed by a newline character.
The e\ber\brr\br(), v\bve\ber\brr\br(), e\ber\brr\brx\bx(), and v\bve\ber\brr\brx\bx() functions do not return, but exit
with the value of the argument _\be_\bv_\ba_\bl.
E\bEX\bXA\bAM\bMP\bPL\bLE\bES\bS
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);
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
strerror(3)
H\bHI\bIS\bST\bTO\bOR\bRY\bY
The e\ber\brr\br() and w\bwa\bar\brn\bn() functions first appeared in 4.4BSD.
4th Berkeley Distribution June 9, 1993 2