redisContext *c=redisConnectUnix("/tmp/redis.sock");
if(c->err){
fprintf(stderr,"thread_id:%x can't connect to redis server and exit\n",pthread_self());
return ;
}
FILE *fp=fopen(arglist->filename,"r");
if(!fp){
fprintf(stderr,"can't open file %s and exit\n",arglist->filename);
return ;
}
if ((errno = ERANGE && (n==LONG_MAX || n ==LONG_MIN)) || (errno !=0 && n ==0)){
fprintf(stderr," is not a long int\n");
return 1;
}
if(strlen(av[1])>BUFSIZ-n-1){
fprintf(stderr,"filename too long\n");
return 1;
}
/* begin to spawn threads,first adjust the stack size per thread */
struct rlimit limit={RLIM_INFINITY,RLIM_INFINITY};
if(setrlimit(RLIMIT_STACK,&limit) == -1){
fprintf(stderr,"failed to adjust the stack size,maybe the user is not root and this program will be abort to avoid segment fault\n ");
return 1;
}