#include #include #include #include // if ( S_ISSOCK( info.st_mode ) ) /* * what happened to is sock */ int main(int ac, char *av[]) { struct stat info; int i; for ( i = 1 ; i < ac ; i++ ) { if ( stat( av[i], &info ) == -1 ){ perror( av[i] ); continue; } printf( "%s ", av[i] ); if ( S_ISSOCK( info.st_mode ) ) printf("is a socket\n"); else printf("is NOT a socket\n"); } return 0; }