[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: Tor is out

On Sat, Oct 18, 2008 at 6:15 AM, otto otto <o815@xxxxxxxxxxx> wrote:
> I get the following error when trying to build tor- 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
  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) {
  if (flock(fd, LOCK_EX|(blocking ? 0 : LOCK_NB)) < 0) {

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,