X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D482A3971C08 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1629208543; bh=DM2EFwICmbb+vfKxYvkRpbRC7vZDDhvJWve3Ne1j9yY=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=c75fXLjVGuwzbHvbR8fafe9rnjZRJhX9kNEXxo2efEeiIwSFubjy0HxCKHhfLJjMm nlsJNLjt/KUyIVwhazp+ZTFtOIu4xRK3nhC3phEl3l9S4iiMJ9SLMkPHjeZzSs7iwr toUdWhgLNUwXacZMlneiNUSGmsZvaflpB80ifWj4= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D7663389ECAA Date: Tue, 17 Aug 2021 15:51:54 +0200 To: cygwin AT cygwin DOT com Subject: Re: Duplicates in /proc/partitions Message-ID: Mail-Followup-To: cygwin AT cygwin DOT com References: <9a770c83-62ef-6849-16e7-e6956f4d2fab AT SystematicSw DOT ab DOT ca> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Provags-ID: V03:K1:DhSGUgZzzTRFCO488ulRPAej4Vd3Dy5PJUIOf1M+HM+bvLvoNvi PH1VXXE9V8gtfUCOVnLcjHHYjeDyUHCOw2f5JRhZb5ZW421S9n9CIqsMrlcvPJ56N3XsYfI zkhAyl4pxYwgIEj1SirxzCo6OtNcqnO+XkcLsd3ih6rwkUu9LgW1BCKBvHW7wvCuhfEe6eE l64cH7yz2Z6LrYv5FfNSQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:ioXC3g/jLvo=:jhPGEhVFkmECNbJI2cBtlk +8JPxEofRvGG3yfeor75YV1QY9JGSjgKrp/YfGVRGX7Lcc+xHPP0tlvE6GHb4e0vNXMtOcGs2 Jg04M0D5ySrlT2t3hk0eP7BIm0W6uGDBXQYtY9aJmdS8139u7MkLPdfnBMhmHt1PAHMMQvTDN CHAk8BckJ5u0LaWBGSBVZYVcvbV3HSbNa/DzjzR1A1e0vRG8prXtbBXw97mC38kIZA53x4vXh caXfSo8v+aWCdb00h88vtzllXFwcIILJeUcBu2MypKJlTj1aSIAIan1oYL3u21AtOWG1x3c7/ SQ15pInYCsiaD30i66ZZhN+xwZMaPWqNUETAMo4q9fug7PPLALiVMdjz0/YhICkctRfvOQ51g kLMFshJx7RGRHFSf+/yBr5n4VyV9U/UYFIW36ZUVSHf+0MFC/sYYMGEGvxp5WBlXVtnotFcyY upS2eCM2yJM7hPKgPypTXkrJcukbpSydHTV4ZZBldnV6BxlTi4tSfuQh4A7wfvlW647C2WWvg NqBcuHszALFgNBqNhLHqHYQeV083Ljjj9LdzUFEuZsok35rmWyc8XXEql+tQLuNrS5TWU409S 0j4yczcoECtzQewZFfSFrR5PwJFyJKD6p/h/ouLbeo3lnlPA1p7Hsp2job7261NovuqqI8+8P Mb9HhgZEp6Pgz+jyFqecmEgPRfhpbM8GbffHFCwxKqOHXlZv7IV/QZrmwO2nhEi7DpMAYZFAq /6ussjQiNjS3OtE4sweogX/LCdb3zE+n9gOElw4UzADdtxkXhtzePPDXoxiFyjYXXG7Ncou8I zEfomfC2+S0nUJWWjviwMPxHQO+EMHIa/pUn8l9aXlHNo+TrAA8cwe1wN/IFGrZnYWiINucsh N2saOQDH9zAiDYEQ4XpQ== X-Spam-Status: No, score=-99.9 required=5.0 tests=BAYES_00, GOOD_FROM_CORINNA_CYGWIN, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Corinna Vinschen via Cygwin Reply-To: cygwin AT cygwin DOT com Cc: Corinna Vinschen Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" 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 -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple