aboutsummaryrefslogtreecommitdiff
path: root/libgo/sysinfo.c
diff options
context:
space:
mode:
authorNikhil Benesch <nikhil.benesch@gmail.com>2020-10-13 06:36:43 +0000
committerIan Lance Taylor <iant@golang.org>2020-10-14 13:56:01 -0700
commitdc570700beab4080040884690deb6016090b4fa8 (patch)
tree0071ca0e6830bbe09ffaa032f217a587a5345dc1 /libgo/sysinfo.c
parentca56d576241c6783eb36eea526b42c4f3fbf697b (diff)
downloadgcc-dc570700beab4080040884690deb6016090b4fa8.zip
gcc-dc570700beab4080040884690deb6016090b4fa8.tar.gz
gcc-dc570700beab4080040884690deb6016090b4fa8.tar.bz2
libgo: export NetBSD-specific types in mksysinfo.sh
The syscall package depends on many NetBSD-specific types on NetBSD. Teach mksysinfo.sh to export these types. This alone is not sufficient to get the syscall package to compile on NetBSD, but it's a start. Note that the IfMsgHdr type is recapitalized to IfMsghdr, which requires changes in the AIX port. The new capitalization is what's used by upstream in existing NetBSD-specific code and is more consistent with the capitalization of other C structs with the "hdr" suffix. Updates golang/go#38538. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/261739
Diffstat (limited to 'libgo/sysinfo.c')
-rw-r--r--libgo/sysinfo.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/libgo/sysinfo.c b/libgo/sysinfo.c
index 6ea990f..ba84071 100644
--- a/libgo/sysinfo.c
+++ b/libgo/sysinfo.c
@@ -47,6 +47,9 @@
#if defined(HAVE_SYS_SYSCALL_H)
#include <sys/syscall.h>
#endif
+#if defined(HAVE_SYS_SYSCTL_H)
+#include <sys/sysctl.h>
+#endif
#if defined(HAVE_SYS_EPOLL_H)
#include <sys/epoll.h>
#endif
@@ -117,6 +120,9 @@
#if defined(HAVE_LINUX_RTNETLINK_H)
#include <linux/rtnetlink.h>
#endif
+#if defined(HAVE_NET_BPF_H)
+#include <net/bpf.h>
+#endif
#if defined(HAVE_NET_IF_H)
#include <net/if.h>
#endif
@@ -279,6 +285,54 @@ enum {
#ifdef NLA_HDRLEN
NLA_HDRLEN_val = NLA_HDRLEN,
#endif
+#ifdef BIOCFLUSH
+ BIOCFLUSH_val = BIOCFLUSH,
+#endif
+#ifdef BIOCGBLEN
+ BIOCGBLEN_val = BIOCGBLEN,
+#endif
+#ifdef BIOCGDLT
+ BIOCGDLT_val = BIOCGDLT,
+#endif
+#ifdef BIOCGETIF
+ BIOCGETIF_val = BIOCGETIF,
+#endif
+#ifdef BIOCGHDRCMPLT
+ BIOCGHDRCMPLT_val = BIOCGHDRCMPLT,
+#endif
+#ifdef BIOCGRTIMEOUT
+ BIOCGRTIMEOUT_val = BIOCGRTIMEOUT,
+#endif
+#ifdef BIOCGSTATS
+ BIOCGSTATS_val = BIOCGSTATS,
+#endif
+#ifdef BIOCIMMEDIATE
+ BIOCIMMEDIATE_val = BIOCIMMEDIATE,
+#endif
+#ifdef BIOCPROMISC
+ BIOCPROMISC_val = BIOCPROMISC,
+#endif
+#ifdef BIOCSBLEN
+ BIOCSBLEN_val = BIOCSBLEN,
+#endif
+#ifdef BIOCSDLT
+ BIOCSDLT_val = BIOCSDLT,
+#endif
+#ifdef BIOCSETF
+ BIOCSETF_val = BIOCSETF,
+#endif
+#ifdef BIOCSETIF
+ BIOCSETIF_val = BIOCSETIF,
+#endif
+#ifdef BIOCSHDRCMPLT
+ BIOCSHDRCMPLT_val = BIOCSHDRCMPLT,
+#endif
+#ifdef BIOCSRTIMEOUT
+ BIOCSRTIMEOUT_val = BIOCSRTIMEOUT,
+#endif
+#ifdef BIOCVERSION
+ BIOCVERSION_val = BIOCVERSION,
+#endif
};
// SIOCGIFMTU can't be added in the above enum as it might