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 From: "Steve Baldwin" To: Subject: IPC problems Date: Tue, 25 Feb 2003 21:14:56 +1100 Message-ID: <000001c2dcb6$bfd76c40$3264a8c0@AUSTBMOBILE> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 I'm trying to port some Unix software that extensively uses shared memory, semaphores, and threads. Not sure if I'm pushing sh*t uphill, but I got cygipc-1.13-2 installed, and the IPC daemon running. I have a simple case that hopefully shows my error ... #include #include #include #include #include int main (int argc, char **argv) { int shm_id ; struct shmid_ds shm_buf ; int ret ; shm_id = shmget(1234, 1048576, IPC_CREAT | IPC_EXCL | 0660) ; printf ("shm_id = %d\n", shm_id) ; ret = shmctl (shm_id, IPC_STAT, &shm_buf) ; printf ("ret = %d (%s)\n", ret, (ret == -1 ? strerror(errno) : "")) ; } [src]$ gcc aa.c -o aa -L/usr/local/lib -lcygipc [src]$ ./aa shm_id = 1280 ret = -1 (Invalid argument) [src]$ ipcs -a ---------- Shared Memory Segments -------- shmid key bytes nattch status _shm 1280 1234 1048576 0 ---------- Semaphore Arrays -------- semid nsems key ---------- Message Queues -------- msqid used-bytes messages What am I missing here ? The code works fine on Linux, HP-UX, Solaris, ... Thanks, Steve -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/