aboutsummaryrefslogtreecommitdiff
path: root/sim/testsuite/cris/c/sock1.c
blob: 8d06bfaed304ca76cefc4e2ebf2bbb20029bd9a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
#progos: linux
*/

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>

/* Check that socketcall is suitably stubbed.  */

int main (void)
{
  int ret = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP);

  if (ret != -1)
    {
      fprintf (stderr, "sock: %d\n", ret);
      abort ();
    }

  if (errno != ENOSYS)
    {
      perror ("unexpected");
      abort ();
    }

  printf ("pass\n");
  return 0;
}