void-packages/srcpkgs/nfs-utils/patches/nfs-utils-2.7.1-define_macr...

39 lines
944 B
Diff

diff --git a/support/junction/path.c b/support/junction/path.c
index 13a14386..dd0f59a0 100644
--- a/support/junction/path.c
+++ b/support/junction/path.c
@@ -23,6 +23,12 @@
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
*/
+/* For musl */
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+#include <limits.h>
+
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/support/include/junction.h b/support/include/junction.h
index 7257d80b..d127dd55 100644
--- a/support/include/junction.h
+++ b/support/include/junction.h
@@ -26,6 +26,16 @@
#ifndef _NFS_JUNCTION_H_
#define _NFS_JUNCTION_H_
+/* For musl, refered to glibc's sys/cdefs.h */
+#ifndef __attribute_malloc__
+#define __attribute_malloc__ __attribute__((__malloc__))
+#endif
+
+/* For musl, refered to glibc's sys/stat.h */
+#ifndef ALLPERMS
+#define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)/* 07777 */
+#endif
+
#include <stdint.h>
/*