Re: Failing FS modules (minix, sysv), SCSI tape module.

Linus Torvalds (Linus.Torvalds@cs.Helsinki.FI)
Wed, 2 Aug 1995 11:12:05 +0300

Jeff Uphoff: "Failing FS modules (minix, sysv), SCSI tape module." (Jul 30, 18:58):
> Seems these two need strnlen() defined ("exported") in kernel/ksyms.c to
> be workable modules, as well as other diddling to use them with
> "versions." Any problems with this? (I don't use versions, so I didn't
> pursue the additional work that would require; I just added X(strnlen)
> to ksyms.c.)

Note that the kernel export functions aren't mean to to be a library.
If a user program needs the functionality of "strnlen()", it shouldn't
try to get it from the kernel. Similarly, if a kernel module needs
strnlen(), it should link it in itself, not try to get it from the

The kernel exports only _kernel_ specific functions that a module can't
handle itself. You wouldn't expect the kernel to export "memset()",
would you? There's nothing "kernelish" about either routine.

Kernel modules that need library-type functions should link against the
kernel library, because that's what it's for. The kernel _itself_
shouldn't be considered a library.

I guess that the link stage for modules should add "LIBS" to the link
line (LIBS is created by the top-level kernel Makefile, and may contain
architecture-specific libraries).