3 * printuserfault.c - Print a usergroup error message (DOS)
5 * Copyright © 1994 AmiTCP/IP Group,
6 * Network Solutions Development Inc.
8 * Copyright © 2005 Pavel Fedin
11 /****** net.lib/PrintUserFault ************************************************
14 PrintUserFault - socket error messages
17 PrintUserFault(code, banner)
18 void PrintUserFault(LONG, const UBYTE *)
21 The PrintUserFault() function finds the error message corresponding to
22 the code and writes it, followed by a newline, to the standard error
23 or Output() filehandle. If the argument string is non-NULL it is
24 preappended to the message string and separated from it by a colon and
25 space (`: '). If string is NULL only the error message string is
29 The PrintUserFault() function used the DOS io functions. It is
30 recommended to use PrintUserFault() when the standard C IO functions
31 are not otherwise in use.
34 strerror(), perror(), <netinclude:sys/errno.h>
36 ******************************************************************************
41 #include <exec/execbase.h>
42 extern struct ExecBase
*SysBase
;
45 #include <dos/dosextens.h>
46 #include <proto/dos.h>
47 #include <proto/usergroup.h>
48 #include <proto/exec.h>
50 void PrintUserFault(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
;
56 FPuts(Stderr
, (STRPTR
)banner
);
59 FPuts(Stderr
, (STRPTR
)ug_StrError(code
));