Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67450 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57676 invoked from network); 19 May 2013 01:30:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 May 2013 01:30:26 -0000 Received: from [127.0.0.1] ([127.0.0.1:29099]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ECSTREAM id 2F/51-45938-13B28915 for ; Sat, 18 May 2013 21:30:25 -0400 Authentication-Results: pb1.pair.com smtp.mail=nedwidek@lighthouseitc.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nedwidek@lighthouseitc.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain lighthouseitc.com designates 209.85.210.170 as permitted sender) X-PHP-List-Original-Sender: nedwidek@lighthouseitc.com X-Host-Fingerprint: 209.85.210.170 mail-ia0-f170.google.com Received: from [209.85.210.170] ([209.85.210.170:53609] helo=mail-ia0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 45/53-31589-C2597915 for ; Sat, 18 May 2013 10:50:20 -0400 Received: by mail-ia0-f170.google.com with SMTP id l29so6140270iag.29 for ; Sat, 18 May 2013 07:50:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type :x-gm-message-state; bh=+Z1GBd1OgLqweySU/U4o9XJzTzqQWOFapNWGeSpfL60=; b=YTsXL6MPrZ3UuZ28N3nzDtiRL25o7dA9sa1h4AxeaBAcI1ozggjULjVNLEDVT5SbdF +bnQ03QiS4jYkmRZCLflS4FI6uK2KZazVdkk1zilJ+N8eRA75CROEjjU5LQoIYg9qqmR 8qjsfrenbNTLxH9hAInqMYRVRd+MCUKL1rdzZZX6Gs+F5/9sFD7xzrMhd4pRfvWcn8SA f/615jdDElgJ2vs4r8TeT7PRhFnuobolcrb8de+dUuC4YFsZM31Cj08angy9teoQMzYZ Y8+Q2cVQRhR3ZkythTLJ6KI77CHgOzzHa/VaKX/MRStkcKB9YKUFoptDVEUbDioGCKYT 4Xdw== MIME-Version: 1.0 X-Received: by 10.50.118.37 with SMTP id kj5mr1226477igb.70.1368888617951; Sat, 18 May 2013 07:50:17 -0700 (PDT) Received: by 10.64.106.227 with HTTP; Sat, 18 May 2013 07:50:17 -0700 (PDT) Received: by 10.64.106.227 with HTTP; Sat, 18 May 2013 07:50:17 -0700 (PDT) Date: Sat, 18 May 2013 10:50:17 -0400 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=089e0115ec74cf76be04dcff374b X-Gm-Message-State: ALoCoQmPWTOysOH7xu0C96keob6eRSILa+Ri6aY3wAxEhr7k8plKuzUYmCPoj7Q9N48pBnOwNYHO Subject: [Proposal] Add method to shmop ext to retrieve OS shmid From: nedwidek@lighthouseitc.com (Erik Nedwidek) --089e0115ec74cf76be04dcff374b Content-Type: text/plain; charset=ISO-8859-1 This grew out of a question I answered on StackOverflow.com: http://stackoverflow.com/questions/16501707/working-with-shared-memory-in-php/ The gist is that a user was converting a C program to PHP and wanted the shmid as reported by ipcs. The user assumed that the id returned by shmop_open would be the shmid, and was confused by the shmop resource identifier. (I explained to him what the return actually was) I suggested he use his own unique key to be able to identify the shared memory created for his script, but he said that it had to be 0x0. I've added a function to retrieve shmop->shmid in my own fork of PHP. You can see the changes here and the commit message contains a quick usage/test script: https://github.com/nedwidek/php-src/commit/832e77fce15de926b562b6dcc28d1864bb7c348b So I guess the questions are: Is there a particular reason that the shmid is hidden from PHP scripts? Is there any reason not to move this to a formal RFC? Should similar methods be added to the sysv* extensions where applicable? Assuming this is an acceptable change to consider, anyone have a better function name than shmop_sys_shmid? Regards, Erik Nedwidek --089e0115ec74cf76be04dcff374b--