Ah ok. So I managed to get something to compile (ended up having to cast 
the 'const char' arguments to fopen64 to char before passing them to my 
go_fopen64 function but I still get:

fatal: morestack on g0
zsh: trace trap  LD_PRELOAD=./preload python test.py foo

I'm clearly out of my depth here but thanks for your help!

On Monday, January 15, 2018 at 3:43:40 PM UTC-5, Ian Lance Taylor wrote:
>
> On Mon, Jan 15, 2018 at 12:36 PM,  <tonywa...@gmail.com <javascript:>> 
> wrote: 
> > Thanks Ian. I assume I'd include it like this: 
> > // #include myfopen.h 
> > And also a myfopen.c with the actual function 
> > 
> > But how do I ensure the fopen64 in myfopen.h is exported to override the 
> > default? 
>
> The fopen64 function written in myfopen.c will follow ordinary C 
> rules.  If you don't make it static, it will be exported. 
>
> Ian 
>
> > On Monday, January 15, 2018 at 3:05:32 PM UTC-5, Ian Lance Taylor wrote: 
> >> 
> >> The simplist workaround is to export go_fopen64, and write a tiny 
> >> fopen64 in a different C file, with the right signature, that calls 
> >> go_fopen64. 
> >> 
> >> Ian 
> >> 
> > -- 
> > 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...@googlegroups.com <javascript:>. 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
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