URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gdb-7.2/] [sim/] [testsuite/] [sim/] [cris/] [c/] [writev2.c] - Rev 330
Compare with Previous | Blame | View Log
/* 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; }