1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 05:32:45 +01:00

Merge pull request #6775 from miri64/native/enh/vfs-ready

cpu: native: make syscalls vfs ready (introduce real_fcntl)
This commit is contained in:
Martine Lenders 2017-03-22 21:13:22 +01:00 committed by GitHub
commit a24d7eb162
3 changed files with 5 additions and 2 deletions

View File

@ -103,11 +103,11 @@ void native_async_read_add_handler(int fd, void *arg, native_async_read_callback
_sigio_child(_next_index);
#else
/* configure fds to send signals on io */
if (fcntl(fd, F_SETOWN, _native_pid) == -1) {
if (real_fcntl(fd, F_SETOWN, _native_pid) == -1) {
err(EXIT_FAILURE, "native_async_read_add_handler(): fcntl(F_SETOWN)");
}
/* set file access mode to non-blocking */
if (fcntl(fd, F_SETFL, O_NONBLOCK | O_ASYNC) == -1) {
if (real_fcntl(fd, F_SETFL, O_NONBLOCK | O_ASYNC) == -1) {
err(EXIT_FAILURE, "native_async_read_add_handler(): fcntl(F_SETFL)");
}
#endif /* not OSX */

View File

@ -96,6 +96,7 @@ extern int (*real_accept)(int socket, ...);
extern int (*real_bind)(int socket, ...);
extern int (*real_chdir)(const char *path);
extern int (*real_close)(int);
extern int (*real_fcntl)(int, int, ...);
/* The ... is a hack to save includes: */
extern int (*real_creat)(const char *path, ...);
extern int (*real_dup2)(int, int);

View File

@ -68,6 +68,7 @@ int (*real_getifaddrs)(struct ifaddrs **ifap);
int (*real_getpid)(void);
int (*real_chdir)(const char *path);
int (*real_close)(int);
int (*real_fcntl)(int, int, ...);
int (*real_creat)(const char *path, ...);
int (*real_dup2)(int, int);
int (*real_execve)(const char *, char *const[], char *const[]);
@ -454,6 +455,7 @@ void _native_init_syscalls(void)
*(void **)(&real_pipe) = dlsym(RTLD_NEXT, "pipe");
*(void **)(&real_chdir) = dlsym(RTLD_NEXT, "chdir");
*(void **)(&real_close) = dlsym(RTLD_NEXT, "close");
*(void **)(&real_fcntl) = dlsym(RTLD_NEXT, "fcntl");
*(void **)(&real_creat) = dlsym(RTLD_NEXT, "creat");
*(void **)(&real_fork) = dlsym(RTLD_NEXT, "fork");
*(void **)(&real_dup2) = dlsym(RTLD_NEXT, "dup2");