On Mon, Jan 15, 2018 at 9:09 AM,  <tonywalker...@gmail.com> wrote:
>
> I'm doing more experiments with created shared-object files with functions
> that override syscalls and I've hit something I'd like to see if you guys
> can help with.
>
> See a cut-down version of what I'm doing here
>
> There are 2 problems..
>
> 1. If I run LD_PRELOAD=my.so ls - ls hangs completely. If however I remove
> the reference to fopen and rebuild the library - it works fine.

No idea.  You'll have to debug this to see where it is going wrong.

> 2. When I compile I get "could not determine kind of name for C.fopen64".
> Both fopen and fopen64 are defined within my stdio header file so why
> doesn't the compiler complain about fopen? If I change line 26 to fopen I
> can get round this problem but will likely hit issues with large files.

You neglected to say which system you are running on.  If it's
GNU/Linux, note that fopen64 is not declared by default.  It's only
declared if define the C preprocessor macro _LARGEFILE64_SOURCE while
compiling the file.  You may need a #cgo CFLAGS: line to add a -D
option.

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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to