freeifaddrs()--Free Dynamic Memory Allocated by getifaddrs()


  Syntax
  #include <ifaddrs.h>

  void freeifaddrs(struct ifaddrs *ifap)


  Service Program Name: QSOSRV2

  Default Public Authority: *USE

  Threadsafe: Yes

The freeifaddrs() function frees the dynamic memory that was allocated by the getifaddrs() function. After freeifaddrs() has been called, the application should not use the array of which ifap is the address.


Parameters

ifap
(Input) Linked list of ifaddrs structures. ifap must be a pointer that was returned by getifaddrs().

The ifaddrs structure is defined in <ifaddrs.h>.

      struct ifaddrs
      {
        struct ifaddrs   *ifa_next;
        char             *ifa_name;
        u_int             ifa_flags;
        struct sockaddr  *ifa_addr;
        struct sockaddr  *ifa_netmask;
        union
        {
          struct sockaddr *ifu_broadaddr;
          struct sockaddr *ifu_dstaddr;
        }  ifa_ifu;
        void             *ifa_data;
      };

Authorities

No authorization is required.


Return Value

None.


Error Conditions

errno can be set to:

[EFAULT] The address used for an argument was not correct.


Related Information



API introduced: V6R1

[ Back to top | UNIX-Type APIs | APIs by category ]