Re: Semaphore

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

 



Can you be a little more specfic? Is it kernel code or a module?

On Thursday 02 January 2003 1:42 pm, S P wrote:
> 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

-- 
Tom Bradley
Software Engineer
Jaycor / Titan Systems

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[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