Hallo Alexander,

ich würde die Datei einfach mit open() öffnen. Auf den GPIO schreibst du ja keine Datei sondern nur mal 1/0. Dann geht auch epoll/select/poll.

Siehe zur Konvertierung OStream->file descriptor
https://gcc.gnu.org/ml/libstdc++/2000-q1/msg00049.html

> So will the new libstdc++ provide such a way?

If you compile the current CVS libstdc++ with _STREAM_COMPAT, you get
a filedesc() method on an fstream object, returning the file
descriptor. Alternatively, you can use fstream::rdbuf()->fd()
(which filedesc() is a short-hand for).

Regards,
Martin
Vielleicht hat ja die aktuelle libstdc++ diese Methode da der Post von ca 2000 ist, muss das nicht mehr stimmen.

Gruß
Georg

- - - Aktualisiert - - -

Siehe auch https://www.ginac.de/~kreckel/fileno/