Alright, I have played with more options and now have this. It is still giving a seg fault
Code:
void * read_file(void*){
	FILE * oar1 ;
	oar1 = fopen("/dev/ttyT8S0","r");
	char ptrr[256] ;
	char *index = new char[256] ;
	char *value = new char[256] ;
	long ind = 0 ;
	long vl = 0 ;
	while(1){
		fgets(ptrr, 256, oar1);
		if(atoi(ptrr)!=0){
			index = strtok(ptrr,",");
			value = strtok(NULL,", ");
			ind = strtol(index,NULL,16);  vl = strtol(value,NULL,16);
			identifier.push_back(ind);
			vals.push_back(vl);
			cout<<ind<<" - "<<vl<<endl;
		}
	}
	fclose(oar1);
	
}