Download upstream/emscripten/system/lib/llvm-libc/src/errno/libc_errno.cpp from arudradey/flst: direct link, hf CLI and curl.
- Browser
- Download file 1.7 kB
-
https://huggingface.co/arudradey/flst/resolve/main/upstream/emscripten/system/lib/llvm-libc/src/errno/libc_errno.cpp
- Command line
-
hf download hf://arudradey/flst/upstream/emscripten/system/lib/llvm-libc/src/errno/libc_errno.cpp
-
curl -L -o libc_errno.cpp https://huggingface.co/arudradey/flst/resolve/main/upstream/emscripten/system/lib/llvm-libc/src/errno/libc_errno.cpp
1.7 kB
| //===-- Implementation of libc_errno --------------------------------------===// | |
| // | |
| // 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 | |
| // | |
| //===----------------------------------------------------------------------===// | |
| namespace LIBC_NAMESPACE_DECL { | |
| void Errno::operator=(int) {} | |
| Errno::operator int() { return 0; } | |
| namespace { | |
| LIBC_THREAD_LOCAL int thread_errno; | |
| } | |
| extern "C" int *__llvm_libc_errno() noexcept { return &thread_errno; } | |
| void Errno::operator=(int a) { thread_errno = a; } | |
| Errno::operator int() { return thread_errno; } | |
| namespace { | |
| int shared_errno; | |
| } | |
| extern "C" int *__llvm_libc_errno() noexcept { return &shared_errno; } | |
| void Errno::operator=(int a) { shared_errno = a; } | |
| Errno::operator int() { return shared_errno; } | |
| void Errno::operator=(int a) { *__llvm_libc_errno() = a; } | |
| Errno::operator int() { return *__llvm_libc_errno(); } | |
| void Errno::operator=(int a) { errno = a; } | |
| Errno::operator int() { return errno; } | |
| // Define the global `libc_errno` instance. | |
| Errno libc_errno; | |
| } // namespace LIBC_NAMESPACE_DECL | |