Changeset 9 for trunk/src/kern_head.c


Ignore:
Timestamp:
Jan 1, 2006, 11:55:35 PM (19 years ago)
Author:
rainer
Message:

Compile kernel check module in OpenBSD

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kern_head.c

    r1 r9  
    713713    }
    714714
     715#ifdef __OpenBSD__
     716  if      (utbuf.release[0] == '3')
     717    which = 38;
     718#else
    715719  if      (utbuf.release[0] == '4')
    716720    which = 4;
    717721  else if (utbuf.release[0] == '5')
    718722    which = 5;
     723  else if (utbuf.release[0] == '6')
     724    which = 5;
     725#endif
    719726  else
    720727    {
     
    757764      exit(EXIT_FAILURE);
    758765    }
     766  else if (i == 1)
     767    {
     768      fprintf(stderr, "check_sysent: kvm_nlist: _sysent not found\n");
     769      exit(EXIT_FAILURE);
     770    }
     771  else if (list[0].n_value == 0)
     772    {
     773      fprintf(stderr, "check_sysent: kvm_nlist: zero address for _sysent\n");
     774      exit(EXIT_FAILURE);
     775    }
    759776
    760777  if (which == 4)
    761778    printf("\n/* Kernel %s, machine %s -- use table %s */\n\n",
    762779                 utbuf.release, utbuf.machine, "callz_fbsd");
    763   if (which == 5)
     780  else if (which == 5 || which == 6)
    764781    printf("\n/* Kernel %s, machine %s -- use table %s */\n\n",
    765782                 utbuf.release, utbuf.machine, "callz_fbsd5");
     783  else if (which == 38)
     784    printf("\n/* Kernel %s, machine %s -- use table %s */\n\n",
     785                 utbuf.release, utbuf.machine, "callz_obsd");
     786     
    766787     
    767788  i = 0;
     
    776797        (utbuf.release[3] == '0'))
    777798      {
    778         sys_list[336].n_name = callz_fbsd[290]; /* sendfile -> nosys */
     799        sys_list[336].n_name = callz_fbsd[151]; /* sendfile -> nosys */
    779800      }
    780   } else {
     801  } else if (which == 5 || which == 6) {
    781802    while ((callz_fbsd5[i] != NULL) && (i < SYS_MAXSYSCALL))
    782803      {
     
    786807      }
    787808  }
     809  else if (which == 38) {
     810    while ((callz_obsd[i] != NULL) && (i < SYS_MAXSYSCALL))
     811      {
     812        sys_list[i].n_name = callz_obsd[i];
     813        /* fprintf(stderr, "sys_list[%d] = %s\n", i, sys_list[i].n_name); */
     814        ++i;
     815      }
     816  }
     817 
    788818  count = i;
    789819  sys_list[i].n_name = NULL;
     
    799829        fprintf(stderr, "check_sysent: kvm_nlist: %d out of %d invalid.\n",
    800830                i, count);
    801         fprintf(stderr, "              Probably callz_fbsd in kern_head.c\n");
     831        fprintf(stderr, "              Probably the table in kern_head.h\n");
    802832        fprintf(stderr, "              is not for your kernel version.\n");
    803833        fprintf(stderr, "              (No reason to worry, kcheck will "\
     
    832862         sys_list[i].n_value != 0 &&
    833863         0 != strcmp(sys_list[i].n_name, "_nosys") &&
    834          (unsigned long)sy.sy_call != sys_list[290].n_value) 
     864         (unsigned long)sy.sy_call != sys_list[151].n_value) 
    835865        {
    836866          fprintf(stderr,
Note: See TracChangeset for help on using the changeset viewer.