5 ms·
Small nitpick, LD_PRELOAD will override the write() function from the libc, which is a wrapper around the system call, not the write system call itself.
by vbernat 8y ago
Small nitpick, LD_PRELOAD will override the write() function from the libc, which is a wrapper around the system call, not the write system call itself.
- bdarnell 8y agoThis is significant for programs written in Go, which tends to make system calls directly instead of using the libc wrapper functions. LD_PRELOAD trickery often doesn't work with Go programs for this reason.
- saagarjha 8y agoOn macOS, Go just straight up prevents the use of DYLD_INSERT_LIBRARIES (the equivalent of LD_PRELOAD), because macOS runs dyld and this mucks with some sort of threading setup.