xref: /netbsd-src/external/gpl3/gdb/dist/sim/testsuite/cris/c/sock1.c (revision 4b169a6ba595ae283ca507b26b15fdff40495b1c)
1*4b169a6bSchristos /*
2*4b169a6bSchristos #progos: linux
3*4b169a6bSchristos */
4*4b169a6bSchristos 
5*4b169a6bSchristos #include <sys/types.h>
6*4b169a6bSchristos #include <sys/socket.h>
7*4b169a6bSchristos #include <netinet/in.h>
8*4b169a6bSchristos #include <stdio.h>
9*4b169a6bSchristos #include <errno.h>
10*4b169a6bSchristos #include <stdlib.h>
11*4b169a6bSchristos 
12*4b169a6bSchristos /* Check that socketcall is suitably stubbed.  */
13*4b169a6bSchristos 
main(void)14*4b169a6bSchristos int main (void)
15*4b169a6bSchristos {
16*4b169a6bSchristos   int ret = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP);
17*4b169a6bSchristos 
18*4b169a6bSchristos   if (ret != -1)
19*4b169a6bSchristos     {
20*4b169a6bSchristos       fprintf (stderr, "sock: %d\n", ret);
21*4b169a6bSchristos       abort ();
22*4b169a6bSchristos     }
23*4b169a6bSchristos 
24*4b169a6bSchristos   if (errno != ENOSYS)
25*4b169a6bSchristos     {
26*4b169a6bSchristos       perror ("unexpected");
27*4b169a6bSchristos       abort ();
28*4b169a6bSchristos     }
29*4b169a6bSchristos 
30*4b169a6bSchristos   printf ("pass\n");
31*4b169a6bSchristos   return 0;
32*4b169a6bSchristos }
33