Skip to content
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

Move from the syscall package to the golang.org/x/sys/{unix,windows} #380

Merged
merged 3 commits into from
Jun 4, 2017
Merged

Move from the syscall package to the golang.org/x/sys/{unix,windows} #380

merged 3 commits into from
Jun 4, 2017

Conversation

sean-
Copy link
Contributor

@sean- sean- commented Jun 2, 2017

This is a very mechanical change: syscall. -> unix. or windows.

Assuming this passes compile time checks, this should be g2g.

func getProcessMemoryInfo(h syscall.Handle, mem *PROCESS_MEMORY_COUNTERS) (err error) {
r1, _, e1 := syscall.Syscall(procGetProcessMemoryInfo.Addr(), 3, uintptr(h), uintptr(unsafe.Pointer(mem)), uintptr(unsafe.Sizeof(*mem)))
func getProcessMemoryInfo(h windows.Handle, mem *PROCESS_MEMORY_COUNTERS) (err error) {
r1, _, e1 := windows.Syscall(procGetProcessMemoryInfo.Addr(), 3, uintptr(h), uintptr(unsafe.Pointer(mem)), uintptr(unsafe.Sizeof(*mem)))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on Windows, windows.Syscall and windows.EINVAL is not exists.

@shirou
Copy link
Owner

shirou commented Jun 3, 2017

Thank you for this awesome contribution!
I confirmed it works on

  • Linux amd64
  • Darwin amd64
  • FreeBSD amd64

However, process/process_windows.go could not compiled on Windows. It seems more study required to invoke dll proc using x/sys/windows packages. So, could you revert changes only process/process_windows.go? other part of this PR is great.

Thank you again!

@sean-
Copy link
Contributor Author

sean- commented Jun 3, 2017

@shirou Can you give the latest version a twirl on Windows? I backed out the changes for identifiers and functions that I couldn't find in the x/sys/windows package. I think this should be correct for Windows now.

@shirou
Copy link
Owner

shirou commented Jun 4, 2017

It can be build on Windows now! Thank you for your cool contribution!

@shirou shirou merged commit 60a0ef9 into shirou:master Jun 4, 2017
@sean- sean- deleted the retire-syscall branch June 4, 2017 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants