Replacing broken APIs Direct replacement of missing APIs works well, but broken APIs are more difficult Differences in function prototypes between platform-supplied function and replacement can cause compilation failures Replacing broken platform-supplied functions is critical for secure code Example: snprintf's return value OpenSSH example: RFC3493 replacements getnameinfo(), getaddrinfo() To avoid clashes, we use an ugly (but useful) trick: #define the name out of the way Make sure you #define after inclusion of system headers