Skip to content

Commit

Permalink
Changed import and Added syscall info
Browse files Browse the repository at this point in the history
  • Loading branch information
usiegl00 committed Feb 6, 2021
1 parent afd6fc0 commit 3255d28
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sliver/hostuuid/uuid_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct timespec {

import (
"fmt"
"golang.org/x/sys/unix"
"syscall"
"unsafe"
)

Expand All @@ -58,10 +58,14 @@ type timespec struct {
tv_nsec int32
}

// Darwin syscall:
// int gethostuuid(unsigned char *uuid_buf, const struct timespec *timeoutp);
const gethostuuid = 142

func GetUUID() string {
uuid := uuid_t{}
timespec := timespec{tv_sec: 5, tv_nsec: 0}
unix.Syscall(142,
syscall.Syscall(gethostuuid,
uintptr(unsafe.Pointer(&uuid)),
uintptr(unsafe.Pointer(&timespec)),
uintptr(0),
Expand Down

0 comments on commit 3255d28

Please sign in to comment.