3 * herror.c - print host error message
5 * Copyright © 1994 AmiTCP/IP Group,
6 * Network Solutions Development Inc.
8 * Copyright © 2005 Pavel Fedin
11 /****** net.lib/herror *******************************************************
14 herror - print name resolver error message to stderr.
17 #include <clib/netlib_protos.h>
20 void herror(const char *)
23 The herror() function finds the error message corresponding to the
24 current value of host error using the SocketBaseTags() and writes
25 it, followed by a newline, to the stderr. If the argument string
26 is non-NULL it is used as a prefix to the message string and
27 separated from it by a colon and space (`: '). If the argument is
28 NULL only the error message string is printed.
31 The herror() function requires the stdio functions to be linked.
34 <netinclude:netdb.h>, SocketBaseTagList(), perror()
36 ******************************************************************************
41 #include <proto/socket.h>
42 #include <bsdsocket/socketbasetags.h>
45 herror(const char *banner
)
50 * First fetch the h_errno value to (ULONG)err, and then convert it to
51 * error string pointer.
53 SocketBaseTags(SBTM_GETREF(SBTC_HERRNO
), &err
,
54 SBTM_GETREF(SBTC_HERRNOSTRPTR
), &err
,
58 fputs(banner
, stderr
);