[libc] Add the implementation of the fdopen function (#94186) Fixes #93711 . This patch implements the fdopen function. Given that fdopen internally calls fcntl, the implementation of fcntl has been moved to the __support/OSUtil, where it serves as an internal public function.
[libc] Move libc_errno inside of LIBC_NAMESPACE (#80774) Having libc_errno outside of the namespace causes versioning issues when trying to link the tests against LLVM-libc. Most of this patch is just moving libc_errno inside the namespace in tests. This isn't necessary in the function implementations since those are already inside the namespace.
[libc] Move libc_errno inside of LIBC_NAMESPACE (#80774) Having libc_errno outside of the namespace causes versioning issues when trying to link the tests against LLVM-libc. Most of this patch is just moving libc_errno inside the namespace in tests. This isn't necessary in the function implementations since those are already inside the namespace.
[libc] Move libc_errno inside of LIBC_NAMESPACE (#80774) Having libc_errno outside of the namespace causes versioning issues when trying to link the tests against LLVM-libc. Most of this patch is just moving libc_errno inside the namespace in tests. This isn't necessary in the function implementations since those are already inside the namespace.
[libc] Move libc_errno inside of LIBC_NAMESPACE (#80774) Having libc_errno outside of the namespace causes versioning issues when trying to link the tests against LLVM-libc. Most of this patch is just moving libc_errno inside the namespace in tests. This isn't necessary in the function implementations since those are already inside the namespace.
[libc] fixup ftello test (#87282) Use a seek offset that fits within the file size. This was missed in presubmit because the FILE based stdio tests aren't run in overlay mode; fullbuild is not tested in presubmit. WRITE_SIZE == 11, so using a value of 42 for offseto would cause the expression WRITE_SIZE - offseto to evaluate to -31 as an unsigned 64b integer (18446744073709551585ULL). Fixes #86928
[libc] Move libc_errno inside of LIBC_NAMESPACE (#80774) Having libc_errno outside of the namespace causes versioning issues when trying to link the tests against LLVM-libc. Most of this patch is just moving libc_errno inside the namespace in tests. This isn't necessary in the function implementations since those are already inside the namespace.
[libc][stdio] implement rename via SYS_renameat2 (#86140) SYS_rename may be unavailable on architectures such as aarch64 and riscv. rename can be implemented in terms of SYS_rename, SYS_renameat, or SYS_renameat2. I don't have a full picture of the history here, but it seems that SYS_renameat might also be unavailable on some platforms. man 2 rename mentions that SYS_renameat2 was added in Linux 3.15. We don't need to support such ancient kernel versions prior. Link: #84980 Link: #85068
[libc] Move libc_errno inside of LIBC_NAMESPACE (#80774) Having libc_errno outside of the namespace causes versioning issues when trying to link the tests against LLVM-libc. Most of this patch is just moving libc_errno inside the namespace in tests. This isn't necessary in the function implementations since those are already inside the namespace.
[libc] Implement the 'ungetc' function on the GPU (#69248) Summary: This function follows closely with the pattern of all the other functions. That is, making a new opcode and forwarding the call to the host. However, this also required modifying the test somewhat. It seems that not all libc implementations follow the same error rules as are tested here, and it is not explicit in the standard, so we simply disable these EOF checks when targeting the GPU.
[libc] Move libc_errno inside of LIBC_NAMESPACE (#80774) Having libc_errno outside of the namespace causes versioning issues when trying to link the tests against LLVM-libc. Most of this patch is just moving libc_errno inside the namespace in tests. This isn't necessary in the function implementations since those are already inside the namespace.