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

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gdb/] [gdb-6.8/] [sim/] [testsuite/] [sim/] [cris/] [c/] [readlink9.c] - Blame information for rev 26

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 26 jlechner
/* Check that odd cases of readlink work.
2
#notarget: cris*-*-elf
3
#cc: additional_flags=-DX="@exedir@"
4
*/
5
 
6
#include <unistd.h>
7
#include <errno.h>
8
#include <stdio.h>
9
#include <stdlib.h>
10
 
11
int main (int argc, char *argv[])
12
{
13
  /* We assume that "sim/testsuite" isn't renamed to anything that
14
     together with "<builddir>/" is shorter than 7 characters.  */
15
  char buf[7];
16
 
17
  if (readlink("/proc/42/exe", buf, sizeof (buf)) != sizeof (buf)
18
      || strncmp (buf, X, sizeof (buf)) != 0)
19
    abort ();
20
 
21
  printf ("pass\n");
22
  exit (0);
23
}

powered by: WebSVN 2.1.0

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