hi,
all
I'm confused with the following code(Eal_memory.c in lib\librte_eal\linuxapp\eal directory, LINE 373):
nodestr = strstr(buf," N");
if(nodestr == NULL) {...}
nodestr += 2;
end = strstr(nodestr,"=");
if(end == NULL) {...}
// here nodestr = "0=1"
end[0] = '\0';
end = NULL;
// here nodestr = "0"
socket_id = strtoul(nodestr,&end,0);
Through "printf", I know that:
buf = "00200000 default file=/mnt/dpdk/huge/rtemap_1 huge dirty=1 N0=1"
And finally socket_id=0
My question is :why we get the socket_id before "=" instead of after "=" ?
and if we want to get the character after "N", isn't this code too complex?
I will be very appreciate for any help.
Regards!
Maria