]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
musl: avoid conflict between fcntl.h and basic-forward.h
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 21 Jul 2025 18:37:37 +0000 (03:37 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 12 Nov 2025 22:28:01 +0000 (23:28 +0100)
glibc defines AT_FDCWD as -100, but musl defines it as (-100).
In basic-forward.h, we also define AT_FDCWD as -100, hence musl's fcntl.h
conflicts with forward.h. This is for avoiding the conflict.

src/basic/basic-forward.h

index 38c3098f324183c259d26ced0111ba61fe1e3cad..dae8788140fed739b63013f36692ca9f166f74d9 100644 (file)
@@ -117,7 +117,12 @@ typedef struct SocketAddress SocketAddress;
 /* We duplicate various commonly used constants here so we can keep most static inline functions without
  * having to include the full header that provides these constants. */
 
+/* glibc defines AT_FDCWD as -100, but musl defines it as (-100). */
+#ifdef __GLIBC__
 #define AT_FDCWD                -100
+#else
+#define AT_FDCWD                (-100)
+#endif
 #define AT_EMPTY_PATH           0x1000
 #define AT_SYMLINK_FOLLOW       0x400
 #define AT_SYMLINK_NOFOLLOW     0x100