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:12:15 +0100 Lines: 45 Message-ID: <87mwd9p300.fsf@sable.mobileactivedefense.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: individual.net 635WpAyZT18WVLZyWvk93gQ3WsmPOg7iun6EYebq4zL/FZSDE= Cancel-Lock: sha1:5LDyuwWygYr+qMr89EYT1eL6Uxc= sha1:lyallPvDizJGtc7VXK26Oa3280U= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Xref: csiph.com comp.os.linux.development.apps:738 chaudhary.nabin@gmail.com writes: > 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, > > please mail me at chaudhary.nabin@gmail.com Assuming you on a system with documentation installed (which should certainly be this way if it is supposed to be used for development), the following command will often be helpful: [rw@sable]~#apropos semaphore IPC::Semaphore (3perl) - SysV Semaphore IPC object class ipcrm (1) - remove a message queue, semaphore set or shared memory id lockfile (1) - conditional semaphore-file creator perlipc (1) - Perl interprocess communication (signals, fifos, pipes, safe subprocesses, sockets, and semaphores) SDL_CreateSemaphore (3) - Creates a new semaphore and assigns an initial value to it. SDL_DestroySemaphore (3) - Destroys a semaphore that was created by SDL_CreateSemaphore. SDL_SemPost (3) - Unlock a semaphore. SDL_SemTryWait (3) - Attempt to lock a semaphore but don't suspend the thread. SDL_SemValue (3) - Return the current value of a semaphore. SDL_SemWait (3) - Lock a semaphore and suspend the thread if the semaphore value is zero. SDL_SemWaitTimeout (3) - Lock a semaphore, but only wait up to a specified maximum time. sem_close (3) - close a named semaphore sem_destroy (3) - destroy an unnamed semaphore sem_getvalue (3) - get the value of a semaphore sem_init (3) - initialize an unnamed semaphore sem_open (3) - initialize and open a named semaphore sem_overview (7) - Overview of POSIX semaphores sem_post (3) - unlock a semaphore sem_timedwait (3) - lock a semaphore sem_trywait (3) - lock a semaphore sem_unlink (3) - remove a named semaphore sem_wait (3) - lock a semaphore semctl (2) - semaphore control operations semget (2) - get a semaphore set identifier semop (2) - semaphore operations semtimedop (2) - semaphore operations Thread::Semaphore (3perl) - Thread-safe semaphores