| /* libprocstat |
| Copyright 2015-2023 Rivoreo |
| |
| 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 2 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. |
| */ |
| |
| #include <sys/param.h> |
| #include <sys/types.h> |
| #include <stddef.h> |
| |
| #if defined __FreeBSD__ && !defined __FreeBSD_kernel__ |
| #define __FreeBSD_kernel__ |
| #endif |
| #if defined __APPLE__ && defined __MACH__ && !defined BSD |
| #define BSD 199506 |
| #endif |
| |
| #if defined BSD || __FreeBSD_kernel__ |
| #include "procstat.sysctl.c" |
| #if defined __FreeBSD_kernel__ || defined __NetBSD__ |
| #include "procstat.linux-procfs.c" |
| #endif |
| const struct procstat_interface procstat_available_interfaces[] = { |
| { PROCSTAT_INTERFACE_SYSCTL }, |
| #if defined __FreeBSD_kernel__ || defined __NetBSD__ |
| { PROCSTAT_INTERFACE_LINUX_PROCFS }, |
| #endif |
| { NULL } |
| }; |
| #elif defined __SVR4 |
| #include "procstat.sysv.c" |
| const struct procstat_interface procstat_available_interfaces[] = { |
| { PROCSTAT_INTERFACE_SYSV }, |
| { NULL } |
| }; |
| #elif defined __gnu_hurd__ |
| #include "procstat.hurd.c" |
| #include "procstat.linux-procfs.c" |
| const struct procstat_interface procstat_available_interfaces[] = { |
| { PROCSTAT_INTERFACE_HURD }, |
| { PROCSTAT_INTERFACE_LINUX_PROCFS }, |
| { NULL } |
| }; |
| #elif defined __linux__ || defined __CYGWIN__ |
| #include "procstat.linux-procfs.c" |
| const struct procstat_interface procstat_available_interfaces[] = { |
| { PROCSTAT_INTERFACE_LINUX_PROCFS }, |
| { NULL } |
| }; |
| #elif defined __INTERIX |
| #include "procstat.interix.c" |
| const struct procstat_interface procstat_available_interfaces[] = { |
| { PROCSTAT_INTERFACE_INTERIX }, |
| { NULL } |
| }; |
| #elif _WINDOWSNT_NATIVE |
| #include "procstat.nt.c" |
| const struct procstat_interface procstat_available_interfaces[] = { |
| { PROCSTAT_INTERFACE_NT }, |
| { NULL } |
| }; |
| #elif _WIN32 |
| #include "procstat.windows.c" |
| const struct procstat_interface procstat_available_interfaces[] = { |
| { PROCSTAT_INTERFACE_WINDOWS }, |
| { NULL } |
| }; |
| #else |
| #error "Unsupported platform" |
| #endif |