[libc-commits] [PATCH] D139576: [libc] move errno out of file internals

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Dec 8 23:44:50 PST 2022


sivachandra added inline comments.


================
Comment at: libc/src/__support/File/file.h:54
   // file position indicator.
-  using SeekFunc = long(File *, long, int);
-  using CloseFunc = int(File *);
-  using FlushFunc = int(File *);
+  using SeekFunc = FileResult<long>(File *, long, int);
+  using CloseFunc = FileResult<int>(File *);
----------------
sivachandra wrote:
> This is an example of an `ErrorOr` or `StatusOr` return value.
Actually, we should be use an equivalent of `std::expected`: https://en.cppreference.com/w/cpp/utility/expected


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139576/new/

https://reviews.llvm.org/D139576



More information about the libc-commits mailing list