[12489] in Athena Bugs
Sun 7.7 ucb library broken RSP setjmp
daemon@ATHENA.MIT.EDU (epeisach@MIT.EDU)
Sun Aug 28 10:05:48 1994
From: epeisach@MIT.EDU
Date: Sun, 28 Aug 1994 10:05:41 +0500
To: bugs@MIT.EDU
Cc: rel-eng@MIT.EDU, op@MIT.EDU
The following program when linked -lucb goes past the jmpbuf. I will not
speculate what is going on.... (Output is 0 or 1 depending on linkage).
Anyway - that is why lpquota does not work on the sun.
-----------------------------------------------------------
unsigned char buf[512], buf1[512];
#include <sys/types.h>
#include <sys/file.h>
#include <stdio.h>
#define POS2 2<<29
main()
{
int i=open("/dev/rz4c", O_RDONLY, 0);
if(i<0) {
perror("could not open device\n");
exit(1);
}
if(lseek(i,0,L_SET) != 0) {
perror("Seeking to position 0\n");
exit(1);
}
if(read(i, buf, 512) != 512) {
perror("Read 1\n");
exit(1);
}
if(lseek(i,POS2,L_SET) != POS2) {
printf("Pos == %ld %ld\n", lseek(i,POS2,L_SET), POS2);
perror("Seeking to position 2\n");
exit(1);
}
if(read(i, buf1, 512) != 512) {
perror("Read 2\n");
exit(1);
}
close(i);
for(i=0; i<512; i++) {
if(buf[i] != buf1[i]) {
printf("Difference at %d - device driver ok\n");
exit(0);
}
}
printf("Device driver is bad\n");
exit(1);
}