[libc-commits] [libc] implement fileno (PR #85628)
Shourya Goel via libc-commits
libc-commits at lists.llvm.org
Mon Mar 18 08:45:04 PDT 2024
================
@@ -0,0 +1,22 @@
+//===-- Implementation of fileno
+//-------------------------------------------===//
+//
+// 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/fileno.h"
+#include "src/__support/File/file.h"
+
+#include <stdio.h>
+
+namespace LIBC_NAMESPACE {
+
+LLVM_LIBC_FUNCTION(int, fileno, (::FILE * stream)) {
+ int result = get_fileno(reinterpret_cast<LIBC_NAMESPACE::File *>(stream));
+ return result;
----------------
Sh0g0-1758 wrote:
done.
https://github.com/llvm/llvm-project/pull/85628
More information about the libc-commits
mailing list