Re: Semaphore

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

 



Hello,
   I have used semaphore for locking in my kernel module. It is working fine. I am able to compile and install the module.
   I have just used asm/semaphore.h in my include files.
Rupa
----- Original Message -----
From: S P
Sent: Friday, January 03, 2003 2:12 AM
Subject: Semaphore

Hi,

I am trying to use semaphore for locking. Following is the piece of code I am using :

struct semaphore mr_sem;

sema_init(&mr_sem, 1); /* usage count is 1 */

if (down_interruptible(&mr_sem))
  /* semaphore not acquired; received a signal ... */

/* critical region (semaphore acquired) ... */

up(&mr_sem);

 

The compilation is done using gcc with options _D__KERNEL__. It compiles properly, but the linking gives some errors regards to __down_failed_interruptible and __up_wakeup.

Do I need to specify some other options for the compilation.

Thanks for the help.

-SP



Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux