Tor 0.2.1.6-alpha is out

coderman coderman at gmail.com
Sat Oct 18 22:23:17 UTC 2008


On Sat, Oct 18, 2008 at 6:15 AM, otto otto <o815 at hotmail.com> wrote:
> I get the following error when trying to build tor-0.2.1.6-alpha on Sun
> Solaris 10x86.
> ...
> compat.c: In function `tor_lockfile_lock':
> compat.c:509: warning: implicit declaration of function `flock'

it looks like the way to fix this is add a configure check for "flock"
and fall back on fcntl when not present.  for example:

src/common/compat.c: line 508
#ifdef HAVE_FCNTL_H
  struct flock fl;
  fl.l_type   = F_WRLCK;
  fl.l_whence = SEEK_SET;
  fl.l_start  = 0;
  fl.l_len    = 0;
  fl.l_pid    = getpid();
  if (fcntl(fd, F_SETLK, &fl) < 0) {
#else
  if (flock(fd, LOCK_EX|(blocking ? 0 : LOCK_NB)) < 0) {
#endif

unlock is similar, except you set fl.l_type   = F_UNLCK;

this is a bit of a patch, and unfortunately not many Tor developers /
supporters use Solaris.  it would be nice to have a fix for this,
perhaps if you would be willing to test some patches i could take a
stab at initial support for the fcntl changes.

best regards,



More information about the tor-talk mailing list