home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / linux / 21782 < prev    next >
Encoding:
Text File  |  1992-12-26  |  3.3 KB  |  102 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!math.fu-berlin.de!uni-paderborn.de!urmel.informatik.rwth-aachen.de!solaris.rz.tu-clausthal.de!news!ifwsn4!riepe
  3. From: riepe@ifwsn4.ifw.uni-hannover.de (Michael Riepe)
  4. Subject: PATCH: fstat dead under 0.99.1
  5. Message-ID: <1992Dec27.021911.20418@newsserver.rrzn.uni-hannover.de>
  6. Sender: news@newsserver.rrzn.uni-hannover.de (News Service)
  7. Reply-To: riepe@ifwsn4.ifw.uni-hannover.de
  8. Organization: University of Hannover (Germany), IFW
  9. References: <1992Dec22.165926.10582@mintaka.lcs.mit.edu>
  10. Date: Sun, 27 Dec 1992 02:19:11 GMT
  11. Lines: 89
  12.  
  13. In article 10582@mintaka.lcs.mit.edu, wyvern@gnu.ai.mit.edu (The Wyvern) writes:
  14. |>The fstat/fuser programs from the ps package seem to be broken under
  15. |>0.99.1 - an fstat gives this:
  16. |>USER     COMMAND    PID    FD  DEV   INUM   SZ|DV MODE       NAME
  17. |>
  18. |>and that's it. All the other programs in the package seem to work
  19. |>without any problems. At first I thought that ps and family
  20. |>might just need to be recompiled, as is the case so often, but
  21. |>recompilation didn't seem to produce any results.
  22. |>Anyone else having this problem?
  23.  
  24. I had the same problem (BTW everything else from the ps package worked
  25. OK for me after recompiling). The problem is that Linus moved the inode
  26. table in 0.99.1 to fix the initialization problem (?) with 0.99 - but
  27. that's easy to fix - if you are a "hexdump wizard" (tm) :-(. I will
  28. include a patch (it's a quick-and-dirty Christmas hack ;-)) that should
  29. do it (NO WARRANTY). I think you will need the 0.98 sources with 0.98.4
  30. patches applied for that.
  31.  
  32. ---------- chainsaw here -----------
  33. diff -cr ps.old/fstat.c ps/fstat.c
  34. *** ps.old/fstat.c    Fri Dec 25 17:04:01 1992
  35. --- ps/fstat.c    Sat Dec 26 01:58:29 1992
  36. ***************
  37. *** 119,125 ****
  38. --- 119,129 ----
  39.       }
  40.   
  41.       mmap_mem();
  42. + #if 0
  43.       ino_table = KPTR(k_addr("_inode_table"));
  44. + #else            /* this change was necessary for 0.99.1 */
  45. +     ino_table = *(struct inode **)KPTR(k_addr("_inode_table"));
  46. + #endif
  47.       fil_table = KPTR(k_addr("_file_table"));
  48.       p = KPTR(k_addr("_task"));
  49.       for (n = NR_TASKS; n > 0; --n, ++p) {
  50. ***************
  51. *** 186,200 ****
  52.   {
  53.       char *s;
  54.       char mode[16];
  55. !     struct inode *inop;
  56.       int i;
  57.       static int pid = -1;
  58.   
  59. !     if (!inop)
  60.       return;
  61.   
  62.       inop = KPTR(ino);
  63.       if (inop < ino_table || inop >= ino_table + NR_INODE) {
  64.       if (verbose)
  65.           printf("bad inode pointer\n");
  66.       return;
  67. --- 190,212 ----
  68.   {
  69.       char *s;
  70.       char mode[16];
  71. !     struct inode *inop, buf;
  72.       int i;
  73.       static int pid = -1;
  74.   
  75. !     if (!ino)        /* using inop here was simply wrong, I think... */
  76.       return;
  77.   
  78. + #if 0
  79.       inop = KPTR(ino);
  80.       if (inop < ino_table || inop >= ino_table + NR_INODE) {
  81. + #else            /* this change was necessary for 0.99.1 */
  82. +     kmemread(&buf, ino, sizeof buf);
  83. +     inop = &buf;
  84. +     if (ino < ino_table || ino >= ino_table + NR_INODE) {
  85. + #endif
  86.       if (verbose)
  87.           printf("bad inode pointer\n");
  88.       return;
  89. ---------- chainsaw here -----------
  90.  
  91. Hope this helps you,
  92. Michael.
  93. -- 
  94.  Michael Riepe               <riepe@ifwsn4.ifw.uni-hannover.de>
  95.  Universit"at Hannover
  96.  Institut f"ur Fertigungstechnik und Spanende Werkzeugmaschinen
  97.  Schlosswender Str. 5               W-3000 Hannover 1 (Germany)
  98.  ...life is a sexually transmitted desease !
  99.  
  100.