OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-6.8/] [sim/] [testsuite/] [sim/] [cris/] [c/] [readlink9.c] - Diff between revs 24 and 157

Only display areas with differences | Details | Blame | View Log

Rev 24 Rev 157
/* Check that odd cases of readlink work.
/* Check that odd cases of readlink work.
#notarget: cris*-*-elf
#notarget: cris*-*-elf
#cc: additional_flags=-DX="@exedir@"
#cc: additional_flags=-DX="@exedir@"
*/
*/
 
 
#include <unistd.h>
#include <unistd.h>
#include <errno.h>
#include <errno.h>
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
 
 
int main (int argc, char *argv[])
int main (int argc, char *argv[])
{
{
  /* We assume that "sim/testsuite" isn't renamed to anything that
  /* We assume that "sim/testsuite" isn't renamed to anything that
     together with "<builddir>/" is shorter than 7 characters.  */
     together with "<builddir>/" is shorter than 7 characters.  */
  char buf[7];
  char buf[7];
 
 
  if (readlink("/proc/42/exe", buf, sizeof (buf)) != sizeof (buf)
  if (readlink("/proc/42/exe", buf, sizeof (buf)) != sizeof (buf)
      || strncmp (buf, X, sizeof (buf)) != 0)
      || strncmp (buf, X, sizeof (buf)) != 0)
    abort ();
    abort ();
 
 
  printf ("pass\n");
  printf ("pass\n");
  exit (0);
  exit (0);
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.