[libc-commits] [libc] [libc] Implement freopen (PR #207837)
Jeff Bailey via libc-commits
libc-commits at lists.llvm.org
Wed Jul 29 00:40:04 PDT 2026
================
@@ -54,21 +56,17 @@ ErrorOr<off_t> linux_file_seek(File *f, off_t offset, int whence) {
int linux_file_close(File *f) {
File::remove_file(f);
auto *lf = reinterpret_cast<LinuxFile *>(f);
- int ret = LIBC_NAMESPACE::syscall_impl<int>(SYS_close, lf->get_fd());
- if (ret < 0) {
- return -ret;
+ if (lf->get_fd() >= 0) {
+ auto result = linux_syscalls::close(lf->get_fd());
+ if (!result)
+ return result.error();
----------------
kaladron wrote:
Would you mind filing an issue on this and assigning it to me? That seems like a gap we should take to the Austin Group to find out whether they can be reconciled or whether this is a GNU versus POSIX behaviour difference.
https://github.com/llvm/llvm-project/pull/207837
More information about the libc-commits
mailing list