All pastes #536258 Raw Edit

Someone

public text v1 · immutable
·published 2007-06-04 10:08 UTC
rendered paste body
#include <sys/types.h>
#include <sys/socket.h>
#include <ifaddrs.h>
#include <stdio.h>
#include <errno.h>

int
main() {
        struct ifaddrs *ifa;
        struct ifaddrs *p;
        if (getifaddrs(&ifa) != 0) {
                fprintf(stderr, "error %d\n", errno);
                return 1;
        }
        p = ifa;
        while (p != NULL) {
                printf("%s\n", p->ifa_name);
                p = p->ifa_next;
        }
        freeifaddrs(ifa);
        return 0;
}