From b6c134c4cd8795a18fbeb6d229bbebb022319efa Mon Sep 17 00:00:00 2001 From: Dennis Bonke Date: Sun, 13 Feb 2022 16:15:29 +0100 Subject: [PATCH] options/linux: Add two ifaddrs functions Signed-off-by: Dennis Bonke --- options/linux/generic/ifaddrs.cpp | 15 +++++++++++++++ options/linux/include/ifaddrs.h | 3 +++ options/linux/meson.build | 1 + 3 files changed, 19 insertions(+) create mode 100644 options/linux/generic/ifaddrs.cpp diff --git a/options/linux/generic/ifaddrs.cpp b/options/linux/generic/ifaddrs.cpp new file mode 100644 index 0000000000..67dfbc6ce9 --- /dev/null +++ b/options/linux/generic/ifaddrs.cpp @@ -0,0 +1,15 @@ +#include +#include +#include +#include + +int getifaddrs(struct ifaddrs **) { + mlibc::infoLogger() << "mlibc: getifaddrs fails unconditionally!" << frg::endlog; + errno = ENOSYS; + return -1; +} + +void freeifaddrs(struct ifaddrs *) { + mlibc::infoLogger() << "mlibc: freeifaddrs is a stub!" << frg::endlog; + return; +} diff --git a/options/linux/include/ifaddrs.h b/options/linux/include/ifaddrs.h index 164ed4cbe8..aaab2c7a86 100644 --- a/options/linux/include/ifaddrs.h +++ b/options/linux/include/ifaddrs.h @@ -21,6 +21,9 @@ struct ifaddrs { void *ifa_data; }; +int getifaddrs(struct ifaddrs **); +void freeifaddrs(struct ifaddrs *); + #ifdef __cplusplus } #endif diff --git a/options/linux/meson.build b/options/linux/meson.build index a17902b379..47c92814ec 100644 --- a/options/linux/meson.build +++ b/options/linux/meson.build @@ -23,6 +23,7 @@ libc_sources += files( 'generic/linux-unistd.cpp', 'generic/malloc.cpp', 'generic/sys-fsuid.cpp', + 'generic/ifaddrs.cpp', ) if not no_headers