Date: Fri, 2 Dec 2005 16:38:31 +0100 From: Aron Stansvik <elvstone@gmail.com> To: freebsd-questions@freebsd.org Subject: Why scandir(3) argument not const? Message-ID: <751a4f870512020738i5b30096fr@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?751a4f870512020738i5b30096fr>
