Skip to content

syscall: no SYS_FORK and SYS_DUP2 on linux/arm64 #11981

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jefby opened this issue Aug 2, 2015 · 8 comments
Closed

syscall: no SYS_FORK and SYS_DUP2 on linux/arm64 #11981

jefby opened this issue Aug 2, 2015 · 8 comments

Comments

@jefby
Copy link

jefby commented Aug 2, 2015

Hi , recently i want to make the hyper(x86_64) work on arm64,found some error when compiling the source code,the main information like below:

# hyper/hypervisor/qemu
hypervisor/qemu/qemu_process.go:47: undefined: syscall.SYS_FORK
hypervisor/qemu/qemu_process.go:127: undefined: syscall.Dup2
hypervisor/qemu/qemu_process.go:128: undefined: syscall.Dup2
hypervisor/qemu/qemu_process.go:129: undefined: syscall.Dup2

Is go1.5beta2 not provided the syscall.Dup2 or syscall.SYS_FORK in arm64 ?? If i want to use these syscall,how to do ??

Thanks very much!

@davecheney
Copy link
Contributor

Those syscalls are not supported on arm64. I don't know what the
replacement is for SYS_FORK, but the replacement for dup is, SYS_DUP3.

On Sun, 2 Aug 2015 15:58 jefby notifications@github.com wrote:

Hi , recently i want to make the hyper(x86_64) work on arm64,found some
error when compiling the source code,the main information like below:

hyper/hypervisor/qemu

hypervisor/qemu/qemu_process.go:47: undefined: syscall.SYS_FORK
hypervisor/qemu/qemu_process.go:127: undefined: syscall.Dup2
hypervisor/qemu/qemu_process.go:128: undefined: syscall.Dup2
hypervisor/qemu/qemu_process.go:129: undefined: syscall.Dup2

Is go1.5beta2 not provided the syscall.Dup2 or syscall.SYS_FORK in arm64
?? If i want to use these syscall,how to do ??

Thanks very much!


Reply to this email directly or view it on GitHub
#11981.

@davecheney
Copy link
Contributor

Related, I don't know how that code is using SYS_FORK, but I'd be worried
that it was correct, forking in multi threaded programs should be performed
with extreme care.

On Sun, 2 Aug 2015 16:01 Dave Cheney dave@cheney.net wrote:

Those syscalls are not supported on arm64. I don't know what the
replacement is for SYS_FORK, but the replacement for dup is, SYS_DUP3.

On Sun, 2 Aug 2015 15:58 jefby notifications@github.com wrote:

Hi , recently i want to make the hyper(x86_64) work on arm64,found some
error when compiling the source code,the main information like below:

hyper/hypervisor/qemu

hypervisor/qemu/qemu_process.go:47: undefined: syscall.SYS_FORK
hypervisor/qemu/qemu_process.go:127: undefined: syscall.Dup2
hypervisor/qemu/qemu_process.go:128: undefined: syscall.Dup2
hypervisor/qemu/qemu_process.go:129: undefined: syscall.Dup2

Is go1.5beta2 not provided the syscall.Dup2 or syscall.SYS_FORK in arm64
?? If i want to use these syscall,how to do ??

Thanks very much!


Reply to this email directly or view it on GitHub
#11981.

@jefby
Copy link
Author

jefby commented Aug 2, 2015

@davecheney ok,Thanks very much.

@jefby
Copy link
Author

jefby commented Aug 2, 2015

@davecheney They uses SYS_FORK like below

ret, ret2, errno := syscall.RawSyscall(syscall.SYS_FORK, 0, 0, 0)

and the source code is here.https://github.com/hyperhq/hyper/blob/master/hypervisor/qemu/qemu_process.go +47 line.

@davecheney
Copy link
Contributor

I think that code is very dangerous.

On Sun, 2 Aug 2015 16:05 jefby notifications@github.com wrote:

@davecheney https://github.com/davecheney They uses SYS_FORK like below

ret, ret2, errno := syscall.RawSyscall(syscall.SYS_FORK, 0, 0, 0)

and the source code is here.
https://github.com/hyperhq/hyper/blob/master/hypervisor/qemu/qemu_process.go
+47 line.


Reply to this email directly or view it on GitHub
#11981 (comment).

@jefby
Copy link
Author

jefby commented Aug 2, 2015

@davecheney Now if i want to reimplement this feature , how to do? I'm not familiar with go language.

@davecheney
Copy link
Contributor

I recommend syscall.ForkExec. Thanks for testing on arm64.

On Sun, 2 Aug 2015 16:12 jefby notifications@github.com wrote:

@davecheney https://github.com/davecheney Now if i want to reimplement
this feature , how to do? I'm not familiar with go language.


Reply to this email directly or view it on GitHub
#11981 (comment).

@bradfitz
Copy link
Contributor

bradfitz commented Aug 2, 2015

Closing, because I don't think there's anything to do here.

@bradfitz bradfitz closed this as completed Aug 2, 2015
@mikioh mikioh changed the title arm64 no SYS_FORK and SYS_DUP2 syscall ?? syscall: no SYS_FORK and SYS_DUP2 on linux/arm64 Aug 2, 2015
@golang golang locked and limited conversation to collaborators Aug 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants