lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 12 Nov 2013 10:52:58 +0800
From:	韩磊 <bonben1989@...il.com>
To:	Mihai Donțu <mihai.dontu@...il.com>
Cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: Linux kernel API about sector count

 I need a API in linux kernel about the disk's total count of
sector,not the sector size.
thank you!


2013/11/11 韩磊 <bonben1989@...il.com>:
> Thank you! I need disk's total count of sector,not the sector size.
>
> 2013/11/11 Mihai Donțu <mihai.dontu@...il.com>:
>> On Mon, 11 Nov 2013 20:31:14 +0800 韩磊 wrote:
>>> Can you tell me the API about the count of sector in linux kernel?
>>>
>>> which .h file and function?
>>>
>>
>> Looking at fdisk (util-linux) there are several ioctls:
>>  * HDIO_GETGEO  (linux/hdreg.h)
>>  * BLKGETSIZE64 (linux/fs.h), sector size is assumed 512
>>
>> The HDIO interface *seems* to be legacy:
>> http://www.mjmwired.net/kernel/Documentation/ioctl/hdio.txt
>>
>> Also see:
>> https://git.kernel.org/cgit/utils/util-linux/util-linux.git/tree/fdisks/fdisk.c
>>
>> I hope this helps a bit.
>>
>> --
>> Mihai Donțu
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ