URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 24 |
Rev 33 |
/* For this test, we need to do the lstat syscall directly, or else
|
/* For this test, we need to do the lstat syscall directly, or else
|
glibc gets a SEGV.
|
glibc gets a SEGV.
|
#notarget: cris*-*-elf
|
#notarget: cris*-*-elf
|
*/
|
*/
|
|
|
#include <unistd.h>
|
#include <unistd.h>
|
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
#include <stdio.h>
|
#include <stdio.h>
|
#include <errno.h>
|
#include <errno.h>
|
#include <stdlib.h>
|
#include <stdlib.h>
|
|
|
int main (void)
|
int main (void)
|
{
|
{
|
int ret;
|
int ret;
|
|
|
/* From Linux, we get EFAULT. The simulator sends us EINVAL. */
|
/* From Linux, we get EFAULT. The simulator sends us EINVAL. */
|
ret = syscall (SYS_lstat64, ".", NULL);
|
ret = syscall (SYS_lstat64, ".", NULL);
|
if (ret != -1 || (errno != EINVAL && errno != EFAULT))
|
if (ret != -1 || (errno != EINVAL && errno != EFAULT))
|
{
|
{
|
perror ("lstat");
|
perror ("lstat");
|
abort ();
|
abort ();
|
}
|
}
|
|
|
printf ("pass\n");
|
printf ("pass\n");
|
exit (0);
|
exit (0);
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.