1.5.19-4 Problem with compiled source

Rich Mayo ramayo@verizon.net
Tue Mar 14 01:57:00 GMT 2006


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


Rich Mayo
ramayo@verizon.net

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygcheck.out
URL: <http://cygwin.com/pipermail/cygwin/attachments/20060314/022b8823/attachment.ksh>
-------------- next part --------------
--
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/


More information about the Cygwin mailing list