1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include "wrap.h" #include <sys/types.h> #include <sys/socket.h> int m3_getpeername(int s, struct sockaddr *name, int *namelen) { int result; ENTER_CRITICAL; MAKE_WRITABLE(name); MAKE_WRITABLE(namelen); result = getpeername(s, name, namelen); EXIT_CRITICAL; return result; }