Hello. I read scandir(3).

Why:

scandir(const char *dirname, struct dirent ***namelist, int
(*select)(struct dirent *), int (*compar)(const void *, const void
*));

and not:

scandir(const char *dirname, struct dirent ***namelist, int
(*select)(const struct dirent *), int (*compar)(const void *, const
void *));

I.e. why is the dirent pointer in the third argument not a const
dirent pointer? I see that on Linux and NetBSD it is declared const,
but not so on FreeBSD and OpenBSD (don't know about other platforms).
Since this in not a POSIX function, but a BSD extension, it would be
nice if the prototypes for the function was compatible across
platforms. Is there any case where the filter function should need to
change the dirent structure? I think not.

Comments?

Best regards,
Aron Stansvik
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to