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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-7.1/] [sim/] [testsuite/] [sim/] [cris/] [c/] [writev2.c] - Blame information for rev 816

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 227 jeremybenn
/* Trivial test of failing writev: invalid file descriptor.
2
#notarget: cris*-*-elf
3
*/
4
#include <sys/uio.h>
5
#include <errno.h>
6
#include <stdio.h>
7
#include <stdlib.h>
8
 
9
#define X(x) {x, sizeof (x) -1}
10
struct iovec v[] = {
11
  X("a"),
12
  X("bcd"),
13
  X("efghi"),
14
  X("j"),
15
  X("klmn\n"),
16
};
17
 
18
int main (void)
19
{
20
  if (writev (99, v, sizeof v / sizeof (v[0])) != -1
21
      /* The simulator write gives EINVAL instead of EBADF; let's
22
         cope.  */
23
      || (errno != EBADF && errno != EINVAL))
24
    abort ();
25
 
26
  printf ("pass\n");
27
  return 0;
28
}

powered by: WebSVN 2.1.0

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