diff options
Diffstat (limited to 'sysdeps/stub')
-rw-r--r-- | sysdeps/stub/bits/libc-lock.h | 14 | ||||
-rw-r--r-- | sysdeps/stub/if_index.c | 8 |
2 files changed, 22 insertions, 0 deletions
diff --git a/sysdeps/stub/bits/libc-lock.h b/sysdeps/stub/bits/libc-lock.h index fa4dcdde1d..9efd799dab 100644 --- a/sysdeps/stub/bits/libc-lock.h +++ b/sysdeps/stub/bits/libc-lock.h @@ -70,6 +70,20 @@ /* Unlock the recursive named lock variable. */ #define __libc_lock_unlock_recursive(NAME) + +/* Define once control variable. */ +#define __libc_once_define(NAME) int NAME = 0 + +/* Call handler iff the first call. */ +#define __libc_once(ONCE_CONTROL, INIT_FUNCTION) \ + do { \ + if ((ONCE_CONTROL) == 0) { \ + INIT_FUNCTION (); \ + (ONCE_CONTROL) = 1; \ + } \ + } while (0) + + /* Start critical region with cleanup. */ #define __libc_cleanup_region_start(FCT, ARG) diff --git a/sysdeps/stub/if_index.c b/sysdeps/stub/if_index.c index c8f9ea8929..ca859f75fc 100644 --- a/sysdeps/stub/if_index.c +++ b/sysdeps/stub/if_index.c @@ -16,28 +16,36 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include <errno.h> #define __need_NULL #include <stddef.h> unsigned int if_nametoindex (const char *ifname) { + __set_errno (ENOSYS); return 0; } +stub_warning (if_nametoindex) char * if_indextoname (unsigned int ifindex, char *ifname) { + __set_errno (ENOSYS); return NULL; } +stub_warning (if_indextoname) void if_freenameindex (struct if_nameindex *ifn) { } +stub_warning (if_freenameindex) struct if_nameindex * if_nameindex (void) { + __set_errno (ENOSYS); return NULL; } +stub_warning (if_nameindex) |