Back to index

cell-binutils  2.17cvs20070401
Functions
fdmatch.c File Reference
#include "ansidecl.h"
#include "libiberty.h"
#include <sys/types.h>
#include <sys/stat.h>

Go to the source code of this file.

Functions

int fdmatch (int fd1, int fd2)

Function Documentation

int fdmatch ( int  fd1,
int  fd2 
)

Definition at line 52 of file fdmatch.c.

{
  struct stat sbuf1;
  struct stat sbuf2;

  if ((fstat (fd1, &sbuf1) == 0) &&
      (fstat (fd2, &sbuf2) == 0) &&
      (sbuf1.st_dev == sbuf2.st_dev) &&
      (sbuf1.st_ino == sbuf2.st_ino))
    {
      return (1);
    }
  else
    {
      return (0);
    }
}