[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#220624: libc6-dev: breaks builds on 2.4 systems because depending on linux-kernel-headers which contain 2.5 headers



On Thu, Nov 13, 2003 at 03:07:45PM -0700, Alex Tsariounov wrote:
> On Thu, 2003-11-13 at 14:28, Daniel Jacobowitz wrote:
> > On Thu, Nov 13, 2003 at 01:50:58PM -0700, Alex Tsariounov wrote: 
> > > Are you saying that it is not and should not be used then?
> > 
> > Libc provides the function, as a convenience, esp. for architectures
> > where the _syscall macros in <asm/unistd.h> can't be directly used.
> > 
> > However, it does not provide a prototype or associated definitions. 
> > Which is what I said.
> 
> Well, this is why I said it was philosophical.  My root question would
> be: is the system call query_module() (along with it's relatives
> init_module, create_module, delete_module - although they are less
> important here since you need to be root to use them) a public
> interface?

It _was_ a public interface of the kernel.  The kernel doesn't provide
usable headers for its public interfaces; this is a known kernel bug
and they're talking about fixing it in 2.7.

It is no longer a public interface of the kernel.  It's gone in 2.6.

It's also never been a public interface of glibc.  Glibc provides the
wrapper purely as a convenience for accessing the Linux interface.

> If it is, then I would suggest it needs an include file which prototypes
> its use and supplies any needed constants/definitions.
> 
> For my case now, and hence this bug, I've decided to quit using the
> query_module() function because of the fud (it's not the first time it's
> been a problem).  I've also attached below the example code that I used
> to open this bug modified to use a different method to determine if a
> module is loaded for those who are monitoring this bug stream.
> 
> By using this other method (and hence not including linux/module.h), my
> build builds again.

The difference is, this will actually work in 2.6 kernels :)

> 
> Thanks,
> Alex Tsariounov
> 
> -----8<----- Compile this:
> 
> #include <stdio.h>
> 
> main(int argc, char *argv[])
> {
> 	FILE *fp;
> 	char line[4096];
> 
> 	if (argc<2) {
> 		printf("Usage: %s module_name\n", argv[0]);
> 		exit(1);
> 	}
> 
> 	fp = fopen("/proc/modules", "r");
> 	if (!fp) {
> 		perror("Opening /proc/modules");
> 		exit(1);
> 	}
> 
> 	while (fgets(line, sizeof(line), fp)) {
> 		if (strncmp(line, argv[1], strlen(argv[1])) == 0) {
> 			printf("Found %s loaded in kernel\n", argv[1]);
> 			exit (0);
> 		}
> 	}
> 
> 	printf("Can't find module %s in kernel\n", argv[1]);
> 	return 1;
> 	exit(0);
> }
> 
> -----8<--------8<-------
> 
> 
> 

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer



Reply to: