select() and svn 1.5
select() and svn 1.5
- Subject: select() and svn 1.5
- From: Luke Daley <email@hidden>
- Date: Sat, 30 Aug 2008 16:16:25 +1000
Hi,
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.
I essentially have this…
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.
--
LD.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden