3 * printfault.c - Print a socket error message (DOS)
5 * Copyright © 1994 AmiTCP/IP Group,
6 * Network Solutions Development Inc.
8 * Copyright © 2005 Pavel Fedin
11 /****** net.lib/PrintNetFault ************************************************
14 PrintNetFault - socket error messages
17 PrintNetFault(code, banner)
18 void PrintNetFault(LONG, const UBYTE *)
21 The PrintNetFault() function finds the error message corresponding
22 to the code and writes it, followed by a newline, to the standard
23 error or Output() filehandle. If the argument string is non-NULL it
24 is preappended to the message string and separated from it by a
25 colon and space (`: '). If string is NULL only the error message
29 The PrintNetFault() function uses the DOS IO functions.
32 strerror(), perror(), <netinclude:sys/errno.h>
34 ******************************************************************************
38 #include <clib/netlib_protos.h>
40 #include <exec/execbase.h>
41 extern struct ExecBase
*SysBase
;
44 #include <dos/dosextens.h>
46 #include <proto/dos.h>
47 #include <proto/exec.h>
50 PrintNetFault(LONG code
, const UBYTE
*banner
)
52 struct Process
*p
= (struct Process
*)FindTask(NULL
);
53 BPTR Stderr
= p
->pr_CES
? p
->pr_CES
: p
->pr_COS
;
54 const UBYTE
*err
= strerror(errno
);
57 FPuts(Stderr
, (STRPTR
)banner
);
60 FPuts(Stderr
, (STRPTR
)err
);