home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.linux
- Path: sparky!uunet!math.fu-berlin.de!uni-paderborn.de!urmel.informatik.rwth-aachen.de!solaris.rz.tu-clausthal.de!news!ifwsn4!riepe
- From: riepe@ifwsn4.ifw.uni-hannover.de (Michael Riepe)
- Subject: PATCH: fstat dead under 0.99.1
- Message-ID: <1992Dec27.021911.20418@newsserver.rrzn.uni-hannover.de>
- Sender: news@newsserver.rrzn.uni-hannover.de (News Service)
- Reply-To: riepe@ifwsn4.ifw.uni-hannover.de
- Organization: University of Hannover (Germany), IFW
- References: <1992Dec22.165926.10582@mintaka.lcs.mit.edu>
- Date: Sun, 27 Dec 1992 02:19:11 GMT
- Lines: 89
-
- In article 10582@mintaka.lcs.mit.edu, wyvern@gnu.ai.mit.edu (The Wyvern) writes:
- |>The fstat/fuser programs from the ps package seem to be broken under
- |>0.99.1 - an fstat gives this:
- |>USER COMMAND PID FD DEV INUM SZ|DV MODE NAME
- |>
- |>and that's it. All the other programs in the package seem to work
- |>without any problems. At first I thought that ps and family
- |>might just need to be recompiled, as is the case so often, but
- |>recompilation didn't seem to produce any results.
- |>Anyone else having this problem?
-
- I had the same problem (BTW everything else from the ps package worked
- OK for me after recompiling). The problem is that Linus moved the inode
- table in 0.99.1 to fix the initialization problem (?) with 0.99 - but
- that's easy to fix - if you are a "hexdump wizard" (tm) :-(. I will
- include a patch (it's a quick-and-dirty Christmas hack ;-)) that should
- do it (NO WARRANTY). I think you will need the 0.98 sources with 0.98.4
- patches applied for that.
-
- ---------- chainsaw here -----------
- diff -cr ps.old/fstat.c ps/fstat.c
- *** ps.old/fstat.c Fri Dec 25 17:04:01 1992
- --- ps/fstat.c Sat Dec 26 01:58:29 1992
- ***************
- *** 119,125 ****
- --- 119,129 ----
- }
-
- mmap_mem();
- + #if 0
- ino_table = KPTR(k_addr("_inode_table"));
- + #else /* this change was necessary for 0.99.1 */
- + ino_table = *(struct inode **)KPTR(k_addr("_inode_table"));
- + #endif
- fil_table = KPTR(k_addr("_file_table"));
- p = KPTR(k_addr("_task"));
- for (n = NR_TASKS; n > 0; --n, ++p) {
- ***************
- *** 186,200 ****
- {
- char *s;
- char mode[16];
- ! struct inode *inop;
- int i;
- static int pid = -1;
-
- ! if (!inop)
- return;
-
- inop = KPTR(ino);
- if (inop < ino_table || inop >= ino_table + NR_INODE) {
- if (verbose)
- printf("bad inode pointer\n");
- return;
- --- 190,212 ----
- {
- char *s;
- char mode[16];
- ! struct inode *inop, buf;
- int i;
- static int pid = -1;
-
- ! if (!ino) /* using inop here was simply wrong, I think... */
- return;
-
- + #if 0
- inop = KPTR(ino);
- +
- if (inop < ino_table || inop >= ino_table + NR_INODE) {
- + #else /* this change was necessary for 0.99.1 */
- + kmemread(&buf, ino, sizeof buf);
- + inop = &buf;
- +
- + if (ino < ino_table || ino >= ino_table + NR_INODE) {
- + #endif
- if (verbose)
- printf("bad inode pointer\n");
- return;
- ---------- chainsaw here -----------
-
- Hope this helps you,
- Michael.
- --
- Michael Riepe <riepe@ifwsn4.ifw.uni-hannover.de>
- Universit"at Hannover
- Institut f"ur Fertigungstechnik und Spanende Werkzeugmaschinen
- Schlosswender Str. 5 W-3000 Hannover 1 (Germany)
- ...life is a sexually transmitted desease !
-
-