Is it \0-terminated?

2018. augusztus 23., csütörtök 13:02:13 UTC+2 időpontban sbez...@cisco.com 
a következőt írta:
>
> Hello, 
>
> I am converting some C code to Go and hit an issue with one particular 
> Syscall: 
>
> In C: 
>
>         device = ioctl(group, 0x3b6a, path); 
> where path is char[N] 
>
> In Go: 
> ioctlId := 0x3b6a 
> device, _, errno := syscall.Syscall( 
>                 syscall.SYS_IOCTL, 
>                 uintptr(group), 
>                 uintptr(unsafe.Pointer(&ioctlId)), 
>                 uintptr(unsafe.Pointer(pciDevice)), 
>         ) 
> Where pciDevice is *string with exactly the same value as path in C. 
>
> When I run Go bits on the same h/w, same OS, same everything, it fails 
> with "errno 22 (invalid argument)". It seems that the issue is how string 
> gets passed to Syscall, but I could not find any examples how to do it 
> correctly. 
> Appreciate some advice here. 
>
> Thank you 
> Serguei 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to