예제 #1
0
int
main (int argc _GL_UNUSED, char *argv[])
{
  int result;

  set_program_name (argv[0]);

  /* Remove any leftovers from a previous partial run.  */
  ignore_value (system ("rm -rf " BASE "*"));

  result = test_stat_func (do_stat, false);
  ASSERT (test_lstat_func (do_lstat, false) == result);
  dfd = open (".", O_RDONLY);
  ASSERT (0 <= dfd);
  ASSERT (test_stat_func (do_stat, false) == result);
  ASSERT (test_lstat_func (do_lstat, false) == result);
  ASSERT (close (dfd) == 0);

  /* FIXME - add additional tests of dfd not at current directory.  */

  if (result == 77)
    fputs ("skipping test: symlinks not supported on this file system\n",
           stderr);
  return result;
}
예제 #2
0
int
main (int argc _GL_UNUSED, char *argv[])
{
  int result;

  set_program_name (argv[0]);

  /* Remove any leftovers from a previous partial run.  */
  ignore_value (system ("rm -rf " BASE "*"));

  /* Test behaviour for invalid file descriptors.  */
  {
    struct stat statbuf;

    errno = 0;
    ASSERT (fstatat (-1, "foo", &statbuf, 0) == -1);
    ASSERT (errno == EBADF);
  }
  {
    struct stat statbuf;

    errno = 0;
    ASSERT (fstatat (99, "foo", &statbuf, 0) == -1);
    ASSERT (errno == EBADF);
  }

  result = test_stat_func (do_stat, false);
  ASSERT (test_lstat_func (do_lstat, false) == result);
  dfd = open (".", O_RDONLY);
  ASSERT (0 <= dfd);
  ASSERT (test_stat_func (do_stat, false) == result);
  ASSERT (test_lstat_func (do_lstat, false) == result);
  ASSERT (close (dfd) == 0);

  /* FIXME - add additional tests of dfd not at current directory.  */

  if (result == 77)
    fputs ("skipping test: symlinks not supported on this file system\n",
           stderr);
  return result;
}
예제 #3
0
int
main (void)
{
  return test_stat_func (do_stat, true);
}
예제 #4
0
int
main ()
{
  return test_stat_func (do_stat);
}