rem: fprintf(stderr, "Warning: readdir() failed: %s\n",
add: fprintf(stderr, "Warning: readdir_r() failed: %s\n",
context: stdio_readEntries(stdio_EntriesIterator **iteratorPtr,		char *buf, size_t len) {	char *end;	char **start;	int num;	const char *name;	size_t nameLen;	stdio_EntriesIterator *iterator;	iterator = *iteratorPtr;	// buf will be filled like this:	// The start of buf will contain pointers to char *,	// the end will contain the actual char[] that those pointers point to.	// The start and the end will grow towards eachother.	start = (char **) buf;	end = buf + len;	num = 0;#ifdef WIN32	for (; iterator->status == 0;			iterator->status = _findnext(iterator->dirHandle,			&iterator->findData))#else	for (; iterator->status == 0 && iterator->entry != NULL;			iterator->status = readdir_r(iterator->dirHandle,			iterator->direntBuffer, &iterator->entry))#endif	{#ifdef WIN32		name = iterator->findData.name;#else		name = iterator->entry->d_name;#endif		if (name[0] == '.' &&				(name[1] == '\0' ||				(name[1] == '.' && name[2] == '\0'))) {			// skip directories "." and ".."			continue;		}		nameLen = strlen(name) + 1;				// Does this work with systems that need memory access to be		// aligned on a certain number of bytes?		if ((size_t) (sizeof (char *) + nameLen) >				(size_t) (end - (char *) start)) {			// Not enough room to fit the pointer (at the beginning) and			// the string (at the end).			return num;		}		end -= nameLen;		memcpy(end, name, nameLen);		*start = end;		start++;		num++;	}#ifndef WIN32#	ifdef DEBUG	if (iterator->status != 0) {		fprintf(stderr, "Warning: readdir() failed: %s\n",				strerror(iterator->status));	}#	endif#endif	if (sizeof (char *) > (size_t) (end - (char *) start)) {		// not enough room to fit the NULL pointer.		// It will have to be reported seperately the next time.		return num;	}	*start = NULL;	num++;	return num;}