[libc-commits] [libc] [libc] Add missing POSIX macros to cpio.h (PR #188840)
Jeff Bailey via libc-commits
libc-commits at lists.llvm.org
Fri Mar 27 07:41:46 PDT 2026
https://github.com/kaladron updated https://github.com/llvm/llvm-project/pull/188840
>From 4c3839e38bfdaea904000cec5c304cab0c26dc84 Mon Sep 17 00:00:00 2001
From: Jeff Bailey <jbailey at raspberryginger.com>
Date: Tue, 3 Mar 2026 17:11:57 +0000
Subject: [PATCH] [libc] Add missing POSIX macros to cpio.h
Added POSIX macros for cpio:
* cpio.h.def
* cpio.yaml
This completes the cpio.h implementation by adding the POSIX-defined macros.
Documentation for cpio was previously merged in PR #123798.
---
libc/include/CMakeLists.txt | 8 ++++++
libc/include/cpio.h.def | 16 ++++++++++++
libc/include/cpio.yaml | 51 +++++++++++++++++++++++++++++++++++++
3 files changed, 75 insertions(+)
create mode 100644 libc/include/cpio.h.def
create mode 100644 libc/include/cpio.yaml
diff --git a/libc/include/CMakeLists.txt b/libc/include/CMakeLists.txt
index 3f4bbf85160b7..ab1cf79dbc42f 100644
--- a/libc/include/CMakeLists.txt
+++ b/libc/include/CMakeLists.txt
@@ -236,6 +236,14 @@ add_header_macro(
.llvm-libc-types.cfloat16
)
+add_header_macro(
+ cpio
+ ../libc/include/cpio.yaml
+ cpio.h
+ DEPENDS
+ .llvm_libc_common_h
+)
+
add_header_macro(
setjmp
../libc/include/setjmp.yaml
diff --git a/libc/include/cpio.h.def b/libc/include/cpio.h.def
new file mode 100644
index 0000000000000..5cfe4bca3153a
--- /dev/null
+++ b/libc/include/cpio.h.def
@@ -0,0 +1,16 @@
+//===-- C standard library header cpio.h ----------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_CPIO_H
+#define LLVM_LIBC_CPIO_H
+
+#include "__llvm-libc-common.h"
+
+%%public_api()
+
+#endif // LLVM_LIBC_CPIO_H
diff --git a/libc/include/cpio.yaml b/libc/include/cpio.yaml
new file mode 100644
index 0000000000000..43657e5cfc91d
--- /dev/null
+++ b/libc/include/cpio.yaml
@@ -0,0 +1,51 @@
+header: cpio.h
+header_template: cpio.h.def
+standards:
+ - POSIX
+macros:
+ - macro_name: C_IRUSR
+ macro_value: "000400"
+ - macro_name: C_IWUSR
+ macro_value: "000200"
+ - macro_name: C_IXUSR
+ macro_value: "000100"
+ - macro_name: C_IRGRP
+ macro_value: "000040"
+ - macro_name: C_IWGRP
+ macro_value: "000020"
+ - macro_name: C_IXGRP
+ macro_value: "000010"
+ - macro_name: C_IROTH
+ macro_value: "000004"
+ - macro_name: C_IWOTH
+ macro_value: "000002"
+ - macro_name: C_IXOTH
+ macro_value: "000001"
+ - macro_name: C_ISUID
+ macro_value: "004000"
+ - macro_name: C_ISGID
+ macro_value: "002000"
+ - macro_name: C_ISVTX
+ macro_value: "001000"
+ - macro_name: C_ISDIR
+ macro_value: "040000"
+ - macro_name: C_ISFIFO
+ macro_value: "010000"
+ - macro_name: C_ISREG
+ macro_value: "0100000"
+ - macro_name: C_ISBLK
+ macro_value: "060000"
+ - macro_name: C_ISCHR
+ macro_value: "020000"
+ - macro_name: C_ISCTG
+ macro_value: "0110000"
+ - macro_name: C_ISLNK
+ macro_value: "0120000"
+ - macro_name: C_ISSOCK
+ macro_value: "0140000"
+ - macro_name: MAGIC
+ macro_value: '"070707"'
+types: []
+enums: []
+objects: []
+functions: []
More information about the libc-commits
mailing list