On Thu, 8 Jul 2021 at 07:42, Max Mikhanosha via Cygwin <cygwin@cygwin.com> 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 <iostream> > #include <fstream> > > 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@MARS ~ > $ g++ blah.cc > > user@MARS ~ > $ ./a.exe # this does not work > Unable to open /proc/cpuinfo > > user@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@AMDAHL ~ $ ./a.exe processor Csaba@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