*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Linux man pages -> query_module (2)              



NAME    [Toc]    [Back]

       query_module - query the kernel for various bits pertaining to modules.

SYNOPSIS    [Toc]    [Back]

       #include <linux/module.h>

       int query_module(const char *name, int which,
       void *buf, size_t bufsize, size_t *ret);

DESCRIPTION    [Toc]    [Back]

       query_module requests information related to loadable modules from  the
       kernel.	 The  precise nature of the information and its format depends
       on the which sub function.  Some functions require name to name a  currently
  loaded module, some allow name to be NULL indicating the kernel

   VALUES OF WHICH    [Toc]    [Back]
       0      Always returns success.  Used to probe for the system call.

       QM_MODULES    [Toc]    [Back]
	      Returns the names of all loaded modules.	The output buffer format
  is adjacent null-terminated strings; ret is set to the number
 of modules.

       QM_DEPS    [Toc]    [Back]
	      Returns the names of all modules used by the  indicated  module.
	      The  output  buffer  format is adjacent null-terminated strings;
	      ret is set to the number of modules.

       QM_REFS    [Toc]    [Back]
	      Returns the names of all modules	using  the  indicated  module.
	      This  is	the  inverse  of QM_DEPS.  The output buffer format is
	      adjacent null-terminated strings; ret is set to  the  number  of

       QM_SYMBOLS    [Toc]    [Back]
	      Returns  the  symbols  and  values exported by the kernel or the
	      indicated module.  The buffer format is an array of:

	      struct module_symbol
		unsigned long value;
		unsigned long name;

	      followed by null-terminated strings.  The value of name  is  the
	      character offset of the string relative to the start of buf; ret
	      is set to the number of symbols.

       QM_INFO    [Toc]    [Back]
	      Returns miscellaneous information about  the  indicated  module.
	      The output buffer format is:

	      struct module_info
		unsigned long address;
		unsigned long size;
		unsigned long flags;

	      where address is the kernel address at which the module resides,
	      size is the size of the module in bytes, and flags is a mask  of
	      MOD_RUNNING,  MOD_AUTOCLEAN,  et	al  that indicates the current
	      status of the module.  ret is set to the size of the module_info

RETURN VALUE    [Toc]    [Back]

       On  success,  zero  is returned.  On error, -1 is returned and errno is
       set appropriately.

ERRORS    [Toc]    [Back]

       ENOENT No module by that name exists.

       EINVAL Invalid which, or name indicates the kernel for an inappropriate
	      sub function.

       ENOSPC The buffer size provided was too small.  ret is set to the minimum
 size needed.

       EFAULT At least one of name, buf, or  ret  was  outside	the  program's
	      accessible address space.

SEE ALSO    [Toc]    [Back]

       create_module(2), init_module(2), delete_module(2).

Linux 2.1.17			  26 Dec 1996		       QUERY_MODULE(2)
[ Back ]
 Similar pages
Name OS Title
CPAN IRIX query, download and build perl modules from CPAN sites
modload HP-UX load kernel modules on demand
mload IRIX dynamically loadable kernel modules
ml IRIX load dynamic kernel modules
lkm OpenBSD Loadable Kernel Modules interface
kcmodule HP-UX manage kernel modules and subsystems
modules.conf Linux configuration file for loading kernel modules
modstat OpenBSD display status of loaded kernel modules
cfg_subsys_attr_t Tru64 General: Contains attribute information for kernel modules
modules Linux kernel modules to load at boot time
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service