
#include<stdio.h>
#include<unistd.h>
#include<netinet/in_systm.h>
#include<netinet/in.h>
#include<string.h>
#include<stdlib.h>
#include<pthread.h>

#include"zither.h"

extern global_data_t gd;




int malloc_set2(void)
{
int count = 0;

if((gd.ms.fdstat=(int*)malloc(sizeof(int)*(gd.ms.max_count)))==NULL){exit(1);}
if((gd.ms.sk=(int*)malloc(sizeof(int)*(gd.ms.max_count)))==NULL){exit(1);}
// if((gd.pt=(pthread_t *)malloc(sizeof(pthread_t)*(gd.ms.max_count)))==NULL){exit(1);}
if((gd.pt=(pthread_t *)malloc(sizeof(pthread_t)*(2048)))==NULL){exit(1);}
if((gd.ms.inip_addr=(char**)malloc(sizeof(char*)*(gd.ms.max_count)))==NULL){exit(1);}

for(count = 0; count < gd.ms.max_count; count ++){
   gd.ms.fdstat[count] = 0;
   gd.ms.sk[count] = 0;
//   gd.pt[count] = 0;
   if((gd.ms.inip_addr[count]=(char *)calloc(64, sizeof(char)))==NULL){exit(1);}
   }

// for(count = 0; count < 2048; count++){   // pthread 識別子
//   gd.pt[count] = (pthread_t *)malloc(sizeof(pthread_t));
//   }


return 0;
}




