php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #25961 sem_get with fixed IDC_CREAT flag
Submitted: 2003-10-23 02:51 UTC Modified: 2004-09-25 01:00 UTC
From: daredevil at rozmova dot if dot ua Assigned:
Status: No Feedback Package: Documentation problem
PHP Version: 4.3.3 OS: FreeBSD, cygwin
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: daredevil at rozmova dot if dot ua
New email:
PHP Version: OS:

 

 [2003-10-23 02:51 UTC] daredevil at rozmova dot if dot ua
Description:
------------
in the sem_get function, according to the source code,
semaphore *always* getting with IPC_CREATE flag. That is unnecessary in situations, when I wanna get an existing semaphore, not to create a new one.

Also in the Documentation You should mention, that a PHP semaphore is really THREE of them! Because when writing an client-server app (php as a client platform ang C/C++ as a server platform), and a semaphore is created in C++ as semget(key, 1(!), IPC_CREATE | 0666) - I need onle one! When trying to reach it in php sem_get(key) php handles an "ivalid argument exception" because php wanna re-create the semaphore set from 1 to 3.  


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-23 22:42 UTC] iliaa@php.net
It seems strange that IPC_CREATE flag is always set, but it's removal will break backwards compatibility. The only way I see that this problem could be resolved is by adding another optional argument to the function, which would disable  IPC_CREATE flag.
 [2004-09-17 10:09 UTC] vrana@php.net
Please tell us what exactly should be added to the documentation.
 [2004-09-25 01:00 UTC] phpdoc at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2012-04-03 12:28 UTC] stephane dot anthoine at gmail dot com
Description:
------------
I confirm the problem of sem_get, with an existing semaphare, created by an other 
application (c code). If the semaphore does not exist, there is no problem to 
receive the sem_id.

$sem_id = sem_get(0x4d2, 1, 0666, 1);
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 13:01:29 2024 UTC