Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!zaphod.mps.ohio-state.edu!usc!snorkelwacker!ira.uka.de!smurf!gopnbg!tmpmbx!einoed!utopia!scuzzy!src From: src@scuzzy.uucp (Heiko Blume) Newsgroups: comp.unix.i386 Subject: a bug in u386mon & what is sys3b(2) ??????? Summary: kernel vars not up to date Keywords: swap syscall bug Message-ID: <1990Jul16.231429.1592@scuzzy.uucp> Date: 16 Jul 90 23:14:29 GMT Distribution: comp Organization: Scuzzy Research Center (SRC) Lines: 39 this is under interactive 2.0.2: i have discovered sort of a bug in the recently posted u386mon program (version 1.2). if you have more than one device 'in' /dev/swap, then you'll get funny numbers in the 'swap free' percentage, i.e. -278%. this is caused by the kernel variable nswap. it is initialized after the root partition is mounted to the *then* available swap space. however if there is more swap space added later (with /etc/swap) nswap will *not* be updated. the funny part is that the swap free variable (don't know it's name now) *does* contain the correct data. so you get 5MB total swap space an 19MB free swap space, which of course yields the funny percentage. now for the weird part. i grep'ed around and found which says: /* The following struct is used by the sys3b system call. ^^^^^^^^^^^^^^^^^ * If the first argument to the sys3b system call is 3, * then the call pertains to the swap file. In this case, * the second argument is a pointer to a structure of the * following format which contains the parameters for the * operation to be performed. */ [........] huh?! what system call ? of course that call isn't in any manuals i have and, needless to say, of course i wrote a little program saying sys3b(3,&swapinfo), which gave me 'unresolved external' on linking. it's also isn't in any library. well, i could lseek in the kernel to find the table where the info for all the swap files is (swaptab[MSFILES]) but i'd prefer a clean way of course. also i can't image /etc/swap to munge around in the kernel to add swap space (it's much too fast for that, and that would be *dirty* as it could be). in this context i'd like to know: how can i find which system calls a given kernel has ??? -- Heiko Blume c/o Diakite blume@scuzzy.mbx.sub.org FAX (+49 30) 882 50 65 Kottbusser Damm 28 blume@netmbx.UUCP VOICE (+49 30) 691 88 93 D-1000 Berlin 61 blume@netmbx.de TELEX 184174 intro d "Have you bugged your source today?"