No smb_raw_search_next in smb_cliraw.h

Stef Bon stefbon at
Thu Jul 17 03:34:23 MDT 2014

>> Now with io like fs event change request, it's not possible to make
>> the requesting thread wait. It should wait forever, causing a blocking
>> situation.
> What exactly do you mean with "fs event change" here? What
> API call do you make to receive those events?

I mean the fs event change calls like in source4/libcli/raw/rawnotify.c,
I have not implemented this. That is my question howto do this using
the tevent library.

My point is that with the construction

 while ( ! request is done) {



it will block the calling thread until the notify request is cancelled.
>> What works is that there is a special thread which watches the
>> filedescriptor for replies to the fs change notify request.
>> You agree with me?
> In general, we try to avoid threads. Even for async file I/O
> we have used a forked process with good success in the past:
> See vfs_aio_fork.c. Yes, this turned out to be too
> heavy-weight, so we converted this to a tevent_req based
> implementation with well-hidden threads using pthreadpool.

Maybe you can help me or somebody else. My question is where can I find the
part where incoming data is read and matched to the right waiting request.

Suppose there are two (or more) different requests send to the server.
After sending the request
both threads end up in the wait loop (tevent_loop_once) for the
request to be done.

I cannot find the code where the actual data is read (using a function
like recvmsg?) and matched to the right waiting process/request. This
matching is what I'm interested in. How does this work?
I'm digging in the tevent library, in the smbcli library but did not find it.

Can you give me an hint?

Stef Bon

More information about the samba-technical mailing list