[libc-commits] [libc] [llvm] Add sysexits.h header with BSD exit codes (total-18) (PR #126112)

via libc-commits libc-commits at lists.llvm.org
Sat Feb 8 08:06:18 PST 2025


https://github.com/ajayrajsaini updated https://github.com/llvm/llvm-project/pull/126112

>From d4d32a4022feba5d656e1a38a6f8ef71fecdb5f9 Mon Sep 17 00:00:00 2001
From: Ajay Raj <ajayrajsaini333 at gmail.com>
Date: Fri, 7 Feb 2025 00:23:49 +0530
Subject: [PATCH 1/2] Add sysexits.h header with BSD exit codes (total-18)

---
 llvm/include/llvm/Support/SysExits.h | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 llvm/include/llvm/Support/SysExits.h

diff --git a/llvm/include/llvm/Support/SysExits.h b/llvm/include/llvm/Support/SysExits.h
new file mode 100644
index 000000000000000..06b3ada101756e7
--- /dev/null
+++ b/llvm/include/llvm/Support/SysExits.h
@@ -0,0 +1,24 @@
+#ifndef SYSEXITS_H
+#define SYSEXITS_H
+
+// BSD Exit Codes (18 total) — These are the commonly used exit codes without POSIX dependencies
+#define EX_OK         0    // Successful termination
+#define EX_USAGE      64   // Command line usage error
+#define EX_DATAERR    65   // Data format error
+#define EX_NOINPUT    66   // Cannot open input
+#define EX_NOUSER     67   // Addressee unknown
+#define EX_NOHOST     68   // Host name unknown
+#define EX_UNAVAILABLE 69  // Service unavailable
+#define EX_SOFTWARE   70   // Internal software error
+#define EX_OSERR      71   // Operating system error
+#define EX_OSFILE     72   // System file error
+#define EX_CANTCREAT  73   // Cannot create (user) output file
+#define EX_IOERR      74   // Input/output error
+#define EX_TEMPFAIL   75   // Temporary failure, try again
+#define EX_PROTOCOL   76   // Remote protocol error
+#define EX_NOPERM     77   // Permission denied
+#define EX_CONFIG     78   // Configuration error
+#define EX_INTERNAL   80   // Internal error
+#define EX_INVALIDARG 81   // Invalid argument
+
+#endif // SYSEXITS_H

>From e46aba5bdfeb5aa052f54a26610197484c1b95ff Mon Sep 17 00:00:00 2001
From: Ajay Raj <ajayrajsaini333 at gmail.com>
Date: Sat, 8 Feb 2025 21:33:46 +0530
Subject: [PATCH 2/2] moved SysExits.h to /libc/lib

---
 {llvm/include/llvm/Support => libc/lib}/SysExits.h | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename {llvm/include/llvm/Support => libc/lib}/SysExits.h (100%)

diff --git a/llvm/include/llvm/Support/SysExits.h b/libc/lib/SysExits.h
similarity index 100%
rename from llvm/include/llvm/Support/SysExits.h
rename to libc/lib/SysExits.h



More information about the libc-commits mailing list