Skip to content

Commit

Permalink
options/linux: Add two ifaddrs functions
Browse files Browse the repository at this point in the history
Signed-off-by: Dennis Bonke <admin@dennisbonke.com>
  • Loading branch information
Dennisbonke committed Jun 5, 2022
1 parent 308ba86 commit b6c134c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
15 changes: 15 additions & 0 deletions options/linux/generic/ifaddrs.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include <bits/ensure.h>
#include <mlibc/debug.hpp>
#include <ifaddrs.h>
#include <errno.h>

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;
}
3 changes: 3 additions & 0 deletions options/linux/include/ifaddrs.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ struct ifaddrs {
void *ifa_data;
};

int getifaddrs(struct ifaddrs **);
void freeifaddrs(struct ifaddrs *);

#ifdef __cplusplus
}
#endif
Expand Down
1 change: 1 addition & 0 deletions options/linux/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b6c134c

Please sign in to comment.