[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / libc / src / __support / File / linux / stdin.cpp
blobc9a363bb7c65ae48aa5341d14fca5c7f123875a5
1 //===--- Definition of Linux stdin ----------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "file.h"
10 #include <stdio.h>
12 namespace LIBC_NAMESPACE {
14 constexpr size_t STDIN_BUFFER_SIZE = 512;
15 uint8_t stdin_buffer[STDIN_BUFFER_SIZE];
16 static LinuxFile StdIn(0, stdin_buffer, STDIN_BUFFER_SIZE, _IOFBF, false,
17 File::ModeFlags(File::OpenMode::READ));
18 File *stdin = &StdIn;
20 } // namespace LIBC_NAMESPACE
22 extern "C" {
23 FILE *stdin = reinterpret_cast<FILE *>(&LIBC_NAMESPACE::StdIn);
24 } // extern "C"