Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
7da4e44b
Unverified
Commit
7da4e44b
authored
Apr 16, 2019
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
raw_syscalls: lxc_raw_clone()
Account for different trap number on 32bit SPARC. Link:
https://bugs.gentoo.org/656368
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
3f76bcd6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
16 deletions
+26
-16
raw_syscalls.c
src/lxc/raw_syscalls.c
+26
-16
No files found.
src/lxc/raw_syscalls.c
View file @
7da4e44b
...
...
@@ -47,7 +47,7 @@ pid_t lxc_raw_clone(unsigned long flags)
/* On s390/s390x and cris the order of the first and second arguments
* of the system call is reversed.
*/
return
(
int
)
syscall
(
__NR_clone
,
NULL
,
flags
|
SIGCHLD
);
return
syscall
(
__NR_clone
,
NULL
,
flags
|
SIGCHLD
);
#elif defined(__sparc__) && defined(__arch64__)
{
/*
...
...
@@ -55,28 +55,38 @@ pid_t lxc_raw_clone(unsigned long flags)
* boolean flag whether this is the child or the parent in %o1.
* Inline assembly is needed to get the flag returned in %o1.
*/
int
in_child
;
int
child_pid
;
asm
volatile
(
"mov %2, %%g1
\n\t
"
"mov %3, %%o0
\n\t
"
"mov 0 , %%o1
\n\t
"
"t 0x6d
\n\t
"
"mov %%o1, %0
\n\t
"
"mov %%o0, %1"
:
"=r"
(
in_child
),
"=r"
(
child_pid
)
:
"i"
(
__NR_clone
),
"r"
(
flags
|
SIGCHLD
)
:
"%o1"
,
"%o0"
,
"%g1"
);
int
child_pid
,
in_child
,
ret
;
asm
volatile
(
"mov %3, %%g1
\n\t
"
"mov %4, %%o0
\n\t
"
"mov 0 , %%o1
\n\t
"
#if defined(__arch64__)
"t 0x6d
\n\t
"
#else
"t 0x10
\n\t
"
#endif
"addx %%g0, 0, %2
\n\t
"
"mov %%o1, %0
\n\t
"
"mov %%o0, %1"
:
"=r"
(
in_child
),
"=r"
(
child_pid
),
"=r"
(
ret
)
:
"i"
(
__NR_clone
),
"r"
(
flags
|
SIGCHLD
)
:
"%o1"
,
"%o0"
,
"%g1"
,
"cc"
);
if
(
ret
)
{
errno
=
child_pid
;
return
-
1
;
}
if
(
in_child
)
return
0
;
else
return
child_pid
;
return
child_pid
;
}
#elif defined(__ia64__)
/* On ia64 the stack and stack size are passed as separate arguments. */
return
(
int
)
syscall
(
__NR_clone
,
flags
|
SIGCHLD
,
NULL
,
prctl_arg
(
0
));
return
syscall
(
__NR_clone
,
flags
|
SIGCHLD
,
NULL
,
prctl_arg
(
0
));
#else
return
(
int
)
syscall
(
__NR_clone
,
flags
|
SIGCHLD
,
NULL
);
return
syscall
(
__NR_clone
,
flags
|
SIGCHLD
,
NULL
);
#endif
}
...
...
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