This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: /proc/partitions question


On Wed, Oct 22, 2003 at 04:21:43PM +0200, erik.cumps@icos.be wrote:
> Sorry, lost the previous mail so can't continue the thread.
> 
> I took a look at the sources as cgf suggested and
> have the following question:
> 
> in fhandler_proc.cc revision 1.36,
> in function format_proc_partitions() :
> 
> after getting the drive geometry with
> 'IOCTL_DISK_GET_DRIVE_GEOMETRY'
> the size of the disk is calculated in bytes and this number is
> right-shifted 6 bits, so that's a division by 64 and that maps
> with the scaling difference of 16 between df and /proc/partitions.
> 
> likewise after getting the drive's partition layout with
> 'IOCTL_DISK_GET_DRIVE_LAYOUT'
> the length of each parititions (which is in bytes) is again
> right-shifted 6 bits.
> 
> So why the right-shift 6 instead of 10 which would map
> with a blocksize of 1K?

Thanks for tracking this down.  I've applied a patch to Cygwin.  You
should find the corrected version in the next developers snapshot.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]