delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/03/13/22:10:20

X-Spam-Check-By: sourceware.org
Message-ID: <441633FA.6010007@cygwin.com>
Date: Mon, 13 Mar 2006 22:09:46 -0500
From: "Larry Hall (Cygwin)" <reply-to-list-only-lh AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20051223 Fedora/1.5-0.2.fc4.remi Thunderbird/1.5 Mnenhy/0.7.3.0
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: 1.5.19-4 Problem with compiled source
References: <44162221 DOT 2000508 AT verizon DOT net>
In-Reply-To: <44162221.2000508@verizon.net>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Rich Mayo wrote:
>  I am attempting to compile and run a very simple shared memory server 
> and client.  Although my source compiles with no problem, when I attempt 
> to execute, the following is my only output:
> 
> Bad system call
> 
> I have conducted some experiments and the problem occurs with the very 
> first line in my code.  The following is the server code up to line that 
> causes the error:
> 
> /* shm_server.c:  Server program to demonstrate shared memory. */
> 
> #include "shm_server.h"
> 
> int main(void)
> {
>    char *      shm      = NULL;     // Shared Memory Pointer
>    char *      s        = NULL;     // Dynamic Pointer
> 
>    key_t       key      = 5678;     // shared memory segment name is '5678'
>    char        c;                   // Temporary char
>    int         shmid;               // Shared Memory Segment ID
> 
>    /* Create the segment. */
>    if ((shmid = shmget (key, SHMSZ, IPC_CREAT | 0666)) < 0)
>    {
>        fprintf (stderr, "shmget failed\n");
>        exit (1);
>    }
> 
> ...
> 
> There appears to be something wrong with "shmget".  Any suggestions??
> 
> 


Absolutely!  Check out the section in the User's Guide regarding
cygserver <http://cygwin.com/cygwin-ug-net/using-cygserver.html>.


-- 
Larry Hall                              http://www.rfk.com
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
838 Washington Street                   (508) 893-9889 - FAX
Holliston, MA 01746

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019