lkml.org 
[lkml]   [2009]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectGetting HDD serial in kernel space
Hello.

I had a necessity to get HDD serial number in my kernel module.
In user space I can do it so:

fd = open( "/dev/sda", O_RDONLY|O_NONBLOCK );
ioctl( fd, HDIO_GET_IDENTITY, &id );
printf( "Serial: %s", id.serial_no );

How can I do it in kernel space (it is one hdd in machine, plugged with
SATA)?



\
 
 \ /
  Last update: 2009-11-14 12:57    [W:0.405 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site