From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Duplicates in /proc/partitions
Date: Tue, 17 Aug 2021 15:51:54 +0200 [thread overview]
Message-ID: <YRu++uklGOPynvdf@calimero.vinschen.de> (raw)
In-Reply-To: <DM8PR09MB70958FD69B70B19E187BD682A5FE9@DM8PR09MB7095.namprd09.prod.outlook.com>
On Aug 17 12:57, Lavrentiev, Anton (NIH/NLM/NCBI) [C] via Cygwin wrote:
> > $ gcc -g -O2 -o proc_partition_O2 proc_partition.c -lntdll
>
> I ran the program (without gdb yet, can't doit right away)... Its
> output is a bit different from /proc/partitions (w.r.t. drive names),
Yes, it's just faked in the most dirt-simple way. I added a comment to
the code to outline why that is.
> but I still see the duplicates:
Great! That means it should be pretty straightforward to see why the
problem occurs by stepping through the code. For a start I'd suggest
to set a breakpoint to line 103, that's the first DeviceIoControl call.
That line is only reached for actual disks when looping over the
native \Device directory.
On second thought, I have a vague idea... Could you please just add
something to the output, i.e, change lines 124/125 from
printf ("%5d %5d %9llu sd%c\n",
8, (dev_name - 'a') * 16, size >> 10, dev_name);
to
printf ("%5d %5d %9llu sd%c (%lu)\n",
8, (dev_name - 'a') * 16, size >> 10, dev_name,
(unsigned long) context);
and just compile and run the testcase again?
Thanks,
Corinna
next prev parent reply other threads:[~2021-08-17 13:51 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-13 10:56 David Balažic
2021-08-13 15:17 ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2021-08-16 14:51 ` Corinna Vinschen
2021-08-16 16:56 ` Brian Inglis
2021-08-16 17:23 ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2021-08-16 18:49 ` Corinna Vinschen
2021-08-16 21:54 ` Brian Inglis
2021-08-17 12:57 ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2021-08-17 13:51 ` Corinna Vinschen [this message]
2021-08-18 14:18 ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2021-08-18 15:01 ` Corinna Vinschen
2021-08-18 18:18 ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2021-08-18 18:27 ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2021-08-18 18:36 ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2021-08-19 10:03 ` Corinna Vinschen
2021-08-19 11:26 ` Corinna Vinschen
2021-08-19 14:48 ` Corinna Vinschen
2021-08-19 15:15 ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2021-08-19 15:37 ` Corinna Vinschen
2021-08-19 15:46 ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2021-08-19 19:19 ` Corinna Vinschen
2021-08-19 9:37 ` Corinna Vinschen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YRu++uklGOPynvdf@calimero.vinschen.de \
--to=corinna-cygwin@cygwin.com \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).