Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1From 6b7863b51c97f8ecd9a93fc4347f8938f9b5c05f Mon Sep 17 00:00:00 2001
2From: midchildan <git@midchildan.org>
3Date: Tue, 30 Mar 2021 22:21:51 +0900
4Subject: [PATCH] build: fix build for macOS
5
6---
7 9pfs.c | 4 ++--
8 libc.h | 4 ++++
9 2 files changed, 6 insertions(+), 2 deletions(-)
10
11diff --git a/9pfs.c b/9pfs.c
12index 2c481bd..f5c487c 100644
13--- a/9pfs.c
14+++ b/9pfs.c
15@@ -30,7 +30,7 @@
16 enum
17 {
18 CACHECTLSIZE = 8, /* sizeof("cleared\n") - 1 */
19- MSIZE = 8192
20+ MSIZE_9P = 8192
21 };
22
23 void dir2stat(struct stat*, Dir*);
24@@ -505,7 +505,7 @@ main(int argc, char *argv[])
25 freeaddrinfo(ainfo);
26
27 init9p();
28- msize = _9pversion(MSIZE);
29+ msize = _9pversion(MSIZE_9P);
30 if(doauth){
31 authfid = _9pauth(AUTHFID, user, NULL);
32 ai = auth_proxy(authfid, auth_getkey, "proto=p9any role=client");
33diff --git a/libc.h b/libc.h
34index 099adba..aac03c5 100644
35--- a/libc.h
36+++ b/libc.h
37@@ -61,6 +61,10 @@ typedef unsigned char uchar;
38 typedef unsigned long long uvlong;
39 typedef long long vlong;
40
41+#ifndef __GLIBC__
42+typedef unsigned long ulong;
43+#endif
44+
45 typedef
46 struct Qid
47 {