[libc-commits] [libc] [libc] Use `stdio.h` for `off_t` instead of `unistd.h` (PR #98093)

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Mon Jul 8 15:44:52 PDT 2024


https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/98093

Summary:
The `stdio.h` header should define `off_t` as defined for the platform.
This will use the system's in overlay mode, or what the llvm-libc-types
deems correct. If this `off_t` is incorrect it should be changed in
`llvm-libc-types`. This fixes the GPU build.


>From b3d16fb150f21e13342ae81204c915e7eb433c72 Mon Sep 17 00:00:00 2001
From: Joseph Huber <huberjn at outlook.com>
Date: Mon, 8 Jul 2024 17:43:23 -0500
Subject: [PATCH] [libc] Use `stdio.h` for `off_t` instead of `unistd.h`

Summary:
The `stdio.h` header should define `off_t` as defined for the platform.
This will use the system's in overlay mode, or what the llvm-libc-types
deems correct. If this `off_t` is incorrect it should be changed in
`llvm-libc-types`. This fixes the GPU build.
---
 libc/src/__support/File/file.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libc/src/__support/File/file.h b/libc/src/__support/File/file.h
index ec543ac1ac5f33..828e71424c5936 100644
--- a/libc/src/__support/File/file.h
+++ b/libc/src/__support/File/file.h
@@ -16,7 +16,7 @@
 
 #include <stddef.h>
 #include <stdint.h>
-#include <unistd.h> // For off_t.
+#include <stdio.h>
 
 namespace LIBC_NAMESPACE {
 



More information about the libc-commits mailing list