1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-27 07:21:18 +01:00

native: add accept syscall declaration

This commit is contained in:
Ludwig Ortmann 2014-11-14 17:48:25 +01:00
parent 6b33ff1a31
commit 641cb4c488
3 changed files with 5 additions and 1 deletions

View File

@ -217,7 +217,7 @@ void handle_uart_sock(void)
t = sizeof(remote);
_native_syscall_enter();
if ((s = accept(_native_uart_sock, &remote, &t)) == -1) {
if ((s = real_accept(_native_uart_sock, &remote, &t)) == -1) {
err(EXIT_FAILURE, "handle_uart_sock: accept");
}
else {

View File

@ -78,6 +78,8 @@ extern void* (*real_calloc)(size_t nmemb, size_t size);
extern void* (*real_malloc)(size_t size);
extern void* (*real_realloc)(void *ptr, size_t size);
/* The ... is a hack to save includes: */
extern int (*real_accept)(int socket, ...);
/* The ... is a hack to save includes: */
extern int (*real_bind)(int socket, ...);
extern int (*real_close)(int);
extern int (*real_dup2)(int, int);

View File

@ -55,6 +55,7 @@ void (*real_free)(void *ptr);
void* (*real_malloc)(size_t size);
void* (*real_calloc)(size_t nmemb, size_t size);
void* (*real_realloc)(void *ptr, size_t size);
int (*real_accept)(int socket, ...);
int (*real_bind)(int socket, ...);
int (*real_printf)(const char *format, ...);
int (*real_getpid)(void);
@ -355,6 +356,7 @@ void _native_init_syscalls(void)
*(void **)(&real_malloc) = dlsym(RTLD_NEXT, "malloc");
*(void **)(&real_realloc) = dlsym(RTLD_NEXT, "realloc");
*(void **)(&real_free) = dlsym(RTLD_NEXT, "free");
*(void **)(&real_accept) = dlsym(RTLD_NEXT, "accept");
*(void **)(&real_bind) = dlsym(RTLD_NEXT, "bind");
*(void **)(&real_printf) = dlsym(RTLD_NEXT, "printf");
*(void **)(&real_getpid) = dlsym(RTLD_NEXT, "getpid");