Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
25b2e65b
You need to sign in or sign up before continuing.
Commit
25b2e65b
authored
8 years ago
by
Martine Lenders
Browse files
Options
Downloads
Patches
Plain Diff
cpu: native: make syscalls vfs ready (introduce real_fcntl)
parent
4618bcfa
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cpu/native/async_read.c
+2
-2
2 additions, 2 deletions
cpu/native/async_read.c
cpu/native/include/native_internal.h
+1
-0
1 addition, 0 deletions
cpu/native/include/native_internal.h
cpu/native/syscalls.c
+2
-0
2 additions, 0 deletions
cpu/native/syscalls.c
with
5 additions
and
2 deletions
cpu/native/async_read.c
+
2
−
2
View file @
25b2e65b
...
@@ -103,11 +103,11 @@ void native_async_read_add_handler(int fd, void *arg, native_async_read_callback
...
@@ -103,11 +103,11 @@ void native_async_read_add_handler(int fd, void *arg, native_async_read_callback
_sigio_child
(
_next_index
);
_sigio_child
(
_next_index
);
#else
#else
/* configure fds to send signals on io */
/* 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)"
);
err
(
EXIT_FAILURE
,
"native_async_read_add_handler(): fcntl(F_SETOWN)"
);
}
}
/* set file access mode to non-blocking */
/* 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)"
);
err
(
EXIT_FAILURE
,
"native_async_read_add_handler(): fcntl(F_SETFL)"
);
}
}
#endif
/* not OSX */
#endif
/* not OSX */
...
...
This diff is collapsed.
Click to expand it.
cpu/native/include/native_internal.h
+
1
−
0
View file @
25b2e65b
...
@@ -96,6 +96,7 @@ extern int (*real_accept)(int socket, ...);
...
@@ -96,6 +96,7 @@ extern int (*real_accept)(int socket, ...);
extern
int
(
*
real_bind
)(
int
socket
,
...);
extern
int
(
*
real_bind
)(
int
socket
,
...);
extern
int
(
*
real_chdir
)(
const
char
*
path
);
extern
int
(
*
real_chdir
)(
const
char
*
path
);
extern
int
(
*
real_close
)(
int
);
extern
int
(
*
real_close
)(
int
);
extern
int
(
*
real_fcntl
)(
int
,
int
,
...);
/* The ... is a hack to save includes: */
/* The ... is a hack to save includes: */
extern
int
(
*
real_creat
)(
const
char
*
path
,
...);
extern
int
(
*
real_creat
)(
const
char
*
path
,
...);
extern
int
(
*
real_dup2
)(
int
,
int
);
extern
int
(
*
real_dup2
)(
int
,
int
);
...
...
This diff is collapsed.
Click to expand it.
cpu/native/syscalls.c
+
2
−
0
View file @
25b2e65b
...
@@ -68,6 +68,7 @@ int (*real_getifaddrs)(struct ifaddrs **ifap);
...
@@ -68,6 +68,7 @@ int (*real_getifaddrs)(struct ifaddrs **ifap);
int
(
*
real_getpid
)(
void
);
int
(
*
real_getpid
)(
void
);
int
(
*
real_chdir
)(
const
char
*
path
);
int
(
*
real_chdir
)(
const
char
*
path
);
int
(
*
real_close
)(
int
);
int
(
*
real_close
)(
int
);
int
(
*
real_fcntl
)(
int
,
int
,
...);
int
(
*
real_creat
)(
const
char
*
path
,
...);
int
(
*
real_creat
)(
const
char
*
path
,
...);
int
(
*
real_dup2
)(
int
,
int
);
int
(
*
real_dup2
)(
int
,
int
);
int
(
*
real_execve
)(
const
char
*
,
char
*
const
[],
char
*
const
[]);
int
(
*
real_execve
)(
const
char
*
,
char
*
const
[],
char
*
const
[]);
...
@@ -454,6 +455,7 @@ void _native_init_syscalls(void)
...
@@ -454,6 +455,7 @@ void _native_init_syscalls(void)
*
(
void
**
)(
&
real_pipe
)
=
dlsym
(
RTLD_NEXT
,
"pipe"
);
*
(
void
**
)(
&
real_pipe
)
=
dlsym
(
RTLD_NEXT
,
"pipe"
);
*
(
void
**
)(
&
real_chdir
)
=
dlsym
(
RTLD_NEXT
,
"chdir"
);
*
(
void
**
)(
&
real_chdir
)
=
dlsym
(
RTLD_NEXT
,
"chdir"
);
*
(
void
**
)(
&
real_close
)
=
dlsym
(
RTLD_NEXT
,
"close"
);
*
(
void
**
)(
&
real_close
)
=
dlsym
(
RTLD_NEXT
,
"close"
);
*
(
void
**
)(
&
real_fcntl
)
=
dlsym
(
RTLD_NEXT
,
"fcntl"
);
*
(
void
**
)(
&
real_creat
)
=
dlsym
(
RTLD_NEXT
,
"creat"
);
*
(
void
**
)(
&
real_creat
)
=
dlsym
(
RTLD_NEXT
,
"creat"
);
*
(
void
**
)(
&
real_fork
)
=
dlsym
(
RTLD_NEXT
,
"fork"
);
*
(
void
**
)(
&
real_fork
)
=
dlsym
(
RTLD_NEXT
,
"fork"
);
*
(
void
**
)(
&
real_dup2
)
=
dlsym
(
RTLD_NEXT
,
"dup2"
);
*
(
void
**
)(
&
real_dup2
)
=
dlsym
(
RTLD_NEXT
,
"dup2"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment