Re: [go-nuts] How to determine the correct method signature to override fopen

2017-11-06 Thread Ian Lance Taylor
On Mon, Nov 6, 2017 at 10:58 AM, wrote: > > In that case - do you know how I can inspect the comparison it's doing? > Since I'm already doing this for the open system call, I know that it's > possible to write a function with the same definition. It seems in this case > that I'm not matching the

Re: [go-nuts] How to determine the correct method signature to override fopen

2017-11-06 Thread tonywalker . uk
In that case - do you know how I can inspect the comparison it's doing? Since I'm already doing this for the open system call, I know that it's possible to write a function with the same definition. It seems in this case that I'm not matching the representation that cgo is expecting. I would th

Re: [go-nuts] How to determine the correct method signature to override fopen

2017-11-03 Thread Ian Lance Taylor
On Fri, Nov 3, 2017 at 5:44 PM, wrote: > > Thanks Ian. I had included that because it seems required in order for me to > refer to the return type (C.FILE) and so I can access the underlying C.fopen > function. This is the approach I have with open but perhaps this is > different. > If I'm not s

Re: [go-nuts] How to determine the correct method signature to override fopen

2017-11-03 Thread tonywalker . uk
This is without the include: $ go build -buildmode=c-shared # github.com/walkert ./main.go:6:41: could not determine kind of name for C.FILE ./main.go:7:8: could not determine kind of name for C.fopen -- You received this message because you are subscribed to the Google Groups "golang-nuts"

Re: [go-nuts] How to determine the correct method signature to override fopen

2017-11-03 Thread tonywalker . uk
Thanks Ian. I had included that because it seems required in order for me to refer to the return type (C.FILE) and so I can access the underlying C.fopen function. This is the approach I have with open but perhaps this is different. If I'm not supposed to use the include, can you advise how I s

Re: [go-nuts] How to determine the correct method signature to override fopen

2017-11-03 Thread Ian Lance Taylor
On Fri, Nov 3, 2017 at 2:24 PM, wrote: > > I've been writing a shared-object which I'll use via LD_PRELOAD to override > the open syscall. This is currently working OK but now I want to move on to > fopen. I've defined it (as far as I can tell) in-line with the stdio header > see here. However, w

[go-nuts] How to determine the correct method signature to override fopen

2017-11-03 Thread tonywalker . uk
Hi, I've been writing a shared-object which I'll use via LD_PRELOAD to override the open syscall. This is currently working OK but now I want to move on to fopen. I've defined it (as far as I can tell) in-line with the stdio header see here . However, when