Hi, I need help understanding *static* *int* TracelibRunCmd(Tcl_Interp *in), it has blown my mind, I am totally new with these kevents.
I have been trying to understand that from a while now. Till what I understand, the thread responsible for creating server eventually calls tracelib run and then here *if* (1 != kevent(kq, &kev, 1, &kev, 1, *NULL*)). —— (1) waits here until the kqueue detects that someone is trying to read via socket and returns a value. in porttrace.tcl, the library gets injected and sandbox gets set. and then in portutil.tcl tracelib setdeps sets the dependencies. Now the in (1) , it would only return when someone tries to read data from the socket, when does that happen? Is it when darwintrace calls frecv? That seems to be the only part where data is read from that socket and for breaking going beyond that kevent(), reading seems necessary. But to do that accept() must be called which is called later. Sorry to make it so cluttered. Kindly help me in understanding this :) Regards, Mihir