public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Csaba Raduly <rcsaba@gmail.com>
To: Max Mikhanosha <max.mikhanosha@protonmail.com>
Cc: "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: Re: fstream::open crashes if first file it ever opening is in /proc
Date: Thu, 8 Jul 2021 10:53:09 +0200	[thread overview]
Message-ID: <CAEhDDbDJgjuEJ19Mi245mjFwewN+vT_bc6xJiKTJ5zJ2=O1=bw@mail.gmail.com> (raw)
In-Reply-To: <_022Gh93RaZBX0JIf3f3UuZ7mekqKNi9g4ap-KHKpAa_ppq6O8Y3WXBDUUCw6yK6KJCdfhrFhwGfbB-UZD5R0wmWa2Lo6ZE6glWt4JzyDns=@protonmail.com>

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)

  reply	other threads:[~2021-07-08  8:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-08  5:41 Max Mikhanosha
2021-07-08  8:53 ` Csaba Raduly [this message]
2021-07-08 14:42   ` Max Mikhanosha
2021-07-09  9:08     ` Csaba Raduly

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='CAEhDDbDJgjuEJ19Mi245mjFwewN+vT_bc6xJiKTJ5zJ2=O1=bw@mail.gmail.com' \
    --to=rcsaba@gmail.com \
    --cc=cygwin@cygwin.com \
    --cc=max.mikhanosha@protonmail.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).