[libc-commits] [PATCH] D153396: WIP: [libc] Add fdopen for linux targets

Alfred Persson Forsberg via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Aug 10 16:31:58 PDT 2023


alfredfo created this revision.
alfredfo added a reviewer: michaelrj.
Herald added subscribers: libc-commits, wlei, wenlei.
Herald added projects: libc-project, All.
alfredfo added a comment.
alfredfo published this revision for review.

Maybe fopen() should be implemented using fdopen()? It does the same thing but additionally calls the 'open' syscall to get a file descriptor to a file.



================
Comment at: libc/spec/stdc.td:535
           >,
+	  FunctionSpec<
+              "fdopen",
----------------
should be in posix.td


This is a draft/work-in-progress. Probably needs some tests, and the
entry in libc/config is just an example here. Should also be added to
other arches.

Did this to get a little more comfortable with how llvm libc works,
comments are very welcome.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D153396

Files:
  libc/config/linux/x86_64/entrypoints.txt
  libc/spec/stdc.td
  libc/src/__support/File/file.h
  libc/src/__support/File/linux/file.cpp
  libc/src/stdio/CMakeLists.txt
  libc/src/stdio/fdopen.cpp
  libc/src/stdio/fdopen.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153396.533120.patch
Type: text/x-patch
Size: 4607 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230810/343b5bd2/attachment-0001.bin>


More information about the libc-commits mailing list