xref: /csrg-svn/usr.bin/pascal/libpc/ERROR.c (revision 62092)
140865Sbostic /*-
2*62092Sbostic  * Copyright (c) 1979, 1993
3*62092Sbostic  *	The Regents of the University of California.  All rights reserved.
440865Sbostic  *
540865Sbostic  * %sccs.include.redist.c%
640865Sbostic  */
71648Smckusick 
840865Sbostic #ifndef lint
9*62092Sbostic static char sccsid[] = "@(#)ERROR.c	8.1 (Berkeley) 06/06/93";
1040865Sbostic #endif /* not lint */
111648Smckusick 
122179Smckusic #include	<stdio.h>
1310225Smckusick #include	<signal.h>
141648Smckusick 
151648Smckusick /*
163867Smckusic  * Routine ERROR is called from the runtime library when a runtime
173867Smckusic  * error occurs. Its arguments are a pointer to an error message and
183867Smckusic  * an error specific piece of data.
191648Smckusick  */
203002Smckusic long
ERROR(msg,d1,d2)213867Smckusic ERROR(msg, d1, d2)
221648Smckusick 
233857Smckusic 	char	*msg;
243867Smckusic 	long	d1, d2;
253857Smckusic {
261648Smckusick 	PFLUSH();
271648Smckusick 	fputc('\n',stderr);
285665Smckusic 	fprintf(stderr, msg, d1, d2);
2910225Smckusick 	kill(getpid(), SIGTRAP);
303867Smckusic 	return d1;
311648Smckusick }
32