X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 741293982414 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1625734477; bh=z55it7WsCUOWTmprGkf/X9F7PkgHjSY8nn5UK9Ix/nY=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=nPVivPNw8g/Rqfh6vIOvIlEGH8yK6EbZIkMhGCftYat6gA5gNVNye8jD6wHx4auwN sD7+OBz+pRrhMCAFAEfJncicSXmXb8pxaDDl0fqKp9KWLct/CTF3/kjATwu/zJg08v EYdiTYpupbTbI3utwlkNZCzrDuvQJqINc3PJwI1E= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B7D68385783D X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Bhz15JVNK2RoJWzlgSUBwfE6N32yhAzu/G1RuZSnL70=; b=o9kqcCgSCatpHACiCNRgrjqXtmE8Cdj+5OI8PfJjHU9go807Hpu89S2INMnHo0Sdy7 zDSxSub76CEcgdQZzCyun+BODgPDhi1ZsUdmQHHdCIWUu9bdJum4jOjTYdAfH/y/E54V Upvu27HI0MMNIqtYBeQwDL72byWPnPx7t0TDIV3TPL0kG3eDhj7XNJwi0FVZFK9FRIDi m8SZWDYNXEFXSPGK2EuOmVwozHLoyJN90QAsVw5eihxd/h8O0icAM0N3fxQD3yVG8BXR 1BSGGATelb8JkjcrLWOEei6szbKgQuXXnksA+kO5C/gBeZtwDH+FnT2kIL34r9Ai5LwO Zsvg== X-Gm-Message-State: AOAM530cyqD0umSmRa+5vnQ4YrtR/GWDF8Vk47osKiWRiw8tpJPCCwoq MVArr29c8MAHYlwvIvc1B5rBIv7ZQYuwKq4En/E= X-Google-Smtp-Source: ABdhPJyxDc3aNoYBcex8FWrk63LsyF+G/zH56KYUADcn3QEM9tXHx8hi2TotHrZNYTLTGnAMjXYtCEkG6oxIH0v91Uc= X-Received: by 2002:a5d:684f:: with SMTP id o15mr32545873wrw.134.1625734403259; Thu, 08 Jul 2021 01:53:23 -0700 (PDT) MIME-Version: 1.0 References: <_022Gh93RaZBX0JIf3f3UuZ7mekqKNi9g4ap-KHKpAa_ppq6O8Y3WXBDUUCw6yK6KJCdfhrFhwGfbB-UZD5R0wmWa2Lo6ZE6glWt4JzyDns=@protonmail.com> In-Reply-To: <_022Gh93RaZBX0JIf3f3UuZ7mekqKNi9g4ap-KHKpAa_ppq6O8Y3WXBDUUCw6yK6KJCdfhrFhwGfbB-UZD5R0wmWa2Lo6ZE6glWt4JzyDns=@protonmail.com> Date: Thu, 8 Jul 2021 10:53:09 +0200 Message-ID: Subject: Re: fstream::open crashes if first file it ever opening is in /proc To: Max Mikhanosha X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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 List-Id: General Cygwin discussions and problem reports List-Archive: List-Post: List-Help: List-Subscribe: , From: Csaba Raduly via Cygwin Reply-To: Csaba Raduly Cc: "cygwin AT cygwin DOT com" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Cygwin" On Thu, 8 Jul 2021 at 07:42, Max Mikhanosha via Cygwin wrote: > > Fully updated Windows 10, with freshly downloaded Cygwin. > > trying to compile google/benchmark does not work coz it can't read /proc/cpuinfo > > Reduced test test program > > #include > #include > > int main (int argc, char **argv) > { > if (argc > 1) > { > std::fstream booya ("whatever"); > } > std::fstream f("/proc/cpuinfo"); > if (!f.is_open ()){ > std::cout << "Unable to open /proc/cpuinfo" << std::endl; > } > return 0; > } > > Repro log > > > user AT MARS ~ > $ g++ blah.cc > > user AT MARS ~ > $ ./a.exe # this does not work > Unable to open /proc/cpuinfo > > user AT MARS ~ > $ ./a.exe foobar # this works > Works just fine for me (I added code to read the first word from the stream and print it) Csaba AT AMDAHL ~ $ ./a.exe processor Csaba AT AMDAHL ~ $ ./a.exe foobar processor Csaba -- You can get very substantial performance improvements by not doing the right thing. - Scott Meyers, An Effective C++11/14 Sampler So if you're looking for a completely portable, 100% standards-conformant way to get the wrong information: this is what you want. - Scott Meyers (C++TDaWYK) -- 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