[libc-commits] [libc] [libc] Add loff_t type (PR #204641)

via libc-commits libc-commits at lists.llvm.org
Thu Jun 18 10:48:43 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Jeff Bailey (kaladron)

<details>
<summary>Changes</summary>

Added loff_t type definition. This is a Linux extension required for large file offsets.

* llvm-libc-types/loff_t.h: Defined loff_t as __INT64_TYPE__.
* sys/types.yaml: Added loff_t to sys/types.
* llvm-libc-types/CMakeLists.txt: Registered loff_t.h.
* libc/include/CMakeLists.txt: Added dependency to sys_types target.

Assisted-by: Automated tooling, human reviewed.

---
Full diff: https://github.com/llvm/llvm-project/pull/204641.diff


4 Files Affected:

- (modified) libc/include/CMakeLists.txt (+1) 
- (modified) libc/include/llvm-libc-types/CMakeLists.txt (+1) 
- (added) libc/include/llvm-libc-types/loff_t.h (+19) 
- (modified) libc/include/sys/types.yaml (+1) 


``````````diff
diff --git a/libc/include/CMakeLists.txt b/libc/include/CMakeLists.txt
index 549dbd9e4c3f8..8d980cfbd3d0b 100644
--- a/libc/include/CMakeLists.txt
+++ b/libc/include/CMakeLists.txt
@@ -877,6 +877,7 @@ add_header_macro(
     .llvm-libc-types.gid_t
     .llvm-libc-types.ino_t
     .llvm-libc-types.key_t
+    .llvm-libc-types.loff_t
     .llvm-libc-types.mode_t
     .llvm-libc-types.nlink_t
     .llvm-libc-types.off_t
diff --git a/libc/include/llvm-libc-types/CMakeLists.txt b/libc/include/llvm-libc-types/CMakeLists.txt
index 46b0eb7d71183..11a62a8a0c9c1 100644
--- a/libc/include/llvm-libc-types/CMakeLists.txt
+++ b/libc/include/llvm-libc-types/CMakeLists.txt
@@ -48,6 +48,7 @@ add_header(
 )
 add_header(ldiv_t HDR ldiv_t.h)
 add_header(lldiv_t HDR lldiv_t.h)
+add_header(loff_t HDR loff_t.h)
 add_header(FILE HDR FILE.h)
 add_header(fd_set HDR fd_set.h DEPENDS libc.include.llvm-libc-macros.sys_select_macros)
 add_header(fenv_t HDR fenv_t.h)
diff --git a/libc/include/llvm-libc-types/loff_t.h b/libc/include/llvm-libc-types/loff_t.h
new file mode 100644
index 0000000000000..c5344b6dd09fd
--- /dev/null
+++ b/libc/include/llvm-libc-types/loff_t.h
@@ -0,0 +1,19 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// Definition of loff_t type.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_TYPES_LOFF_T_H
+#define LLVM_LIBC_TYPES_LOFF_T_H
+
+typedef __INT64_TYPE__ loff_t;
+
+#endif // LLVM_LIBC_TYPES_LOFF_T_H
diff --git a/libc/include/sys/types.yaml b/libc/include/sys/types.yaml
index 605b0c9258841..37c58e708af34 100644
--- a/libc/include/sys/types.yaml
+++ b/libc/include/sys/types.yaml
@@ -9,6 +9,7 @@ types:
   - type_name: gid_t
   - type_name: ino_t
   - type_name: key_t
+  - type_name: loff_t
   - type_name: mode_t
   - type_name: nlink_t
   - type_name: off_t

``````````

</details>


https://github.com/llvm/llvm-project/pull/204641


More information about the libc-commits mailing list