int shutdown(int s, int how) throw() { int retval; print_trace ("%*sshutdown(%d, %d)=...\n", indent, "", s, how); indent+=2; /* call the real shutdown function */ retval = real_shutdown (s, how); indent-=2; print_trace ("%*sshutdown(%d, %d)=%d\n", indent, "", s, how, retval); return retval; }
int shutdown(int fd, int how) { static int (*real_shutdown)(int, int) = NULL; int ret; struct fsocket_ioctl_arg arg; if ((fsocket_channel_fd >= 0) && fsocket_fd_set[fd]) { arg.fd = fd; arg.op.shutdown_op.how = how; ret = ioctl(fsocket_channel_fd, FSOCKET_IOC_SHUTDOWN_LISTEN, &arg); if (ret < 0) { FSOCKET_ERR("FSOCKET:Close failed!\n"); } } else { if (!real_shutdown) real_shutdown = dlsym(RTLD_NEXT, "shutdown"); ret = real_shutdown(fd, how); } return ret; }