nfds This argument should be set to the highest-numbered file
descriptor in any of the three sets, plus 1. The
indicated file descriptors in each set are checked, up to
this limit (but see BUGS).
nfds
Ignored. The nfds parameter is included only for compatibility with Berkeley sockets.
sendto(ls[i], datagram, 4, 0, (struct sockaddr*)&addr, addrlen);
И прокомментируйте вопрос, а то непонятно что вы пытаетесь сделать.