[libc-commits] [libc] [libc] implement pathconf/fpathconf (PR #87165)
Schrodinger ZHU Yifan via libc-commits
libc-commits at lists.llvm.org
Sat Jul 6 16:19:44 PDT 2024
SchrodingerZhu wrote:
Please consider apply this patch to fix the build issue:
```
>From 18c25535427ed01e30379d0209706e447515978c Mon Sep 17 00:00:00 2001
From: Schrodinger ZHU Yifan <i at zhuyi.fan>
Date: Sat, 6 Jul 2024 16:18:13 -0700
Subject: [PATCH] fix
---
libc/src/unistd/linux/pathconf_utils.cpp | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/libc/src/unistd/linux/pathconf_utils.cpp b/libc/src/unistd/linux/pathconf_utils.cpp
index 5112d2e907cc..c764b7f20a74 100644
--- a/libc/src/unistd/linux/pathconf_utils.cpp
+++ b/libc/src/unistd/linux/pathconf_utils.cpp
@@ -6,12 +6,18 @@
//
//===----------------------------------------------------------------------===//
+// This header must go before limits_macros.h otherwise libc header may chooise
+// to undefine LINK_MAX.
+#include <linux/limits.h> // For LINK_MAX and other limits
+
#include "hdr/limits_macros.h"
#include "hdr/unistd_macros.h"
#include "src/__support/OSUtil/syscall.h" // For internal syscall function.
#include "src/__support/common.h"
#include "src/errno/libc_errno.h"
#include "src/sys/statvfs/linux/statfs_utils.h"
+
+// other linux specific includes
#include <linux/bfs_fs.h>
#if __has_include(<linux/ufs_fs.h>)
#include <linux/ufs_fs.h>
@@ -19,8 +25,7 @@
// from https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/
#define UFS_MAGIC 0x00011954
#endif
-#include <linux/limits.h> // For LINK_MAX and other limits
-#include <linux/magic.h> // For common FS magics
+#include <linux/magic.h> // For common FS magics
namespace LIBC_NAMESPACE {
--
2.45.2
```
https://github.com/llvm/llvm-project/pull/87165
More information about the libc-commits
mailing list