you need to be a bit careful with this. Some platforms don't have LD_PRELOAD but they do have equivalent functionality. For example IRIX uses _RLD_LIST, _RLDN32_LIST and _RLD64_LIST depending on what sort of executable it is. see the code in smbsh.c