<div class="gmail_quote">On Wed, Jan 6, 2010 at 2:06 PM, Erich Weiler <span dir="ltr">&lt;<a href="mailto:weiler@soe.ucsc.edu">weiler@soe.ucsc.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
2: Or better yet, how does rsync itself check for the number of connections?<br></blockquote></div><div><br></div>See the connection.c file in the rsync source for the file locking used (which calls a routine in util.c).  Rsync tries to lock a 4-byte range in the file, starting from the start and incrementing by 4 bytes for each slot.  So, one way to check for the number of lockers is to use fcntl() with F_GETLK to query the presence of existing locks on the lockfile.<br clear="all">
<br>..wayne..<br>