?? rezero.c
字號:
#include <stdio.h>#include <stdlib.h>#include <errno.h>#include <scsi/all.h>#include <scsi/da.h>char *prg;intmain(int argc, char **argv){ SCSI *fd; u_char b[256]; struct sc_inquiry inq; prg = argv[0]; if (argc != 2) { fprintf(stderr, "usage: %s device\n", prg); exit(1); } if ((fd=sc_open(argv[1])) == NULL) { fprintf(stderr, "%s: can't open device %s: %s\n", prg, argv[1], strerror(errno)); exit(1); } if (sc_da_rezero_unit(fd) < 0) { sc_fstatus(fd, stderr, prg, "rezero", 3); sc_close(fd); exit(1); }/* if (sc_test_unit_ready(fd) < 0) { sc_fstatus(fd, stderr, prg, "test-unit-ready", 3); sc_close(fd); exit(1); } if (sc_request_sense(fd, 255, b) < 0) { sc_fstatus(fd, stderr, prg, "request-sense", 3); sc_close(fd); exit(1); } */ if (sc_da_prevent_allow_medium_removal(fd, 0) < 0) { sc_fstatus(fd, stderr, prg, "inquiry", 3); sc_close(fd); exit(1); } sc_close(fd); exit(0);}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -