Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
PPSi
Commits
6397c744
Commit
6397c744
authored
Jan 31, 2013
by
Danilo Sabato
Committed by
Alessandro Rubini
Feb 10, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
arch-bare-linux: added two syscalls (close and setsockopt)
parent
dff20072
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
bare-linux.h
arch-bare-linux/bare-linux.h
+3
-1
syscalls.c
arch-bare-linux/syscalls.c
+14
-1
No files found.
arch-bare-linux/bare-linux.h
View file @
6397c744
...
...
@@ -32,7 +32,9 @@ extern int sys_bind(int fd, const struct bare_sockaddr *addr, int addrlen);
extern
int
sys_recv
(
int
fd
,
void
*
pkt
,
int
plen
,
int
flags
);
extern
int
sys_send
(
int
fd
,
void
*
pkt
,
int
plen
,
int
flags
);
extern
int
sys_shutdown
(
int
fd
,
int
flags
);
extern
int
sys_close
(
int
fd
);
extern
int
sys_setsockopt
(
int
fd
,
int
level
,
int
optname
,
const
void
*
optval
,
int
optlen
);
extern
int
sys_gettimeofday
(
void
*
tv
,
void
*
z
);
extern
int
sys_settimeofday
(
void
*
tv
,
void
*
z
);
extern
int
sys_adjtimex
(
void
*
tv
);
...
...
arch-bare-linux/syscalls.c
View file @
6397c744
...
...
@@ -28,6 +28,7 @@ _syscall2(int, gettimeofday, void *, tv, void *,z);
_syscall2
(
int
,
settimeofday
,
void
*
,
tv
,
void
*
,
z
);
_syscall1
(
int
,
adjtimex
,
void
*
,
tv
);
_syscall2
(
int
,
clock_gettime
,
int
,
clock
,
void
*
,
t
);
_syscall1
(
int
,
close
,
int
,
fd
);
/*
* In the bare arch I'd better use sys_ prefixed names
...
...
@@ -40,6 +41,8 @@ int sys_time(int tz)
__attribute__
((
alias
(
"time"
)));
int
sys_ioctl
(
int
fd
,
int
cmd
,
void
*
arg
)
__attribute__
((
alias
(
"ioctl"
)));
int
sys_close
(
int
fd
)
__attribute__
((
alias
(
"close"
)));
static
struct
sel_arg_struct
as
;
/* declared as local, it won't work */
int
sys_select
(
int
max
,
void
*
in
,
void
*
out
,
void
*
exc
,
void
*
tout
)
...
...
@@ -89,7 +92,7 @@ int sys_clock_gettime(int clock, void *t)
#define SYS_RECVMSG 17
/* sys_recvmsg(2) */
#define SYS_PACCEPT 18
/* sys_paccept(2) */
static
unsigned
long
args
[
4
];
static
unsigned
long
args
[
5
];
int
sys_socket
(
int
domain
,
int
type
,
int
proto
)
{
...
...
@@ -136,3 +139,13 @@ int sys_shutdown(int fd, int flags)
args
[
1
]
=
flags
;
return
socketcall
(
SYS_SHUTDOWN
,
args
);
}
int
sys_setsockopt
(
int
fd
,
int
level
,
int
optname
,
const
void
*
optval
,
int
optlen
)
{
args
[
0
]
=
fd
;
args
[
1
]
=
level
;
args
[
2
]
=
optname
;
args
[
3
]
=
(
unsigned
long
)
optval
;
args
[
4
]
=
optlen
;
return
socketcall
(
SYS_SETSOCKOPT
,
args
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment