[libc-commits] [libc] [libc] Add protocol family constants (PR #206911)

via libc-commits libc-commits at lists.llvm.org
Wed Jul 1 01:59:09 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Pavel Labath (labath)

<details>
<summary>Changes</summary>

These aren't in POSIX, but are in 4.2BSD and they're still widely used.

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


1 Files Affected:

- (modified) libc/include/llvm-libc-macros/linux/sys-socket-macros.h (+7) 


``````````diff
diff --git a/libc/include/llvm-libc-macros/linux/sys-socket-macros.h b/libc/include/llvm-libc-macros/linux/sys-socket-macros.h
index 1d38d840aa342..5478521be02b6 100644
--- a/libc/include/llvm-libc-macros/linux/sys-socket-macros.h
+++ b/libc/include/llvm-libc-macros/linux/sys-socket-macros.h
@@ -18,6 +18,13 @@
 #define AF_INET 2   // Internet IPv4 Protocol
 #define AF_INET6 10 // IP version 6
 
+// 4.2BSD protocol families
+#define PF_UNSPEC AF_UNSPEC
+#define PF_UNIX AF_UNIX
+#define PF_LOCAL AF_LOCAL
+#define PF_INET AF_INET
+#define PF_INET6 AF_INET6
+
 #define SOCK_STREAM 1
 #define SOCK_DGRAM 2
 #define SOCK_RAW 3

``````````

</details>


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


More information about the libc-commits mailing list