site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Hi, I essentially have this… -- LD. _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... I have been developing a library that interposes several system calls . This is used in TextMate to intercept attempts to read from STDIN for the purpose of displaying a dialog to allow the user to enter input. This works for everything I have tested so far (e.g. Java, Ruby, Python, svn < 1.5), but not svn 1.5. int select(int, fd_set * __restrict, fd_set * __restrict, fd_set * __restrict, struct timeval * __restrict) __asm("_select"); int select_darwinextsn(int, fd_set * __restrict, fd_set * __restrict, fd_set * __restrict, struct timeval * __restrict) __asm("_select $DARWIN_EXTSN"); int select_darwinextsn_nocancel(int, fd_set * __restrict, fd_set * __restrict, fd_set * __restrict, struct timeval * __restrict) __asm("_select$DARWIN_EXTSN$NOCANCEL"); int select_nocancel_unix2003(int, fd_set * __restrict, fd_set * __restrict, fd_set * __restrict, struct timeval * __restrict) __asm("_select$NOCANCEL$UNIX2003"); int select_unix2003(int, fd_set * __restrict, fd_set * __restrict, fd_set * __restrict, struct timeval * __restrict) __asm("_select $UNIX2003"); int select(int nfds, fd_set * __restrict readfds, fd_set * __restrict writefds, fd_set * __restrict errorfds, struct timeval * __restrict timeout) { return syscall(SYS_select, nfds, readfds, writefds, errorfds, timeout); } int select_darwinextsn(int nfds, fd_set * __restrict readfds, fd_set * __restrict writefds, fd_set * __restrict errorfds, struct timeval * __restrict timeout) { return select(nfds, readfds, writefds, errorfds, timeout); } int select_darwinextsn_nocancel(int nfds, fd_set * __restrict readfds, fd_set * __restrict writefds, fd_set * __restrict errorfds, struct timeval * __restrict timeout) { return select(nfds, readfds, writefds, errorfds, timeout); } int select_nocancel_unix2003(int nfds, fd_set * __restrict readfds, fd_set * __restrict writefds, fd_set * __restrict errorfds, struct timeval * __restrict timeout) { return select(nfds, readfds, writefds, errorfds, timeout); } int select_unix2003(int nfds, fd_set * __restrict readfds, fd_set * __restrict writefds, fd_set * __restrict errorfds, struct timeval * __restrict timeout) { return select(nfds, readfds, writefds, errorfds, timeout); } DISCLAIMER: This is all magic to me and I don't understand what __asm() is really doing and that could very well be my problem. What happens with svn (say `svn log http://blah.com`), is that it calls select() with a single fd in the writefds set (presumably the fd that the network request is going out on) and a timeout of 3600. With svn < 1.5 with this implementation injected everything works fine. With svn 1.5, the syscall() returns immediately with -1 and the error is 'Bad file descriptor'. Is anyone able to shed any light on what might be happening here? Is my approach with the different symbols too naive? Been banging my head on this one for months, so any help would be appreciated. This email sent to site_archiver@lists.apple.com
participants (1)
-
Luke Daley