Commit | Line | Data |
---|---|---|
0d78ca85 KB |
1 | /*- |
2 | * Copyright (c) 1979 The Regents of the University of California. | |
3 | * All rights reserved. | |
4 | * | |
5 | * %sccs.include.redist.c% | |
6 | */ | |
1162b0b7 | 7 | |
0d78ca85 KB |
8 | #ifndef lint |
9 | static char sccsid[] = "@(#)PERROR.c 1.3 (Berkeley) %G%"; | |
10 | #endif /* not lint */ | |
1162b0b7 KM |
11 | |
12 | #include <stdio.h> | |
13 | #include <signal.h> | |
1162b0b7 KM |
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); | |
1162b0b7 KM |
27 | fputs(msg, stderr); |
28 | perror(fname); | |
5e75e883 | 29 | kill(getpid(), SIGTRAP); |
1162b0b7 KM |
30 | return 0; |
31 | } |