Randell Jesup <[EMAIL PROTECTED]> writes:
>       Sounds like what we'd want to build it upon.  If the FS doesn't
> support it, use st_dev/st_ino.

Actually, since it's in the kernel, the default implementation of the
vnode operation might be:

int
vop_default_cmp (struct vnode *v1, struct vnode *v2)
{
  return v1 == v2;
}

Or did you mean a fallback in the library function for when the kernel
doesn't provide the fdcmp (or whatever) system call?  That could be
something like:

/*
 * 1 if fd1 and fd2 point to the same file.
 * 0 if they are not
 * -1 if we can't compare them
 */

int
fdcmp (int fd1, int fd2)
{
  struct stat sb1, sb2;

  if(fstat(fd1, &sb1) < 0 || fstat(fd2, &sb2) < 0)
    return -1;
  return sb1.st_dev == sb2.st_dev && sb1.st_ino == sb2.st_ino;
}

> The real problem is getting people to switch.

You mean application programs?  Sure, but the only thing we can do
about that is implementing support for it, right?

/assar


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to