Changeset 9
- Timestamp:
- Jan 1, 2006, 11:55:35 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/kern_head.h
r1 r9 480 480 }; 481 481 482 #if 0 483 /* i386 sys_call_table for freebsd 482 /* i386 sys_call_table for openbsd 484 483 */ 485 char * callz_fbsd[]={ 486 "_sysent", /* 0 */ 487 "sys_exit", 488 "_fork", 489 "_read", 490 "_write", 491 "_open", /* 5 */ 492 "_close", 493 "_link", 494 "_unlink", 495 "_chdir", 496 "_fchdir", /* 10 */ 497 "_mknod", 498 "_chmod", 499 "_chown", 500 "_getpid", 501 "_mount", /* 15 */ 502 "_unmount", 503 "_setuid", 504 "_getuid", 505 "_geteuid", 506 "_ioctl", /* 20 */ 507 "_fcntl", 508 "_setsockopt", 509 "_getsockopt", 510 "_getdirentries", 511 "_getdents", /* 25 */ 512 "_seteuid", 513 "_setegid", 514 "_modstat", 515 "_fstat", 516 "_modfind", /* 30 */ 517 "_getsid", 518 "_setsid", 519 "_kldload", 520 "_kldunload", 521 "_kldfind", /* 35 */ 522 "_kldnext", 523 "_kldstat", 524 "_kldfirstmod", 525 "_kldsym", 526 "___sysctl", /* 40 */ 484 char * callz_obsd[]={ 485 "_nosys", /* 0 */ 486 "_sys_exit", 487 "_sys_fork", 488 "_sys_read", 489 "_sys_write", 490 "_sys_open", /* 5 */ 491 "_sys_close", 492 "_sys_wait4", 493 "_compat_43_sys_creat", 494 "_sys_link", 495 "_sys_unlink", /* 10 */ 496 "_sys_nosys", 497 "_sys_chdir", 498 "_sys_fchdir", 499 "_sys_mknod", 500 "_sys_chmod", /* 15 */ 501 "_sys_chown", 502 "_sys_break", 503 "_nosys", 504 "_compat_43_sys_lseek", 505 "_sys_getpid", /* 20 */ 506 "_sys_mount", 507 "_sys_unmount", 508 "_sys_setuid", 509 "_sys_getuid", 510 "_sys_geteuid", /* 25 */ 511 "_sys_ptrace", 512 "_sys_recvmsg", /* 27 */ 513 "_sys_sendmsg", /* 28 */ 514 "_sys_recvfrom", /* 29 */ 515 "_sys_accept", /* 30 */ 516 "_sys_getpeername", /* 31 */ 517 "_sys_getsockname", /* 32 */ 518 "_sys_access", /* 33 */ 519 "_sys_chflags", /* 34 */ 520 "_sys_fchflags", /* 35 */ 521 "_sys_sync", /* 36 */ 522 "_sys_kill", /* 37 */ 523 "_compat_43_sys_stat", /* 38 is old stat */ 524 "_sys_getppid", /* 39 */ 525 "_compat_43_sys_lstat", /* 40 is old lstat */ 526 "_sys_dup", /* 41 */ 527 "_sys_opipe", /* 42 */ 528 "_sys_getegid", /* 43 */ 529 "_sys_profil", /* 44 */ 530 "_sys_ktrace", /* 45 */ 531 "_sys_sigaction",/* 46 */ 532 "_sys_getgid", /* 47 */ 533 "_sys_sigprocmask", 534 "_sys_getlogin", /* 49 */ 535 "_sys_setlogin", /* 50 */ 536 "_sys_acct", /* 51 */ 537 "_sys_sigpending", 538 "_sys_osigaltstack", /* 53 */ 539 "_sys_ioctl", /* 54 */ 540 "_sys_reboot", /* 55 */ 541 "_sys_revoke", /* 56 */ 542 "_sys_symlink", /* 57 */ 543 "_sys_readlink", /* 58 */ 544 "_sys_execve", /* 59 */ 545 "_sys_umask", /* 60 */ 546 "_sys_chroot", /* 61 */ 547 "_compat_43_sys_fstat", /* 62 is old fstat */ 548 "_compat_43_sys_getkerninfo", /* 63 is old ogetkerninfo */ 549 "_compat_43_sys_getpagesize", /* 64 is old ogetpagesize */ 550 "_nosys", /* 65 is omsync */ 551 "_sys_vfork", /* 66 */ 552 "_nosys", /* 67 is obsolete vread */ 553 "_nosys", /* 68 is obsolete vwrite */ 554 "_sys_sbrk", /* 69 */ 555 "_sys_sstk", /* 70 */ 556 "_compat_43_sys_mmap", /* 71 is ommap */ 557 "_sys_ovadvise", /* 72 */ 558 "_sys_munmap", /* 73 */ 559 "_sys_mprotect", /* 74 */ 560 "_sys_madvise", /* 75 */ 561 "_nosys", /* 76 is obsolete vhangup */ 562 "_nosys", /* 77 is obsolete vlimit */ 563 "_sys_mincore", /* 78 */ 564 "_sys_getgroups",/* 79 */ 565 "_sys_setgroups",/* 80 */ 566 "_sys_getpgrp", /* 81 */ 567 "_sys_setpgid", /* 82 */ 568 "_sys_setitimer",/* 83 */ 569 "_compat_43_sys_wait", /* 84 is owait */ 570 "_nosys", /* 85 is swapon */ 571 "_sys_getitimer",/* 86 */ 572 "_compat_43_sys_gethostname", /* 87 is ogethostname */ 573 "_compat_43_sys_sethostname", /* 88 is osethostname */ 574 "_compat_43_sys_getdtablesize", /* 89 os ogetdtablesize */ 575 "_sys_dup2", /* 90 */ 576 "_nosys", /* 91 is ??? */ 577 "_sys_fcntl", /* 92 */ 578 "_sys_select", /* 93 */ 579 "_nosys", /* 94 is ??? */ 580 "_sys_fsync", /* 95 */ 581 "_sys_setpriority", /* 96 */ 582 "_sys_socket", /* 97 */ 583 "_sys_connect", /* 98 */ 584 "_compat_43_sys_accept", /* 99 is oaccept */ 585 "_sys_getpriority", /* 100 */ 586 "_compat_43_sys_send", /* 101 is osend */ 587 "_compat_43_sys_recv", /* 102 is orecv */ 588 "_sys_sigreturn", 589 "_sys_bind", /* 104 */ 590 "_sys_setsockopt", /* 105 */ 591 "_sys_listen", /* 106 */ 592 "_nosys", /* 107 is obsolete vtimes */ 593 "_compat_43_sys_sigvec", /* 108 is osigvec */ 594 "_compat_43_sys_sigblock", /* 109 is osigblock */ 595 "_compat_43_sys_sigsetmask", /* 110 is osigsetmask */ 596 "_sys_sigsuspend", 597 "_compat_43_sys_sigstack", /* 112 is osigstack */ 598 "_compat_43_sys_recvmsg", /* 113 is orecvmsg */ 599 "_compat_43_sys_sendmsg", /* 114 is osendmsg */ 600 "_nosys", /* 115 is obsolete vtrace */ 601 "_sys_gettimeofday", /* 116 */ 602 "_sys_getrusage", /* 117 */ 603 "_sys_getsockopt", /* 118 */ 604 "_nosys", /* 119 is obsolete resuba */ 605 "_sys_readv", /* 120 */ 606 "_sys_writev", /* 121 */ 607 "_sys_settimeofday", /* 122 */ 608 "_sys_fchown", /* 123 */ 609 "_sys_fchmod", /* 124 */ 610 "_compat_43_sys_recvfrom", /* 125 is orecvfrom */ 611 "_sys_setreuid", /* 126 */ 612 "_sys_setregid", /* 127 */ 613 "_sys_rename", /* 128 */ 614 "_compat_43_sys_truncate", /* 129 is old truncate */ 615 "_compat_43_sys_ftruncate", /* 130 is old ftruncate */ 616 "_sys_flock", /* 131 */ 617 "_sys_mkfifo", /* 132 */ 618 "_sys_sendto", /* 133 */ 619 "_sys_shutdown", /* 134 */ 620 "_sys_socketpair", /* 135 */ 621 "_sys_mkdir", /* 136 */ 622 "_sys_rmdir", /* 137 */ 623 "_sys_utimes", /* 138 */ 624 "_nosys", /* 139 is obsolete 4.2 sigreturn */ 625 "_sys_adjtime", /* 140 */ 626 "_compat_43_sys_getpeername", /* 141 is ogetpeername */ 627 "_compat_43_sys_gethostid", /* 142 is ogethostid */ 628 "_compat_43_sys_sethostid", /* 143 is osethostid */ 629 "_compat_43_sys_getrlimit", /* 144 is ogetrlimit */ 630 "_compat_43_sys_setrlimit", /* 145 is osetrlimit */ 631 "_compat_43_sys_killpg", /* 146 is okillpg */ 632 "_sys_setsid", /* 147 */ 633 "_sys_quotactl", /* 148 */ 634 "_compat_43_sys_quota", /* 149 is oquota */ 635 "_compat_43_sys_getsockname", /* 150 is ogetsockname */ 636 "_nosys", /* 151 is ??? */ 637 "_nosys", /* 152 is ??? */ 638 "_nosys", /* 153 is ??? */ 639 "_nosys", /* 154 is ??? */ 640 "_sys_nfssvc", /* 155 */ 641 "_compat_43_sys_getdirentries", /* 156 is ogetdirentries */ 642 "_nosys", /* 157 is ostatfs */ 643 "_nosys", /* 158 is ofstatfs */ 644 "_nosys", /* 159 is ??? */ 645 "_nosys", /* 160 is ??? */ 646 "_sys_getfh", /* 161 */ 647 "_nosys", /* 162 is ogetdomainname */ 648 "_nosys", /* 163 is osetdomainname */ 649 "_nosys", /* 164 is ouname */ 650 "_sys_sysarch", /* 165 */ 651 "_nosys", 652 "_nosys", /* 167 is ??? */ 653 "_nosys", /* 168 is ??? */ 654 "_nosys", /* 169 is compat_10 osemsys */ 655 "_nosys", /* 170 is compat_10 omsgsys */ 656 "_nosys", /* 171 is compat_10 oshmsys */ 657 "_nosys", /* 172 is ??? */ 658 "_sys_pread", /* 173 */ 659 "_sys_pwrite", /* 174 */ 660 "_nosys", /* 175 is ??? */ 661 "_nosys", /* 176 is ??? */ 662 "_nosys", /* 177 is ??? */ 663 "_nosys", /* 178 is ??? */ 664 "_nosys", /* 179 is ??? */ 665 "_nosys", /* 180 is ??? */ 666 "_sys_setgid", /* 181 */ 667 "_sys_setegid", /* 182 */ 668 "_sys_seteuid", /* 183 */ 669 "_sys_bmapv", /* 184 */ 670 "_sys_markv", /* 185 */ 671 "_sys_segclean", /* 186 */ 672 "_sys_segwait", /* 187 */ 673 "_compat_35_sys_stat", /* 188 is compat_35 stat35 */ 674 "_compat_35_sys_fstat", /* 189 is compat_35 fstat35 */ 675 "_compat_35_sys_lstat", /* 190 is compat_35 lstat35 */ 676 "_sys_pathconf", /* 191 */ 677 "_sys_fpathconf", /* 192 */ 678 "_sys_swapctl", /* 193 */ 679 "_sys_getrlimit", /* 194 */ 680 "_sys_setrlimit", /* 195 */ 681 "_sys_getdirentries", /* 196 */ 682 "_sys_mmap", /* 197 */ 683 "_sys___syscall", /* 198 */ 684 "_sys_lseek", /* 199 */ 685 "_sys_truncate", /* 200 */ 686 "_sys_ftruncate", /* 201 */ 687 "_sys___sysctl", /* 202 */ 688 "_sys_mlock", /* 203 */ 689 "_sys_munlock", /* 204 */ 690 "_sys_undelete", /* 205 */ 691 "_sys_futimes", /* 206 */ 692 "_sys_getpgid", /* 207 */ 693 "_sys_xfspioctl", /* 208 */ 694 "_nosys", /* 209 is ??? */ 695 "_nosys", /* 210 is ??? */ 696 "_nosys", /* 211 is ??? */ 697 "_nosys", /* 212 is ??? */ 698 "_nosys", /* 213 is ??? */ 699 "_nosys", /* 214 is ??? */ 700 "_nosys", /* 215 is ??? */ 701 "_nosys", /* 216 is ??? */ 702 "_nosys", /* 217 is ??? */ 703 "_nosys", /* 218 is ??? */ 704 "_nosys", /* 219 is ??? */ 705 "_nosys", /* 220 is ??? */ 706 "_sys_semget", /* 221 */ 707 "_compat_35_sys_semop", /* 222 is compat_35 semop */ 708 "_nosys", /* 223 is obsolete sys_semconfig */ 709 "_nosys", /* 224 is compat_23 msgctl23 */ 710 "_sys_msgget", /* 225 */ 711 "_sys_msgsnd", /* 226 */ 712 "_sys_msgrcv", /* 227 */ 713 "_sys_shmat", /* 228 */ 714 "_nosys", /* 229 is compat_23 shmctl23 */ 715 "_sys_shmdt", /* 230 */ 716 "_compat_35_sys_shmget", /* 231 is compat_35 shmget */ 717 "_sys_clock_gettime", /* 232 */ 718 "_sys_clock_settime", /* 233 */ 719 "_sys_clock_getres", /* 234 */ 720 "_nosys", /* 235 is ??? */ 721 "_nosys", /* 236 is ??? */ 722 "_nosys", /* 237 is ??? */ 723 "_nosys", /* 238 is ??? */ 724 "_nosys", /* 239 is ??? */ 725 "_sys_nanosleep", /* 240 */ 726 "_nosys", /* 241 is ??? */ 727 "_nosys", /* 242 is ??? */ 728 "_nosys", /* 243 is ??? */ 729 "_nosys", /* 244 is ??? */ 730 "_nosys", /* 245 is ??? */ 731 "_nosys", /* 246 is ??? */ 732 "_nosys", /* 247 is ??? */ 733 "_nosys", /* 248 is ??? */ 734 "_nosys", /* 249 is ??? */ 735 "_sys_minherit", /* 250 */ 736 "_sys_rfork", /* 251 */ 737 "_sys_poll", /* 252 */ 738 "_sys_issetugid", /* 253 */ 739 "_sys_lchown", /* 254 */ 740 "_sys_getsid", /* 255 */ 741 "_sys_msync", /* 256 */ 742 "_compat_35_sys___semctl", /* 257 is compat_35 semctl35 */ 743 "_compat_35_sys_shmctl", /* 258 is is compat_35 shmctl35 */ 744 "_compat_35_sys_msgctl", /* 259 is is compat_35 msgctl35 */ 745 "_sys_getfsstat", /* 260 */ 746 "_sys_statfs", /* 261 */ 747 "_sys_fstatfs", /* 262 */ 748 "_sys_pipe", /* 263 */ 749 "_sys_fhopen", /* 264 */ 750 "_compat_35_sys_fhstat", /* 265 is compat_35 fhstat */ 751 "_sys_fhstatfs", /* 266 */ 752 "_sys_preadv", /* 267 */ 753 "_sys_pwritev", /* 268 */ 754 "_sys_kqueue", /* 269 */ 755 "_sys_kevent", /* 270 */ 756 "_sys_mlockall", /* 271 */ 757 "_sys_munlockall", /* 272 */ 758 "_sys_getpeereid", /* 273 */ 759 "_nosys", /* 274 */ 760 "_nosys", /* 275 */ 761 "_nosys", /* 276 */ 762 "_nosys", /* 277 */ 763 "_nosys", /* 278 */ 764 "_nosys", /* 279 */ 765 "_nosys", /* 280 */ 766 "_sys_getresuid", /* 281 */ 767 "_sys_setresuid", /* 282 */ 768 "_sys_getresgid", /* 283 */ 769 "_sys_setresgid", /* 284 */ 770 "_nosys", /* 285 is ??? */ 771 "_sys_mquery", /* 286 */ 772 "_sys_closefrom", /* 287 */ 773 "_sys_sigaltstack", /* 288 */ 774 "_sys_shmget", /* 289 */ 775 "_sys_semop", /* 290 */ 776 "_sys_stat", /* 291 */ 777 "_sys_fstat", /* 292 */ 778 "_sys_lstat", /* 293 */ 779 "_sys_fhstat", /* 294 */ 780 "_sys___semctl", /* 295 */ 781 "_sys_shmctl", /* 296 */ 782 "_sys_msgctl", /* 297 */ 527 783 NULL 528 784 }; 529 #endif 785 530 786 531 787 -
trunk/src/kern_head.c
r1 r9 713 713 } 714 714 715 #ifdef __OpenBSD__ 716 if (utbuf.release[0] == '3') 717 which = 38; 718 #else 715 719 if (utbuf.release[0] == '4') 716 720 which = 4; 717 721 else if (utbuf.release[0] == '5') 718 722 which = 5; 723 else if (utbuf.release[0] == '6') 724 which = 5; 725 #endif 719 726 else 720 727 { … … 757 764 exit(EXIT_FAILURE); 758 765 } 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 } 759 776 760 777 if (which == 4) 761 778 printf("\n/* Kernel %s, machine %s -- use table %s */\n\n", 762 779 utbuf.release, utbuf.machine, "callz_fbsd"); 763 if (which == 5)780 else if (which == 5 || which == 6) 764 781 printf("\n/* Kernel %s, machine %s -- use table %s */\n\n", 765 782 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 766 787 767 788 i = 0; … … 776 797 (utbuf.release[3] == '0')) 777 798 { 778 sys_list[336].n_name = callz_fbsd[ 290]; /* sendfile -> nosys */799 sys_list[336].n_name = callz_fbsd[151]; /* sendfile -> nosys */ 779 800 } 780 } else {801 } else if (which == 5 || which == 6) { 781 802 while ((callz_fbsd5[i] != NULL) && (i < SYS_MAXSYSCALL)) 782 803 { … … 786 807 } 787 808 } 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 788 818 count = i; 789 819 sys_list[i].n_name = NULL; … … 799 829 fprintf(stderr, "check_sysent: kvm_nlist: %d out of %d invalid.\n", 800 830 i, count); 801 fprintf(stderr, " Probably callz_fbsd in kern_head.c\n");831 fprintf(stderr, " Probably the table in kern_head.h\n"); 802 832 fprintf(stderr, " is not for your kernel version.\n"); 803 833 fprintf(stderr, " (No reason to worry, kcheck will "\ … … 832 862 sys_list[i].n_value != 0 && 833 863 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) 835 865 { 836 866 fprintf(stderr,
Note:
See TracChangeset
for help on using the changeset viewer.