Would you please have a look to the following code for me? This code has no compile error, but it will get an error message "unresolved symbol sys_semctl". I don't know why.
/* gcc -c -Wall test.c*/
#define __KERNEL__
#define MODULE
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/ipc.h>
#include <linux/sem.h>
#include <linux/slab.h> /*kmalloc(), kfree()*/
#include <linux/stat.h>
#include <asm/types.h>
#include <asm/ipc.h>
#include <asm/uaccess.h>
#include <asm/semaphore.h>
key_t ftok(path, id)
const char *path;
char id;
{
struct stat st;
/* if (stat(path, &st) < 0)
return (key_t)-1;*/
return (key_t) (id << 24 | (st.st_dev & 0xff) << 16 | (st.st_ino & 0xfff
));
}
init_module()
{
int i;
int AgentLock;
union semun options;
key_t MyKey = ftok( ".", "xyz" );
AgentLock = sys_semget( MyKey, 5, IPC_CREAT | IPC_EXCL );
options.val = 1;
for( i = 0; i < 5; i++ )
sys_semctl( AgentLock, i, SETVAL, options );
}
==================================
Poster's IP address: 202.105.138.19
Posted via http://nodevice.com
Linux Programmer's Site
http://www.daimi.au.dk/~kasperd/comp.os.linux.development.faq.html#unresolved
--
Kasper Dupont -- der bruger for meget tid på usenet.
For sending spam use mailto:aaa...@daimi.au.dk
Hvem er fjenden i Aalborg?