/*-------------------------------------------------------------------- * Copyright © 2016 James Hunt . * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . *-------------------------------------------------------------------- */ /*-------------------------------------------------------------------- * Description: This file contains platform-specific system includes *-------------------------------------------------------------------- */ #ifndef _PROCENV_PLATFORM_HEADERS_H #define _PROCENV_PLATFORM_HEADERS_H /*------------------------------------------------------------------*/ #if defined (PROCENV_PLATFORM_DARWIN) #include #include #include #include #include #include #include #include #include #include #include #include #define PROCENV_LINK_LEVEL_FAMILY AF_LINK #define PROCENV_CPU_TYPE int /* XXX: fake value as cpu set are not available on darwin */ #define PROCENV_CPU_SET_TYPE void #define PROCENV_MNT_GET_FLAGS(mnt) (mnt)->f_flags #define PROCENV_MNT_GET_FSID(mnt) (mnt)->f_fsid.val #define PROCENV_STATFS_INT_TYPE uint64_t #define PROCENV_STATFS_INT_FMT PRIu64 typedef struct statfs procenv_mnt_type; #endif /* PROCENV_PLATFORM_DARWIN*/ /*------------------------------------------------------------------*/ /* XXX: for now, let's assume "unknown" is similar to Linux :-) */ #if defined (PROCENV_PLATFORM_LINUX) || defined (PROCENV_PLATFORM_GENERIC) #include #include #include #include #include #include #include #include #include #include #ifndef _SYS_PRCTL_H #include #endif #include /* Lucid provides prctl.h, but not securebits.h */ #if defined (PR_GET_SECUREBITS) && defined (HAVE_LINUX_SECUREBITS_H) #include #endif #include #include #if defined (HAVE_SYS_APPARMOR_H) #include #endif #if defined (HAVE_SELINUX_SELINUX_H) #include #endif #if defined (HAVE_SYS_CAPABILITY_H) #include #endif #if defined (__GLIBC__) #include #endif /* Network family for entries containing link-level interface * details. These entries will be cached to allow MAC addresses * to be extracted from them when displaying the corresponding * higher-level network family entries for the interface in * question. */ #define PROCENV_LINK_LEVEL_FAMILY AF_PACKET #define PROCENV_PTHREAD_GUARD_SIZE_TYPE size_t #define PROCENV_PTHREAD_GUARD_SIZE_FMT "%lu" #define PROCENV_CPU_SET_TYPE cpu_set_t #define PROCENV_CPU_TYPE int #endif /* PROCENV_PLATFORM_LINUX || PROCENV_PLATFORM_GENERIC */ /*------------------------------------------------------------------*/ #if defined (PROCENV_PLATFORM_MINIX) #include #include #include #include #include #include #include #include #include #include #include #include #include #define PROCENV_LINK_LEVEL_FAMILY AF_LINK #define PROCENV_PTHREAD_GUARD_SIZE_TYPE int #define PROCENV_PTHREAD_GUARD_SIZE_FMT "%u" #define PROCENV_CPU_TYPE cpuid_t #define PROCENV_CPU_SET_TYPE cpuset_t #define PROCENV_MNT_GET_FLAGS(mnt) (mnt)->f_flag #define PROCENV_MNT_GET_FSID(mnt) (mnt)->f_fsidx.__fsid_val #define PROCENV_STATFS_INT_TYPE uint64_t #define PROCENV_STATFS_INT_FMT PRIu64 typedef struct statvfs procenv_mnt_type; #endif /* PROCENV_PLATFORM_MINIX */ /*------------------------------------------------------------------*/ #if defined (PROCENV_PLATFORM_FREEBSD) #include #include #include #include #include #include #include #include #include #include #include #include #define PROCENV_LINK_LEVEL_FAMILY AF_LINK #define PROCENV_CPU_TYPE int #define PROCENV_CPU_SET_TYPE cpuset_t #define PROCENV_MNT_GET_FLAGS(mnt) (mnt)->f_flags #define PROCENV_MNT_GET_FSID(mnt) (mnt)->f_fsid.val #define PROCENV_STATFS_INT_TYPE uint64_t #define PROCENV_STATFS_INT_FMT PRIu64 typedef struct statfs procenv_mnt_type; #endif /* PROCENV_PLATFORM_FREEBSD*/ /*------------------------------------------------------------------*/ #if defined (PROCENV_PLATFORM_NETBSD) /* Required to access "struct kinfo_proc" (from sys/sysctl.h) */ #ifndef _KMEMUSER #define _KMEMUSER #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define PROCENV_LINK_LEVEL_FAMILY AF_LINK #define PROCENV_CPU_TYPE cpuid_t #define PROCENV_CPU_SET_TYPE cpuset_t #define PROCENV_MNT_GET_FLAGS(mnt) (mnt)->f_flag #define PROCENV_MNT_GET_FSID(mnt) (mnt)->f_fsidx.__fsid_val #define PROCENV_STATFS_INT_TYPE uint64_t #define PROCENV_STATFS_INT_FMT PRIu64 typedef struct statvfs procenv_mnt_type; #endif /* PROCENV_PLATFORM_NETBSD */ /*------------------------------------------------------------------*/ #if defined (PROCENV_PLATFORM_OPENBSD) #include #include #include #include #include #include #include #include #include #include #include #include #include #define PROCENV_LINK_LEVEL_FAMILY AF_LINK #define PROCENV_CPU_TYPE cpuid_t #define PROCENV_CPU_SET_TYPE struct cpuset #define PROCENV_MNT_GET_FLAGS(mnt) (mnt)->f_flags #define PROCENV_MNT_GET_FSID(mnt) (mnt)->f_fsid.val #define PROCENV_STATFS_INT_TYPE uint64_t #define PROCENV_STATFS_INT_FMT PRIu64 typedef struct statfs procenv_mnt_type; #endif /* PROCENV_PLATFORM_OPENBSD */ /*------------------------------------------------------------------*/ #if defined (PROCENV_PLATFORM_HURD) #include #include #include #include #include #if defined (HAVE_SYS_CAPABILITY_H) #include #endif #define PROCENV_CPU_TYPE int #define PROCENV_CPU_SET_TYPE cpu_set_t #endif /* PROCENV_PLATFORM_HURD */ /*------------------------------------------------------------------*/ #if defined (PROCENV_PLATFORM_GENERIC) /* XXX: see above */ #endif /* PROCENV_PLATFORM_GENERIC */ /*------------------------------------------------------------------*/ #endif /* _PROCENV_PLATFORM_HEADERS_H */ /*------------------------------------------------------------------*/