Q: Linux system capacities on data structures.

From: www.hyebun.com (bkna_at_besta.cc)
Date: 07/30/03

  • Next message: Markus Rollmann: "Re: Q: Linux system capacities on data structures."
    Date: Wed, 30 Jul 2003 18:46:03 +0900
    
    

    Hi all,
    with data structures, I have a problem on programming as below.
    If I change MAXMSVR to 32, it works well but with bigger value than 32
    system has segmentation faults.
    I think Linux system has bigger capacities but I do not understand why I
    have this problem.

    Please help,
    bkna.

    #include <stdio.h>

    #define MAXMSVR 33
    #define MAXCLIENT 1000
    #define STR_LEN 128

    typedef struct {
      char name[STR_LEN];
      char ipaddr[STR_LEN];
    }host_t;

    typedef struct {
      host_t self;
      unsigned int nclient;
      host_t client[MAXCLIENT];
    }msvr_t;

    int main ()
    {
      msvr_t msvr[MAXMSVR];
      int i;

      fprintf (stderr, "OK - 0a\n");
      for (i=0;i<MAXMSVR; i++) msvr[i].nclient = 0;

      fprintf (stderr, "OK - 0\n");

      return 0;
    }


  • Next message: Markus Rollmann: "Re: Q: Linux system capacities on data structures."

    Relevant Pages