xref: /original-bsd/usr.bin/pascal/libpc/PERROR.c (revision abd50c55)
1 /*-
2  * Copyright (c) 1979 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  */
7 
8 #ifndef lint
9 static char sccsid[] = "@(#)PERROR.c	1.3 (Berkeley) 04/09/90";
10 #endif /* not lint */
11 
12 #include	<stdio.h>
13 #include	<signal.h>
14 
15 /*
16  * Routine PERROR is called from the runtime library when a runtime
17  * I/O error occurs. Its arguments are a pointer to an error message and
18  * the name of the offending file.
19  */
20 long
21 PERROR(msg, fname)
22 
23 	char	*msg, *fname;
24 {
25 	PFLUSH();
26 	fputc('\n',stderr);
27 	fputs(msg, stderr);
28 	perror(fname);
29 	kill(getpid(), SIGTRAP);
30 	return 0;
31 }
32