MatrixAI / netlink-hs

Haskell Netlink Library
https://matrix.ai
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Consistent headers used for generation #2

Closed CMCDragonkai closed 2 years ago

CMCDragonkai commented 5 years ago

Right now it looks like the constants generated depends on the headers available on the OS. And it's able to access it in Nix here, depending on the GlibC that GHC is compiled with (not sure if this is true). This means the headers depend on the dev environment atm. However I think it should be better for this to be explicitly specified. So we should actually bring in the linuxHeadrs as a dependency. However I believe some of the headers its making use of is not part of linuxHeaders. As the generate script also refers to sys/socket.h and sys/types.h. So that may be part of GlibC.

So in that case, the stdenv already brings in gcc and glibc, but it may be good to also explicitly specify these, so we can map these to environment variables and have these be viewable and debuggable for generation purposes too.

CMCDragonkai commented 4 years ago

@ksenia-portu Please create a shell.nix or default.nix that pins the linuxHeaders to be used by the constant generation scripts.

CMCDragonkai commented 4 years ago

For example:

includeFiles :: [String]
includeFiles =
  [ "sys/types.h"
  , "sys/socket.h"
  , "linux/if.h"
  , "linux/if_tun.h"
  , "linux/if_arp.h"
  , "linux/if_link.h"
  , "linux/netlink.h"
  , "linux/rtnetlink.h"
  , "linux/neighbour.h"
  , "linux/veth.h"
  , "linux/genetlink.h"
  ]

The headers under linux/ is available under linuxHeaders package using: nix-build -E '(import <nixpkgs> {}).linuxHeaders'.

However the sys/types.h and sys.socket.h is not under linuxHeaders because they are GCC headers. Therefore, we have to find out whether those files are even needed. If they are, then we are limited to being fixed to a particular dev environment. I'm not sure if those files have headers that we actually need. It may be possible to just fix them.

@ksenia-portu can you find out what types/constants are actually expected to be supplied by those files that we use to generate the final constants haskell file.

CMCDragonkai commented 4 years ago

When I run tree on the linuxHeaders

.
└── include
    ├── asm
    │   ├── a.out.h
    │   ├── auxvec.h
    │   ├── bitsperlong.h
    │   ├── boot.h
    │   ├── bootparam.h
    │   ├── bpf_perf_event.h
    │   ├── byteorder.h
    │   ├── debugreg.h
    │   ├── e820.h
    │   ├── errno.h
    │   ├── fcntl.h
    │   ├── hw_breakpoint.h
    │   ├── hwcap2.h
    │   ├── ioctl.h
    │   ├── ioctls.h
    │   ├── ipcbuf.h
    │   ├── ist.h
    │   ├── kvm.h
    │   ├── kvm_para.h
    │   ├── kvm_perf.h
    │   ├── ldt.h
    │   ├── mce.h
    │   ├── mman.h
    │   ├── msgbuf.h
    │   ├── msr.h
    │   ├── mtrr.h
    │   ├── param.h
    │   ├── perf_regs.h
    │   ├── poll.h
    │   ├── posix_types_32.h
    │   ├── posix_types_64.h
    │   ├── posix_types.h
    │   ├── posix_types_x32.h
    │   ├── prctl.h
    │   ├── processor-flags.h
    │   ├── ptrace-abi.h
    │   ├── ptrace.h
    │   ├── resource.h
    │   ├── sembuf.h
    │   ├── setup.h
    │   ├── shmbuf.h
    │   ├── sigcontext32.h
    │   ├── sigcontext.h
    │   ├── siginfo.h
    │   ├── signal.h
    │   ├── socket.h
    │   ├── sockios.h
    │   ├── statfs.h
    │   ├── stat.h
    │   ├── svm.h
    │   ├── swab.h
    │   ├── termbits.h
    │   ├── termios.h
    │   ├── types.h
    │   ├── ucontext.h
    │   ├── unistd_32.h
    │   ├── unistd_64.h
    │   ├── unistd.h
    │   ├── unistd_x32.h
    │   ├── vm86.h
    │   ├── vmx.h
    │   └── vsyscall.h
    ├── asm-generic
    │   ├── auxvec.h
    │   ├── bitsperlong.h
    │   ├── bpf_perf_event.h
    │   ├── errno-base.h
    │   ├── errno.h
    │   ├── fcntl.h
    │   ├── hugetlb_encode.h
    │   ├── int-l64.h
    │   ├── int-ll64.h
    │   ├── ioctl.h
    │   ├── ioctls.h
    │   ├── ipcbuf.h
    │   ├── kvm_para.h
    │   ├── mman-common.h
    │   ├── mman.h
    │   ├── msgbuf.h
    │   ├── param.h
    │   ├── poll.h
    │   ├── posix_types.h
    │   ├── resource.h
    │   ├── sembuf.h
    │   ├── setup.h
    │   ├── shmbuf.h
    │   ├── shmparam.h
    │   ├── siginfo.h
    │   ├── signal-defs.h
    │   ├── signal.h
    │   ├── socket.h
    │   ├── sockios.h
    │   ├── statfs.h
    │   ├── stat.h
    │   ├── swab.h
    │   ├── termbits.h
    │   ├── termios.h
    │   ├── types.h
    │   ├── ucontext.h
    │   └── unistd.h
    ├── config
    │   └── kernel.release
    ├── drm
    │   ├── amdgpu_drm.h
    │   ├── armada_drm.h
    │   ├── drm_fourcc.h
    │   ├── drm.h
    │   ├── drm_mode.h
    │   ├── drm_sarea.h
    │   ├── etnaviv_drm.h
    │   ├── exynos_drm.h
    │   ├── i810_drm.h
    │   ├── i915_drm.h
    │   ├── mga_drm.h
    │   ├── msm_drm.h
    │   ├── nouveau_drm.h
    │   ├── omap_drm.h
    │   ├── qxl_drm.h
    │   ├── r128_drm.h
    │   ├── radeon_drm.h
    │   ├── savage_drm.h
    │   ├── sis_drm.h
    │   ├── tegra_drm.h
    │   ├── v3d_drm.h
    │   ├── vc4_drm.h
    │   ├── vgem_drm.h
    │   ├── via_drm.h
    │   ├── virtgpu_drm.h
    │   └── vmwgfx_drm.h
    ├── linux
    │   ├── acct.h
    │   ├── adb.h
    │   ├── adfs_fs.h
    │   ├── affs_hardblocks.h
    │   ├── agpgart.h
    │   ├── aio_abi.h
    │   ├── am437x-vpfe.h
    │   ├── android
    │   │   └── binder.h
    │   ├── a.out.h
    │   ├── apm_bios.h
    │   ├── arcfb.h
    │   ├── arm_sdei.h
    │   ├── aspeed-lpc-ctrl.h
    │   ├── atalk.h
    │   ├── atmapi.h
    │   ├── atmarp.h
    │   ├── atmbr2684.h
    │   ├── atmclip.h
    │   ├── atmdev.h
    │   ├── atm_eni.h
    │   ├── atm.h
    │   ├── atm_he.h
    │   ├── atm_idt77105.h
    │   ├── atmioc.h
    │   ├── atmlec.h
    │   ├── atmmpc.h
    │   ├── atm_nicstar.h
    │   ├── atmppp.h
    │   ├── atmsap.h
    │   ├── atmsvc.h
    │   ├── atm_tcp.h
    │   ├── atm_zatm.h
    │   ├── audit.h
    │   ├── auto_dev-ioctl.h
    │   ├── auto_fs4.h
    │   ├── auto_fs.h
    │   ├── auxvec.h
    │   ├── ax25.h
    │   ├── b1lli.h
    │   ├── batadv_packet.h
    │   ├── batman_adv.h
    │   ├── baycom.h
    │   ├── bcache.h
    │   ├── bcm933xx_hcs.h
    │   ├── bfs_fs.h
    │   ├── binfmts.h
    │   ├── blkpg.h
    │   ├── blktrace_api.h
    │   ├── blkzoned.h
    │   ├── bpf_common.h
    │   ├── bpf.h
    │   ├── bpfilter.h
    │   ├── bpf_perf_event.h
    │   ├── bpqether.h
    │   ├── bsg.h
    │   ├── bt-bmc.h
    │   ├── btf.h
    │   ├── btrfs.h
    │   ├── btrfs_tree.h
    │   ├── byteorder
    │   │   ├── big_endian.h
    │   │   └── little_endian.h
    │   ├── caif
    │   │   ├── caif_socket.h
    │   │   └── if_caif.h
    │   ├── can
    │   │   ├── bcm.h
    │   │   ├── error.h
    │   │   ├── gw.h
    │   │   ├── netlink.h
    │   │   ├── raw.h
    │   │   └── vxcan.h
    │   ├── can.h
    │   ├── capability.h
    │   ├── capi.h
    │   ├── cciss_defs.h
    │   ├── cciss_ioctl.h
    │   ├── cdrom.h
    │   ├── cec-funcs.h
    │   ├── cec.h
    │   ├── cgroupstats.h
    │   ├── chio.h
    │   ├── cifs
    │   │   └── cifs_mount.h
    │   ├── cm4000_cs.h
    │   ├── cn_proc.h
    │   ├── coda.h
    │   ├── coda_psdev.h
    │   ├── coff.h
    │   ├── connector.h
    │   ├── const.h
    │   ├── coresight-stm.h
    │   ├── cramfs_fs.h
    │   ├── cryptouser.h
    │   ├── cuda.h
    │   ├── cyclades.h
    │   ├── cycx_cfm.h
    │   ├── dcbnl.h
    │   ├── dccp.h
    │   ├── devlink.h
    │   ├── dlmconstants.h
    │   ├── dlm_device.h
    │   ├── dlm.h
    │   ├── dlm_netlink.h
    │   ├── dlm_plock.h
    │   ├── dma-buf.h
    │   ├── dm-ioctl.h
    │   ├── dm-log-userspace.h
    │   ├── dn.h
    │   ├── dqblk_xfs.h
    │   ├── dvb
    │   │   ├── audio.h
    │   │   ├── ca.h
    │   │   ├── dmx.h
    │   │   ├── frontend.h
    │   │   ├── net.h
    │   │   ├── osd.h
    │   │   ├── version.h
    │   │   └── video.h
    │   ├── edd.h
    │   ├── efs_fs_sb.h
    │   ├── elfcore.h
    │   ├── elf-em.h
    │   ├── elf-fdpic.h
    │   ├── elf.h
    │   ├── errno.h
    │   ├── errqueue.h
    │   ├── erspan.h
    │   ├── ethtool.h
    │   ├── eventpoll.h
    │   ├── fadvise.h
    │   ├── falloc.h
    │   ├── fanotify.h
    │   ├── fb.h
    │   ├── fcntl.h
    │   ├── fd.h
    │   ├── fdreg.h
    │   ├── fib_rules.h
    │   ├── fiemap.h
    │   ├── filter.h
    │   ├── firewire-cdev.h
    │   ├── firewire-constants.h
    │   ├── flat.h
    │   ├── fou.h
    │   ├── fpga-dfl.h
    │   ├── fs.h
    │   ├── fsi.h
    │   ├── fsl_hypervisor.h
    │   ├── fsmap.h
    │   ├── fuse.h
    │   ├── futex.h
    │   ├── gameport.h
    │   ├── genetlink.h
    │   ├── gen_stats.h
    │   ├── genwqe
    │   │   └── genwqe_card.h
    │   ├── gfs2_ondisk.h
    │   ├── gigaset_dev.h
    │   ├── gpio.h
    │   ├── gsmmux.h
    │   ├── gtp.h
    │   ├── hash_info.h
    │   ├── hdlc
    │   │   └── ioctl.h
    │   ├── hdlcdrv.h
    │   ├── hdlc.h
    │   ├── hdreg.h
    │   ├── hiddev.h
    │   ├── hid.h
    │   ├── hidraw.h
    │   ├── hpet.h
    │   ├── hsi
    │   │   ├── cs-protocol.h
    │   │   └── hsi_char.h
    │   ├── hsr_netlink.h
    │   ├── hw_breakpoint.h
    │   ├── hyperv.h
    │   ├── hysdn_if.h
    │   ├── i2c-dev.h
    │   ├── i2c.h
    │   ├── i2o-dev.h
    │   ├── i8k.h
    │   ├── icmp.h
    │   ├── icmpv6.h
    │   ├── if_addr.h
    │   ├── if_addrlabel.h
    │   ├── if_alg.h
    │   ├── if_arcnet.h
    │   ├── if_arp.h
    │   ├── if_bonding.h
    │   ├── if_bridge.h
    │   ├── if_cablemodem.h
    │   ├── ife.h
    │   ├── if_eql.h
    │   ├── if_ether.h
    │   ├── if_fc.h
    │   ├── if_fddi.h
    │   ├── if_frad.h
    │   ├── if.h
    │   ├── if_hippi.h
    │   ├── if_infiniband.h
    │   ├── if_link.h
    │   ├── if_ltalk.h
    │   ├── if_macsec.h
    │   ├── if_packet.h
    │   ├── if_phonet.h
    │   ├── if_plip.h
    │   ├── if_ppp.h
    │   ├── if_pppol2tp.h
    │   ├── if_pppox.h
    │   ├── if_slip.h
    │   ├── if_team.h
    │   ├── if_tun.h
    │   ├── if_tunnel.h
    │   ├── if_vlan.h
    │   ├── if_x25.h
    │   ├── if_xdp.h
    │   ├── igmp.h
    │   ├── iio
    │   │   ├── events.h
    │   │   └── types.h
    │   ├── ila.h
    │   ├── in6.h
    │   ├── inet_diag.h
    │   ├── in.h
    │   ├── inotify.h
    │   ├── input-event-codes.h
    │   ├── input.h
    │   ├── in_route.h
    │   ├── ioctl.h
    │   ├── ip6_tunnel.h
    │   ├── ipc.h
    │   ├── ip.h
    │   ├── ipmi_bmc.h
    │   ├── ipmi.h
    │   ├── ipmi_msgdefs.h
    │   ├── ipsec.h
    │   ├── ipv6.h
    │   ├── ipv6_route.h
    │   ├── ip_vs.h
    │   ├── ipx.h
    │   ├── irqnr.h
    │   ├── isdn
    │   │   └── capicmd.h
    │   ├── isdn_divertif.h
    │   ├── isdn.h
    │   ├── isdnif.h
    │   ├── isdn_ppp.h
    │   ├── iso_fs.h
    │   ├── ivtvfb.h
    │   ├── ivtv.h
    │   ├── jffs2.h
    │   ├── joystick.h
    │   ├── kcm.h
    │   ├── kcmp.h
    │   ├── kcov.h
    │   ├── kdev_t.h
    │   ├── kd.h
    │   ├── kernelcapi.h
    │   ├── kernel.h
    │   ├── kernel-page-flags.h
    │   ├── kexec.h
    │   ├── keyboard.h
    │   ├── keyctl.h
    │   ├── kfd_ioctl.h
    │   ├── kvm.h
    │   ├── kvm_para.h
    │   ├── l2tp.h
    │   ├── libc-compat.h
    │   ├── lightnvm.h
    │   ├── limits.h
    │   ├── lirc.h
    │   ├── llc.h
    │   ├── loop.h
    │   ├── lp.h
    │   ├── lwtunnel.h
    │   ├── magic.h
    │   ├── major.h
    │   ├── map_to_7segment.h
    │   ├── matroxfb.h
    │   ├── max2175.h
    │   ├── mdio.h
    │   ├── media-bus-format.h
    │   ├── media.h
    │   ├── mei.h
    │   ├── membarrier.h
    │   ├── memfd.h
    │   ├── mempolicy.h
    │   ├── meye.h
    │   ├── mic_common.h
    │   ├── mic_ioctl.h
    │   ├── mii.h
    │   ├── minix_fs.h
    │   ├── mman.h
    │   ├── mmc
    │   │   └── ioctl.h
    │   ├── mmtimer.h
    │   ├── module.h
    │   ├── mpls.h
    │   ├── mpls_iptunnel.h
    │   ├── mqueue.h
    │   ├── mroute6.h
    │   ├── mroute.h
    │   ├── msdos_fs.h
    │   ├── msg.h
    │   ├── mtio.h
    │   ├── nbd.h
    │   ├── nbd-netlink.h
    │   ├── ncsi.h
    │   ├── ndctl.h
    │   ├── neighbour.h
    │   ├── netconf.h
    │   ├── netdevice.h
    │   ├── net_dropmon.h
    │   ├── netfilter
    │   │   ├── ipset
    │   │   │   ├── ip_set_bitmap.h
    │   │   │   ├── ip_set.h
    │   │   │   ├── ip_set_hash.h
    │   │   │   └── ip_set_list.h
    │   │   ├── nf_conntrack_common.h
    │   │   ├── nf_conntrack_ftp.h
    │   │   ├── nf_conntrack_sctp.h
    │   │   ├── nf_conntrack_tcp.h
    │   │   ├── nf_conntrack_tuple_common.h
    │   │   ├── nf_log.h
    │   │   ├── nf_nat.h
    │   │   ├── nfnetlink_acct.h
    │   │   ├── nfnetlink_compat.h
    │   │   ├── nfnetlink_conntrack.h
    │   │   ├── nfnetlink_cthelper.h
    │   │   ├── nfnetlink_cttimeout.h
    │   │   ├── nfnetlink.h
    │   │   ├── nfnetlink_log.h
    │   │   ├── nfnetlink_osf.h
    │   │   ├── nfnetlink_queue.h
    │   │   ├── nf_tables_compat.h
    │   │   ├── nf_tables.h
    │   │   ├── x_tables.h
    │   │   ├── xt_addrtype.h
    │   │   ├── xt_AUDIT.h
    │   │   ├── xt_bpf.h
    │   │   ├── xt_cgroup.h
    │   │   ├── xt_CHECKSUM.h
    │   │   ├── xt_CLASSIFY.h
    │   │   ├── xt_cluster.h
    │   │   ├── xt_comment.h
    │   │   ├── xt_connbytes.h
    │   │   ├── xt_connlabel.h
    │   │   ├── xt_connlimit.h
    │   │   ├── xt_connmark.h
    │   │   ├── xt_CONNMARK.h
    │   │   ├── xt_CONNSECMARK.h
    │   │   ├── xt_conntrack.h
    │   │   ├── xt_cpu.h
    │   │   ├── xt_CT.h
    │   │   ├── xt_dccp.h
    │   │   ├── xt_devgroup.h
    │   │   ├── xt_dscp.h
    │   │   ├── xt_DSCP.h
    │   │   ├── xt_ecn.h
    │   │   ├── xt_esp.h
    │   │   ├── xt_hashlimit.h
    │   │   ├── xt_helper.h
    │   │   ├── xt_HMARK.h
    │   │   ├── xt_IDLETIMER.h
    │   │   ├── xt_ipcomp.h
    │   │   ├── xt_iprange.h
    │   │   ├── xt_ipvs.h
    │   │   ├── xt_l2tp.h
    │   │   ├── xt_LED.h
    │   │   ├── xt_length.h
    │   │   ├── xt_limit.h
    │   │   ├── xt_LOG.h
    │   │   ├── xt_mac.h
    │   │   ├── xt_mark.h
    │   │   ├── xt_MARK.h
    │   │   ├── xt_multiport.h
    │   │   ├── xt_nfacct.h
    │   │   ├── xt_NFLOG.h
    │   │   ├── xt_NFQUEUE.h
    │   │   ├── xt_osf.h
    │   │   ├── xt_owner.h
    │   │   ├── xt_physdev.h
    │   │   ├── xt_pkttype.h
    │   │   ├── xt_policy.h
    │   │   ├── xt_quota.h
    │   │   ├── xt_rateest.h
    │   │   ├── xt_RATEEST.h
    │   │   ├── xt_realm.h
    │   │   ├── xt_recent.h
    │   │   ├── xt_rpfilter.h
    │   │   ├── xt_sctp.h
    │   │   ├── xt_SECMARK.h
    │   │   ├── xt_set.h
    │   │   ├── xt_socket.h
    │   │   ├── xt_state.h
    │   │   ├── xt_statistic.h
    │   │   ├── xt_string.h
    │   │   ├── xt_SYNPROXY.h
    │   │   ├── xt_tcpmss.h
    │   │   ├── xt_TCPMSS.h
    │   │   ├── xt_TCPOPTSTRIP.h
    │   │   ├── xt_tcpudp.h
    │   │   ├── xt_TEE.h
    │   │   ├── xt_time.h
    │   │   ├── xt_TPROXY.h
    │   │   └── xt_u32.h
    │   ├── netfilter_arp
    │   │   ├── arp_tables.h
    │   │   └── arpt_mangle.h
    │   ├── netfilter_arp.h
    │   ├── netfilter_bridge
    │   │   ├── ebt_802_3.h
    │   │   ├── ebtables.h
    │   │   ├── ebt_among.h
    │   │   ├── ebt_arp.h
    │   │   ├── ebt_arpreply.h
    │   │   ├── ebt_ip6.h
    │   │   ├── ebt_ip.h
    │   │   ├── ebt_limit.h
    │   │   ├── ebt_log.h
    │   │   ├── ebt_mark_m.h
    │   │   ├── ebt_mark_t.h
    │   │   ├── ebt_nat.h
    │   │   ├── ebt_nflog.h
    │   │   ├── ebt_pkttype.h
    │   │   ├── ebt_redirect.h
    │   │   ├── ebt_stp.h
    │   │   └── ebt_vlan.h
    │   ├── netfilter_bridge.h
    │   ├── netfilter_decnet.h
    │   ├── netfilter.h
    │   ├── netfilter_ipv4
    │   │   ├── ip_tables.h
    │   │   ├── ipt_ah.h
    │   │   ├── ipt_CLUSTERIP.h
    │   │   ├── ipt_ecn.h
    │   │   ├── ipt_ECN.h
    │   │   ├── ipt_LOG.h
    │   │   ├── ipt_REJECT.h
    │   │   ├── ipt_ttl.h
    │   │   └── ipt_TTL.h
    │   ├── netfilter_ipv4.h
    │   ├── netfilter_ipv6
    │   │   ├── ip6_tables.h
    │   │   ├── ip6t_ah.h
    │   │   ├── ip6t_frag.h
    │   │   ├── ip6t_hl.h
    │   │   ├── ip6t_HL.h
    │   │   ├── ip6t_ipv6header.h
    │   │   ├── ip6t_LOG.h
    │   │   ├── ip6t_mh.h
    │   │   ├── ip6t_NPT.h
    │   │   ├── ip6t_opts.h
    │   │   ├── ip6t_REJECT.h
    │   │   ├── ip6t_rt.h
    │   │   └── ip6t_srh.h
    │   ├── netfilter_ipv6.h
    │   ├── net.h
    │   ├── netlink_diag.h
    │   ├── netlink.h
    │   ├── net_namespace.h
    │   ├── netrom.h
    │   ├── net_tstamp.h
    │   ├── nfc.h
    │   ├── nfs2.h
    │   ├── nfs3.h
    │   ├── nfs4.h
    │   ├── nfs4_mount.h
    │   ├── nfsacl.h
    │   ├── nfsd
    │   │   ├── cld.h
    │   │   ├── debug.h
    │   │   ├── export.h
    │   │   ├── nfsfh.h
    │   │   └── stats.h
    │   ├── nfs_fs.h
    │   ├── nfs.h
    │   ├── nfs_idmap.h
    │   ├── nfs_mount.h
    │   ├── nilfs2_api.h
    │   ├── nilfs2_ondisk.h
    │   ├── nl80211.h
    │   ├── n_r3964.h
    │   ├── nsfs.h
    │   ├── nubus.h
    │   ├── nvme_ioctl.h
    │   ├── nvram.h
    │   ├── omap3isp.h
    │   ├── omapfb.h
    │   ├── oom.h
    │   ├── openvswitch.h
    │   ├── packet_diag.h
    │   ├── param.h
    │   ├── parport.h
    │   ├── patchkey.h
    │   ├── pci.h
    │   ├── pci_regs.h
    │   ├── pcitest.h
    │   ├── perf_event.h
    │   ├── personality.h
    │   ├── pfkeyv2.h
    │   ├── pg.h
    │   ├── phantom.h
    │   ├── phonet.h
    │   ├── pktcdvd.h
    │   ├── pkt_cls.h
    │   ├── pkt_sched.h
    │   ├── pmu.h
    │   ├── poll.h
    │   ├── posix_acl.h
    │   ├── posix_acl_xattr.h
    │   ├── posix_types.h
    │   ├── ppdev.h
    │   ├── ppp-comp.h
    │   ├── ppp_defs.h
    │   ├── ppp-ioctl.h
    │   ├── pps.h
    │   ├── prctl.h
    │   ├── pr.h
    │   ├── psample.h
    │   ├── psci.h
    │   ├── psp-sev.h
    │   ├── ptp_clock.h
    │   ├── ptrace.h
    │   ├── qemu_fw_cfg.h
    │   ├── qnx4_fs.h
    │   ├── qnxtypes.h
    │   ├── qrtr.h
    │   ├── quota.h
    │   ├── radeonfb.h
    │   ├── raid
    │   │   ├── md_p.h
    │   │   └── md_u.h
    │   ├── random.h
    │   ├── raw.h
    │   ├── rds.h
    │   ├── reboot.h
    │   ├── reiserfs_fs.h
    │   ├── reiserfs_xattr.h
    │   ├── resource.h
    │   ├── rfkill.h
    │   ├── rio_cm_cdev.h
    │   ├── rio_mport_cdev.h
    │   ├── romfs_fs.h
    │   ├── rose.h
    │   ├── route.h
    │   ├── rpmsg.h
    │   ├── rseq.h
    │   ├── rtc.h
    │   ├── rtnetlink.h
    │   ├── rxrpc.h
    │   ├── scc.h
    │   ├── sched
    │   │   └── types.h
    │   ├── sched.h
    │   ├── scif_ioctl.h
    │   ├── screen_info.h
    │   ├── sctp.h
    │   ├── sdla.h
    │   ├── seccomp.h
    │   ├── securebits.h
    │   ├── sed-opal.h
    │   ├── seg6_genl.h
    │   ├── seg6.h
    │   ├── seg6_hmac.h
    │   ├── seg6_iptunnel.h
    │   ├── seg6_local.h
    │   ├── selinux_netlink.h
    │   ├── sem.h
    │   ├── serial_core.h
    │   ├── serial.h
    │   ├── serial_reg.h
    │   ├── serio.h
    │   ├── shm.h
    │   ├── signalfd.h
    │   ├── signal.h
    │   ├── smc_diag.h
    │   ├── smc.h
    │   ├── smiapp.h
    │   ├── snmp.h
    │   ├── sock_diag.h
    │   ├── socket.h
    │   ├── sockios.h
    │   ├── sonet.h
    │   ├── sonypi.h
    │   ├── soundcard.h
    │   ├── sound.h
    │   ├── spi
    │   │   └── spidev.h
    │   ├── stat.h
    │   ├── stddef.h
    │   ├── stm.h
    │   ├── string.h
    │   ├── sunrpc
    │   │   └── debug.h
    │   ├── suspend_ioctls.h
    │   ├── swab.h
    │   ├── switchtec_ioctl.h
    │   ├── sync_file.h
    │   ├── synclink.h
    │   ├── sysctl.h
    │   ├── sysinfo.h
    │   ├── target_core_user.h
    │   ├── taskstats.h
    │   ├── tc_act
    │   │   ├── tc_bpf.h
    │   │   ├── tc_connmark.h
    │   │   ├── tc_csum.h
    │   │   ├── tc_defact.h
    │   │   ├── tc_gact.h
    │   │   ├── tc_ife.h
    │   │   ├── tc_ipt.h
    │   │   ├── tc_mirred.h
    │   │   ├── tc_nat.h
    │   │   ├── tc_pedit.h
    │   │   ├── tc_sample.h
    │   │   ├── tc_skbedit.h
    │   │   ├── tc_skbmod.h
    │   │   ├── tc_tunnel_key.h
    │   │   └── tc_vlan.h
    │   ├── tc_ematch
    │   │   ├── tc_em_cmp.h
    │   │   ├── tc_em_ipt.h
    │   │   ├── tc_em_meta.h
    │   │   ├── tc_em_nbyte.h
    │   │   └── tc_em_text.h
    │   ├── tcp.h
    │   ├── tcp_metrics.h
    │   ├── tee.h
    │   ├── termios.h
    │   ├── thermal.h
    │   ├── time.h
    │   ├── timerfd.h
    │   ├── times.h
    │   ├── timex.h
    │   ├── tiocl.h
    │   ├── tipc_config.h
    │   ├── tipc.h
    │   ├── tipc_netlink.h
    │   ├── tipc_sockets_diag.h
    │   ├── tls.h
    │   ├── toshiba.h
    │   ├── tty_flags.h
    │   ├── tty.h
    │   ├── types.h
    │   ├── udf_fs_i.h
    │   ├── udp.h
    │   ├── uhid.h
    │   ├── uinput.h
    │   ├── uio.h
    │   ├── uleds.h
    │   ├── ultrasound.h
    │   ├── un.h
    │   ├── unistd.h
    │   ├── unix_diag.h
    │   ├── usb
    │   │   ├── audio.h
    │   │   ├── cdc.h
    │   │   ├── cdc-wdm.h
    │   │   ├── ch11.h
    │   │   ├── ch9.h
    │   │   ├── charger.h
    │   │   ├── functionfs.h
    │   │   ├── gadgetfs.h
    │   │   ├── g_printer.h
    │   │   ├── g_uvc.h
    │   │   ├── midi.h
    │   │   ├── tmc.h
    │   │   └── video.h
    │   ├── usbdevice_fs.h
    │   ├── usbip.h
    │   ├── userfaultfd.h
    │   ├── userio.h
    │   ├── utime.h
    │   ├── utsname.h
    │   ├── uuid.h
    │   ├── uvcvideo.h
    │   ├── v4l2-common.h
    │   ├── v4l2-controls.h
    │   ├── v4l2-dv-timings.h
    │   ├── v4l2-mediabus.h
    │   ├── v4l2-subdev.h
    │   ├── vbox_err.h
    │   ├── vboxguest.h
    │   ├── vbox_vmmdev_types.h
    │   ├── version.h
    │   ├── veth.h
    │   ├── vfio_ccw.h
    │   ├── vfio.h
    │   ├── vhost.h
    │   ├── videodev2.h
    │   ├── virtio_9p.h
    │   ├── virtio_balloon.h
    │   ├── virtio_blk.h
    │   ├── virtio_config.h
    │   ├── virtio_console.h
    │   ├── virtio_crypto.h
    │   ├── virtio_gpu.h
    │   ├── virtio_ids.h
    │   ├── virtio_input.h
    │   ├── virtio_mmio.h
    │   ├── virtio_net.h
    │   ├── virtio_pci.h
    │   ├── virtio_ring.h
    │   ├── virtio_rng.h
    │   ├── virtio_scsi.h
    │   ├── virtio_types.h
    │   ├── virtio_vsock.h
    │   ├── vmcore.h
    │   ├── vm_sockets_diag.h
    │   ├── vm_sockets.h
    │   ├── vsockmon.h
    │   ├── vt.h
    │   ├── vtpm_proxy.h
    │   ├── wait.h
    │   ├── wanrouter.h
    │   ├── watchdog.h
    │   ├── wimax
    │   │   └── i2400m.h
    │   ├── wimax.h
    │   ├── wireless.h
    │   ├── wmi.h
    │   ├── x25.h
    │   ├── xattr.h
    │   ├── xfrm.h
    │   ├── xilinx-v4l2-controls.h
    │   ├── zorro.h
    │   └── zorro_ids.h
    ├── misc
    │   ├── cxl.h
    │   └── ocxl.h
    ├── mtd
    │   ├── inftl-user.h
    │   ├── mtd-abi.h
    │   ├── mtd-user.h
    │   ├── nftl-user.h
    │   └── ubi-user.h
    ├── rdma
    │   ├── bnxt_re-abi.h
    │   ├── cxgb3-abi.h
    │   ├── cxgb4-abi.h
    │   ├── hfi
    │   │   ├── hfi1_ioctl.h
    │   │   └── hfi1_user.h
    │   ├── hns-abi.h
    │   ├── i40iw-abi.h
    │   ├── ib_user_cm.h
    │   ├── ib_user_ioctl_cmds.h
    │   ├── ib_user_ioctl_verbs.h
    │   ├── ib_user_mad.h
    │   ├── ib_user_sa.h
    │   ├── ib_user_verbs.h
    │   ├── mlx4-abi.h
    │   ├── mlx5-abi.h
    │   ├── mlx5_user_ioctl_cmds.h
    │   ├── mlx5_user_ioctl_verbs.h
    │   ├── mthca-abi.h
    │   ├── nes-abi.h
    │   ├── ocrdma-abi.h
    │   ├── qedr-abi.h
    │   ├── rdma_netlink.h
    │   ├── rdma_user_cm.h
    │   ├── rdma_user_ioctl_cmds.h
    │   ├── rdma_user_ioctl.h
    │   ├── rdma_user_rxe.h
    │   └── vmw_pvrdma-abi.h
    ├── scsi
    │   ├── cxlflash_ioctl.h
    │   ├── fc
    │   │   ├── fc_els.h
    │   │   ├── fc_fs.h
    │   │   ├── fc_gs.h
    │   │   └── fc_ns.h
    │   ├── scsi_bsg_fc.h
    │   ├── scsi_netlink_fc.h
    │   └── scsi_netlink.h
    ├── sound
    │   ├── asequencer.h
    │   ├── asoc.h
    │   ├── asound_fm.h
    │   ├── asound.h
    │   ├── compress_offload.h
    │   ├── compress_params.h
    │   ├── emu10k1.h
    │   ├── firewire.h
    │   ├── hdsp.h
    │   ├── hdspm.h
    │   ├── sb16_csp.h
    │   ├── sfnt_info.h
    │   ├── skl-tplg-interface.h
    │   ├── snd_sst_tokens.h
    │   ├── tlv.h
    │   └── usb_stream.h
    ├── video
    │   ├── edid.h
    │   ├── sisfb.h
    │   └── uvesafb.h
    └── xen
        ├── evtchn.h
        ├── gntalloc.h
        ├── gntdev.h
        └── privcmd.h

42 directories, 895 files

We don't have the sys/... etc. But we do have all the linux/....

CMCDragonkai commented 4 years ago

Note that the helpers code is actually using gcc as a shell out executable to compile the code. That what actually includes all the headers, and I think there's a bunch of flags that outputs something that is then parsed.

So it seems to do this as well we would need to fix the linux headers at least, the GCC headers are unlikely to change if we do indeed use them.

CMCDragonkai commented 2 years ago

I think this is solved in MatrixOS.