This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 1.5.19-4 Problem with compiled source


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]