freebsdminix

Why strcpy is defined in Lint_strcpy.c in minix?


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?


Solution

  • If you actually look at the source inside lib/libc/string/Lint_strcpy.c you'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 in common/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).