Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <380-22004643161211453@hedden.us> Reply-To: jdhedden AT 1979 DOT usna DOT com From: "Jerry D. Hedden" To: cygwin AT cygwin DOT com Subject: shmget() not working(?) Date: Thu, 3 Jun 2004 12:12:11 -0400 MIME-Version: 1.0 Content-type: text/plain; charset=iso-8859-1 X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id i53GAPSf025863 I have cygserver running in the background (default options) on a W2K box. CYGWIN is set to 'server'. The following test program: #include #include int main(int argc, char **argv) { int pid = fork(); int id; if (pid == 0) { sleep(5); id = shmget(1, 100, 0666); printf("child (%d): %d (%d)\n", getpid(), id, errno); } else { id = shmget(1, 100, 01666); printf("parent (%d): %d (%d)\n", getpid(), id, errno); sleep(10); shmctl(id, IPC_RMID, 0); } return (0); } Produces the following output: parent (35492): 196609 (0) child (3876): 0 (0) No errors are reported in the cygserver log. This shows that: 1. The parent created the shared memory segment and got back its ID (196609). 2. The child process tried to attach to the parent's shared memory segment (using the same key = 1), but shmget() returned 0 with no error! Can anyone enlighten me as to what might be wrong? -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/