[libc-commits] [libc] [libc] Add the implementation of the fdopen function (PR #94186)

Xu Zhang via libc-commits libc-commits at lists.llvm.org
Fri Jun 7 12:07:53 PDT 2024


================
@@ -0,0 +1,79 @@
+//===-- Implementation of fdopen --------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/stdio/fdopen.h"
+
+#include "hdr/errno_macros.h"
+#include "include/llvm-libc-macros/fcntl-macros.h"
+#include "src/__support/File/linux/file.h"
+#include "src/__support/OSUtil/fcntl.h"
+#include "src/errno/libc_errno.h"
+
+namespace LIBC_NAMESPACE {
+
+LLVM_LIBC_FUNCTION(::FILE *, fdopen, (int fd, const char *mode)) {
+  using ModeFlags = File::ModeFlags;
----------------
simonzgx wrote:

Fixed in the latest commit, please review again.

https://github.com/llvm/llvm-project/pull/94186


More information about the libc-commits mailing list