Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.arcetri.astro.it/irlab/doc/library/linux/khg/HyperNews/get/khg/158/2.html
Дата изменения: Thu Mar 23 12:37:45 2000
Дата индексирования: Wed Sep 15 04:08:15 2010
Кодировка:

Поисковые слова: ngc 253
code snip to make a sys_* call from a module The HyperNews Linux KHG Discussion Pages

Note: code snip to make a sys_* call from a module

Forum: The Linux Kernel Hackers' Guide
Re: Question Can I make syscall from inside a kernel module? (Shawn Chang)
Keywords: syscall, module, lock physical page
Date: Thu, 08 Jan 1998 22:35:21 GMT
From: Pradeep Gore <pradeepg@corelcomputer.com>

As an example, here is a code snip that make a sys_read call from a kernel module.

// module.c
....
#include <sys/syscall.h>
extern long sys_call_table[]; // arch/i386/kernel/entry.S

int (*sys_read)(unsigned int fd, char *buf, int count);
// pointer to sys_read. linux/fs/read_write.c

....
int init_module(void)
{
...
 sys_read = sys_call_table[SYS_read];
 //now you can use sys_read
 sys_read(...);
...
}