Hello,
I came across a situation when “net” package is imported regardless directly or
indirectly via another package, go build generates these errors:
/sw/packages/go/1.19.4/src/net/cgo_linux.go:20:59: could not determine kind of
name for C.AI_ALL
/sw/packages/go/1.19.4/src/net/cg
After looking in cgo generated files, I found that in fact function
“c_test_func” is defined in 2 places.
1: ./cgo.cgo2.c:29: int c_test_func(int c1, int c2)
#line 3 "/nobackup/sbezverk/projects/go/worspace/cgo_test/cgo.go"
#include
extern int go_test_func(int
I am getting:
# command-line-arguments
/sw/packages/xr/go/1.19.4/pkg/tool/linux_amd64/link: running gcc failed: exit
status 1
/tmp/go-link-349950461/01.o: In function `c_test_func':
/nobackup/sbezverk/projects/go/worspace/cgo_test/cgo.go:9: multiple definition
of `c_test_func'
Hello,
I saw there was some debates about having “test build tag” here:
https://github.com/golang/go/issues/21360 and people were asking about real
life scenario. Here is one with CGO code, initially I was planning to add stubs
for C land calls into blah_test.go file. (I do not need to test
Related question: is it possible to replace golang's "link" tool with "ld"? It
looks like "ld" has greater flexibility to address my requirements.
Thank you in advance for your guidance.
Serguei
On 26/09/23, 12:32, "sbezverk" mailto:sbezv...@gmail.c
the size limit and pretty
much kills bash.
I am starting to get this:
```
dev-1:/user/sbezverk/go_connect > ls
-bash: /bin/ls: Argument list too long
```
For every internal bash command I try to execute.
I was wondering if there is a keyword forcing the linker not to try to resolve
everyth
Hello,
Since I could not find the answer in the cgo documentation, I would really
appreciate if somebody could help me to understand why when I build cgo code
with calls to the shared library, the linker tries to find the shared library
even though it is instructed to build dynamic binary an
Hello,
I came across a strange behavior in regular expression processing, please see
the following simple code which is supposed to match the second line of data
variable.
https://go.dev/play/p/QPrNRuhCv8r
The matching data starts at the beginning of the 3rd line so I expect the
patt
Hello,
I am starting to learn generics and I was wondering if the following code could
be refactored to use genercis, in order to avoid using per type Make() method.
https://go.dev/play/p/gE4Z6Zj19Is
I have 3 identical structs, they are defined with different types and used in
other t
Hello,
I am looking for some ideas about how efficiently use gpb-kv encoded data
structure. If each field of a data structure gets reconstructed with type
assertion, I suspect that might cause some performance issues for a high rate
data streams. Another concern is unknown structure of the
Thank you, I was suspecting that it was something simple I was missing.
On 2020-07-29, 3:47 PM, "burak serdar" wrote:
On Wed, Jul 29, 2020 at 1:42 PM sbezverk wrote:
>
> Hello,
>
>
>
> A bit of help would be much appreciated, her
Hello,
A bit of help would be much appreciated, here is the sample code:
https://play.golang.org/p/FYEC7MwU1qQ
I need to Unmarshal 3 levels map. The information is stored this was as a json
doc and there is no way to flatten it. This sample code works but since
UnmarshalJSON method of L
Hello,
Here is the part of code where I attempt to listen for icmp packet in a
namespace. The same code is used for IPv4 and IPv6, only proto and scr are
differ depending on ipv4 or ipv6 mode.
For IPv4 address code work as expected but for IPv6 ListenPacket fails.
org, err := ne
Hello,
I am trying to pass a descriptor using syscall.SendMsg/RecvMsg and I noticed
that inod for the second process is not the same as original, but according to
Unix Networking API, inod should stay the same and only number of reference to
inod should be incremented. Anybody successfully
Hi Jake,
Ioctl implementation in unix package seems a bit limited, how do you pass for
example a required struct if “func IoctlSetInt(fd int, req uint, value int)”
allows only to accept int?? If this package had a func accepting uintptr as a
parameter, then I guess that could work.
Thank you
S
I copied the whole thing to https://github.com/sbezverk/vfio
Running it without actual vfio/iommu might be problematic though.
Before this specific ioctl can be run 2 open calls must succeed. See func main.
Thank you for looking into this problem
Serguei
Sent from my iPhone
> On Aug 23, 2
Hello Jake,
Apologies about formatting, here is correctly formatted code:
// GetGroupFD gets File descriptor for a specified by PCI address device
func GetGroupFD(group int, pciDevice string) (int, error) {
buffer := make([]byte, len(pciDevice)+1)
for i, c := range
Hi Max,
Thanks for the suggestion, unfortunately it did not help, see below:
func GetGroupFD(group int, pciDevice *string) (int, error) {
fmt.Printf("VFIO_GROUP_GET_DEVICE_FD() returned: %04x\n",
VFIO_GROUP_GET_DEVICE_FD())
buffer := make([]byte, len(*pciDevice)+1)
for i, c := range
I changed code a little bit to be able to examine variables:
func GetGroupFD(group int, pciDevice *string) (int, error) {
ioctlId := 0x3b6a
var buffer uintptr
buffer = uintptr(unsafe.Pointer(pciDevice))
device, _, errno := syscall.Syscall(
syscall.SYS_IOCTL,
uintpt
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),
Hello,
Appreciate if somebody could recommend reliable dns client library supporting
AXFR type of requests.
I was using miekg/dns and I see some strange results.
Thank you
Serguei
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe
Hello,
I was wondering if anybody managed to get golang compiled binary to run on
32-bit QNX?
I compiled it with GOARCH=386 GOOS=linux go build -o blah
But when I start it in QNX I get core dump. I double check and the time of
executable matches type of native qnx binaries. Appreciate any su
Hello,
I am having trouble getting GID for a folder. I checked os.Stat api but it
returns only permissions, there is no Uid or Gid.
stat /mnt/disks/vol2
File: ‘/mnt/disks/vol2’
Size: 6 Blocks: 0 IO Block: 4096 directory
Device: fc12h/64530dInode: 64 Lin
23 matches
Mail list logo