Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Rainer Weikusat Newsgroups: comp.os.linux.development.apps Subject: Re: equivalent for msem_init(),msem_lock() msem_unlock() in linux Date: Thu, 19 Jun 2014 12:04:49 +0100 Lines: 29 Message-ID: <87r42lp3ce.fsf@sable.mobileactivedefense.com> References: <64a61332-4754-417d-89ee-758109112806@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: individual.net X8rh9zZOAllDgrrzURqZ0QyCcQul4OoYOZSgYTkBO15RJEr6Q= Cancel-Lock: sha1:FgU2ITioHZ7BNIQrtFDalOp2XnM= sha1:0kRvyXNU/LuzmdevdkGcZxkh3eY= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Xref: csiph.com comp.os.linux.development.apps:737 Tauno Voipio writes: > On 19.6.14 00:01, chaudhary.nabin@gmail.com wrote: >> On Wednesday, 18 June 2014 13:31:05 UTC-5, Tauno Voipio wrote: >>> On 18.6.14 21:14, chaudhary.nabin@gmail.com wrote: >>> >>>> Does any equivalent functions can be used >>>>> on Linux while porting C/C++ applications >>>>> from HP-UX for the following APIs > >>>>> msem_init()==>initialize a semaphore in a mapped file >>>>> msem_lock()==> lock a semaphore >>>>> msem_unlock==> unlock a semaphore, > >>>>> I want to port a program that looks somewhat like this >>>>> to Linux, > >> >> i wrote my own routine to implemet these routine through mutex. if you have any idea other that this please let me know >> > > You did not answer to me. > > There are both System V and Posix semaphores in Linux. > Did you read the documentation? Judging from the text above, SysV semaphore sets are probably not a good choice (some people would argue they aren't a good choice for anything) but process-shared POSIX semaphores should be usable. sem_overview(7) provides an introduction and pointers ('man 7 sem_overview').