xref: /netbsd-src/external/gpl3/gdb/dist/sim/testsuite/cris/c/readlink1.c (revision 4b169a6ba595ae283ca507b26b15fdff40495b1c)
1 /*
2 #progos: linux
3 */
4 
5 #include <unistd.h>
6 #include <errno.h>
7 #include <stdio.h>
8 #include <stdlib.h>
9 
main(int argc,char * argv[])10 int main (int argc, char *argv[])
11 {
12   char buf[1024];
13   /* This depends on the test-setup, but it's unlikely that the program
14      is passed as a symlink, so supposedly safe.   */
15   if (readlink(argv[0], buf, sizeof (buf)) != -1 || errno != EINVAL)
16     abort ();
17 
18   printf ("pass\n");
19   exit (0);
20 }
21