9 #include "sg_include.h"
14 * test IO functions : add yours here
16 * returns 0 : path gone valid
17 * returns 1 : path still failed
20 int readsector0 (char *devnode)
25 fd = open (devnode, O_RDONLY);
26 if (read (fd, &buf, 1) != 1)
36 int tur(char *devnode)
38 unsigned char turCmdBlk[TUR_CMD_LEN] = { 0x00, 0, 0, 0, 0, 0 };
39 struct sg_io_hdr io_hdr;
40 unsigned char sense_buffer[32];
43 fd = open (devnode, O_RDONLY);
45 memset(&io_hdr, 0, sizeof (struct sg_io_hdr));
46 io_hdr.interface_id = 'S';
47 io_hdr.cmd_len = sizeof (turCmdBlk);
48 io_hdr.mx_sb_len = sizeof (sense_buffer);
49 io_hdr.dxfer_direction = SG_DXFER_NONE;
50 io_hdr.cmdp = turCmdBlk;
51 io_hdr.sbp = sense_buffer;
52 io_hdr.timeout = 20000;
54 if (ioctl(fd, SG_IO, &io_hdr) < 0) {
58 if (io_hdr.info & SG_INFO_OK_MASK) {