Scsi spindown

Harry Kalogirou harkal at rainbow.cs.unipi.gr
Sat Jan 20 03:41:01 EET 2001


Anthony Petropoulos wrote:

>   3erei kaneis pws mporeis na kaneis spindown enan scsi disko?
> 
> Antwnhs

Ayto mporeis na to kaneis me ena micro programmataki se C san
to parakatw...

---cut---cut---cut

#include <stdio.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <scsi/scsi_ioctl.h>

main(int argc, char **argv){
	int scsi;

	if (argc != 2) {
		printf("  Syntax: %s <dev>\n", argv[0]);
		exit(1);
	}
	
	scsi=open(argv[1], 'r');
	if(!scsi){
  		printf("  Use an existing devise !!!\n");
		exit(1);
	}

	ioctl(scsi, SCSI_IOCTL_STOP_UNIT);
}
---cut---cut---cut


HarKal

-- 


--------------------------------------------
  Harry Kalogirou
  ---------------
  web   : http://rainbow.cs.unipi.gr/~harkal
--------------------------------------------




More information about the Linux-greek-users mailing list