mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-15 04:31:49 +08:00
1368b914e9
Now that all port tests live under testsuite/sim/*/, and none live in testsuite/ directly, flatten the structure by moving all of the dirs under testsuite/sim/ to testsuite/ directly. We need to stop passing --tool to dejagnu so that it searches all dirs and not just ones that start with "sim". Since we have no other dirs in this tree, and no plans to add any, should be fine.
29 lines
530 B
C
29 lines
530 B
C
/* Trivial test of failing writev: invalid file descriptor.
|
|
#notarget: cris*-*-elf
|
|
*/
|
|
#include <sys/uio.h>
|
|
#include <errno.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
#define X(x) {x, sizeof (x) -1}
|
|
struct iovec v[] = {
|
|
X("a"),
|
|
X("bcd"),
|
|
X("efghi"),
|
|
X("j"),
|
|
X("klmn\n"),
|
|
};
|
|
|
|
int main (void)
|
|
{
|
|
if (writev (99, v, sizeof v / sizeof (v[0])) != -1
|
|
/* The simulator write gives EINVAL instead of EBADF; let's
|
|
cope. */
|
|
|| (errno != EBADF && errno != EINVAL))
|
|
abort ();
|
|
|
|
printf ("pass\n");
|
|
return 0;
|
|
}
|