xref: /csrg-svn/usr.bin/pascal/libpc/PERROR.c (revision 10226)
13870Smckusick /* Copyright (c) 1979 Regents of the University of California */
23870Smckusick 
3*10226Smckusick static char sccsid[] = "@(#)PERROR.c 1.2 01/10/83";
43870Smckusick 
53870Smckusick #include	<stdio.h>
63870Smckusick #include	<signal.h>
73870Smckusick 
83870Smckusick /*
93870Smckusick  * Routine PERROR is called from the runtime library when a runtime
103870Smckusick  * I/O error occurs. Its arguments are a pointer to an error message and
113870Smckusick  * the name of the offending file.
123870Smckusick  */
133870Smckusick long
143870Smckusick PERROR(msg, fname)
153870Smckusick 
163870Smckusick 	char	*msg, *fname;
173870Smckusick {
183870Smckusick 	PFLUSH();
193870Smckusick 	fputc('\n',stderr);
203870Smckusick 	fputs(msg, stderr);
213870Smckusick 	perror(fname);
22*10226Smckusick 	kill(getpid(), SIGTRAP);
233870Smckusick 	return 0;
243870Smckusick }
25