For example in FreeBSD strcpy is defined in lib/libc/string/strcpy.c. Why in minix it is defined in lib/libc/string/Lint_strcpy.c, not in strcpy.c just like in FreeBSD? What does Lint prefix mean?
It's worth mentioning that in minix some functions (like strpcpy) are defined in this way. I mean, strpcpy is defined in lib/libc/string/strpcpy.c but strcpy is defined in lib/libc/string/Lint_strcpy.c. What's the point in this?
If you actually look at the source inside
lib/libc/string/Lint_strcpy.cyou'll find it is an empty definition.As in the original NetBSD source, the actual definition of
strcpy()used in building the C library for Minix is incommon/lib/libc/string/strcpy.c.This is done so that the same definition can be shared directly from the same source file for both the kernel and userland.
The
Lint_prefix indicates a file which is there just for the purpose of creating a "lint library", and is effectively a shortcut to somewhat simplify the build process for lint libraries (they could/should in theory use the common source file too).