Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
92c633ae
Commit
92c633ae
authored
Nov 03, 2002
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SPARC64]: Translate SO_{SND,RCV}TIMEO socket options.
parent
f21701fb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
5 deletions
+60
-5
arch/sparc64/kernel/sys32.S
arch/sparc64/kernel/sys32.S
+1
-5
arch/sparc64/kernel/sys_sparc32.c
arch/sparc64/kernel/sys_sparc32.c
+59
-0
No files found.
arch/sparc64/kernel/sys32.S
View file @
92c633ae
...
@@ -42,7 +42,7 @@ sys32_mknod:
...
@@ -42,7 +42,7 @@ sys32_mknod:
and
%
o2
,
%
g2
,
%
o2
and
%
o2
,
%
g2
,
%
o2
.
align
32
.
align
32
.
globl
sys32_sendto
,
sys32_recvfrom
,
sys32_getsockopt
.
globl
sys32_sendto
,
sys32_recvfrom
sys32_sendto
:
sys32_sendto
:
sethi
%
hi
(
sys_sendto
),
%
g1
sethi
%
hi
(
sys_sendto
),
%
g1
jmpl
%
g1
+
%
lo
(
sys_sendto
),
%
g0
jmpl
%
g1
+
%
lo
(
sys_sendto
),
%
g0
...
@@ -52,10 +52,6 @@ sys32_recvfrom:
...
@@ -52,10 +52,6 @@ sys32_recvfrom:
sethi
%
hi
(
sys_recvfrom
),
%
g1
sethi
%
hi
(
sys_recvfrom
),
%
g1
jmpl
%
g1
+
%
lo
(
sys_recvfrom
),
%
g0
jmpl
%
g1
+
%
lo
(
sys_recvfrom
),
%
g0
srl
%
o5
,
0
,
%
o5
srl
%
o5
,
0
,
%
o5
sys32_getsockopt
:
sethi
%
hi
(
sys_getsockopt
),
%
g1
jmpl
%
g1
+
%
lo
(
sys_getsockopt
),
%
g0
srl
%
o4
,
0
,
%
o4
.
globl
sys32_bdflush
.
globl
sys32_bdflush
sys32_bdflush
:
sys32_bdflush
:
...
...
arch/sparc64/kernel/sys_sparc32.c
View file @
92c633ae
...
@@ -2731,12 +2731,34 @@ static int do_set_icmpv6_filter(int fd, int level, int optname,
...
@@ -2731,12 +2731,34 @@ static int do_set_icmpv6_filter(int fd, int level, int optname,
return
ret
;
return
ret
;
}
}
static
int
do_set_sock_timeout
(
int
fd
,
int
level
,
int
optname
,
char
*
optval
,
int
optlen
)
{
struct
timeval32
*
up
=
(
struct
timeval32
*
)
optval
;
struct
timeval
ktime
;
mm_segment_t
old_fs
;
int
err
;
if
(
optlen
<
sizeof
(
*
up
))
return
-
EINVAL
;
if
(
get_user
(
ktime
.
tv_sec
,
&
up
->
tv_sec
)
||
__get_user
(
ktime
.
tv_usec
,
&
up
->
tv_usec
))
return
-
EFAULT
;
old_fs
=
get_fs
();
set_fs
(
KERNEL_DS
);
err
=
sys_setsockopt
(
fd
,
level
,
optname
,
(
char
*
)
&
ktime
,
sizeof
(
ktime
));
set_fs
(
old_fs
);
return
err
;
}
asmlinkage
int
sys32_setsockopt
(
int
fd
,
int
level
,
int
optname
,
asmlinkage
int
sys32_setsockopt
(
int
fd
,
int
level
,
int
optname
,
char
*
optval
,
int
optlen
)
char
*
optval
,
int
optlen
)
{
{
if
(
optname
==
SO_ATTACH_FILTER
)
if
(
optname
==
SO_ATTACH_FILTER
)
return
do_set_attach_filter
(
fd
,
level
,
optname
,
return
do_set_attach_filter
(
fd
,
level
,
optname
,
optval
,
optlen
);
optval
,
optlen
);
if
(
optname
==
SO_RCVTIMEO
||
optname
==
SO_SNDTIMEO
)
return
do_set_sock_timeout
(
fd
,
level
,
optname
,
optval
,
optlen
);
if
(
level
==
SOL_ICMPV6
&&
optname
==
ICMPV6_FILTER
)
if
(
level
==
SOL_ICMPV6
&&
optname
==
ICMPV6_FILTER
)
return
do_set_icmpv6_filter
(
fd
,
level
,
optname
,
return
do_set_icmpv6_filter
(
fd
,
level
,
optname
,
optval
,
optlen
);
optval
,
optlen
);
...
@@ -2744,6 +2766,43 @@ asmlinkage int sys32_setsockopt(int fd, int level, int optname,
...
@@ -2744,6 +2766,43 @@ asmlinkage int sys32_setsockopt(int fd, int level, int optname,
return
sys_setsockopt
(
fd
,
level
,
optname
,
optval
,
optlen
);
return
sys_setsockopt
(
fd
,
level
,
optname
,
optval
,
optlen
);
}
}
extern
asmlinkage
long
sys_getsockopt
(
int
fd
,
int
level
,
int
optname
,
char
*
optval
,
int
*
optlen
);
static
int
do_get_sock_timeout
(
int
fd
,
int
level
,
int
optname
,
char
*
optval
,
int
*
optlen
)
{
struct
timeval32
*
up
=
(
struct
timeval32
*
)
optval
;
struct
timeval
ktime
;
mm_segment_t
old_fs
;
int
len
,
err
;
if
(
get_user
(
len
,
optlen
))
return
-
EFAULT
;
if
(
len
<
sizeof
(
*
up
))
return
-
EINVAL
;
len
=
sizeof
(
ktime
);
old_fs
=
get_fs
();
set_fs
(
KERNEL_DS
);
err
=
sys_getsockopt
(
fd
,
level
,
optname
,
(
char
*
)
&
ktime
,
&
len
);
set_fs
(
old_fs
);
if
(
!
err
)
{
if
(
put_user
(
sizeof
(
*
up
),
optlen
)
||
put_user
(
ktime
.
tv_sec
,
&
up
->
tv_sec
)
||
__put_user
(
ktime
.
tv_usec
,
&
up
->
tv_usec
))
err
=
-
EFAULT
;
}
return
err
;
}
asmlinkage
int
sys32_getsockopt
(
int
fd
,
int
level
,
int
optname
,
char
*
optval
,
int
*
optlen
)
{
if
(
optname
==
SO_RCVTIMEO
||
optname
==
SO_SNDTIMEO
)
return
do_get_sock_timeout
(
fd
,
level
,
optname
,
optval
,
optlen
);
return
sys_getsockopt
(
fd
,
level
,
optname
,
optval
,
optlen
);
}
extern
void
check_pending
(
int
signum
);
extern
void
check_pending
(
int
signum
);
asmlinkage
int
sys32_sigaction
(
int
sig
,
struct
old_sigaction32
*
act
,
struct
old_sigaction32
*
oact
)
asmlinkage
int
sys32_sigaction
(
int
sig
,
struct
old_sigaction32
*
act
,
struct
old_sigaction32
*
oact
)
...
...
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