Back to index

glibc  2.9
Defines | Functions
bug-if1.c File Reference
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <string.h>
#include <net/if.h>
#include "../test-skeleton.c"

Go to the source code of this file.


#define TEST_FUNCTION   do_test ()


static int do_test (void)

Define Documentation

#define TEST_FUNCTION   do_test ()

Definition at line 53 of file bug-if1.c.

Function Documentation

static int do_test ( void  ) [static]

Definition at line 28 of file bug-if1.c.

  char buf[IF_NAMESIZE];
  /* Index 0 is always invalid (see RFC 3493).  */
  char *cp = if_indextoname (0, buf);
  if (cp != NULL)
      printf ("invalid index returned result \"%s\"\n", cp);
      return 1;
  else if (errno != ENXIO)
      int err = errno;
      char errbuf1[256];
      char errbuf2[256];

      printf ("errno = %d (%s), expected %d (%s)\n",
             err, strerror_r (err, errbuf1, sizeof (errbuf1)),
             ENXIO, strerror_r (ENXIO, errbuf2, sizeof (errbuf2)));
      return 1;

  return 0;

Here is the call graph for this function: