Compare commits
	
		
			339 Commits
		
	
	
		
			top_3_4
			...
			LIBGTOP_0_
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					e0d4139bf2 | ||
| 
						 | 
					17962b4548 | ||
| 
						 | 
					2f12b5aec2 | ||
| 
						 | 
					be97f1b90a | ||
| 
						 | 
					a9928eb8a8 | ||
| 
						 | 
					3dfd759826 | ||
| 
						 | 
					48191c7111 | ||
| 
						 | 
					5a0b925037 | ||
| 
						 | 
					58e1e76a06 | ||
| 
						 | 
					4bc0213ca9 | ||
| 
						 | 
					266d9e013f | ||
| 
						 | 
					3b1626912d | ||
| 
						 | 
					c0eb843fc4 | ||
| 
						 | 
					b89011bce9 | ||
| 
						 | 
					acd110f1cc | ||
| 
						 | 
					b4d0ee6df2 | ||
| 
						 | 
					6d62e9c466 | ||
| 
						 | 
					6ea9c2e2cb | ||
| 
						 | 
					d884adbf7f | ||
| 
						 | 
					f2074892ae | ||
| 
						 | 
					e890aaaf28 | ||
| 
						 | 
					b1f8913794 | ||
| 
						 | 
					3daeda7307 | ||
| 
						 | 
					9e41d36684 | ||
| 
						 | 
					e140f93bf5 | ||
| 
						 | 
					3393adefa7 | ||
| 
						 | 
					5599022989 | ||
| 
						 | 
					1520ee7083 | ||
| 
						 | 
					ee9812e9af | ||
| 
						 | 
					2f20f2b7ff | ||
| 
						 | 
					dd4ec711a9 | ||
| 
						 | 
					c9f66159f0 | ||
| 
						 | 
					34133fe238 | ||
| 
						 | 
					d6e0aa2942 | ||
| 
						 | 
					0bda0d4fc9 | ||
| 
						 | 
					29145f7c11 | ||
| 
						 | 
					3da3f1b03f | ||
| 
						 | 
					cd7ca97fc5 | ||
| 
						 | 
					e3dd231a3d | ||
| 
						 | 
					d396bb6258 | ||
| 
						 | 
					6ccd22ae04 | ||
| 
						 | 
					f720f21e07 | ||
| 
						 | 
					da51ae35c0 | ||
| 
						 | 
					25a6834aae | ||
| 
						 | 
					2795790ab6 | ||
| 
						 | 
					4ca23b4e06 | ||
| 
						 | 
					ceabdfd2dc | ||
| 
						 | 
					20f3c3eb60 | ||
| 
						 | 
					151c5ee80e | ||
| 
						 | 
					213fb37f26 | ||
| 
						 | 
					fd77db5f8d | ||
| 
						 | 
					50e4bdfc93 | ||
| 
						 | 
					b7e5a6da2d | ||
| 
						 | 
					67a344b9d4 | ||
| 
						 | 
					d414a22ee3 | ||
| 
						 | 
					0b315c266b | ||
| 
						 | 
					c90462bc26 | ||
| 
						 | 
					6760a41ad9 | ||
| 
						 | 
					83d51392dc | ||
| 
						 | 
					6b736f1f87 | ||
| 
						 | 
					5fed8969c6 | ||
| 
						 | 
					079ddfae31 | ||
| 
						 | 
					a701fc7aa6 | ||
| 
						 | 
					cd7976f3cd | ||
| 
						 | 
					bdbc251228 | ||
| 
						 | 
					12b9e30f1c | ||
| 
						 | 
					ef36d36060 | ||
| 
						 | 
					11c7fad8d4 | ||
| 
						 | 
					9c0ec8c69f | ||
| 
						 | 
					4ac6972be6 | ||
| 
						 | 
					7a0a779311 | ||
| 
						 | 
					92f1bf261c | ||
| 
						 | 
					6abcbd5458 | ||
| 
						 | 
					a637c8b406 | ||
| 
						 | 
					d59234afc2 | ||
| 
						 | 
					8e67a4cad1 | ||
| 
						 | 
					0afb34b0c1 | ||
| 
						 | 
					f24a4d9d22 | ||
| 
						 | 
					44b03ba60b | ||
| 
						 | 
					d46c6227fb | ||
| 
						 | 
					fffabe63b7 | ||
| 
						 | 
					ecaa9d9a35 | ||
| 
						 | 
					45b63f5131 | ||
| 
						 | 
					ee2d10729c | ||
| 
						 | 
					b3262820c5 | ||
| 
						 | 
					4371bc81c9 | ||
| 
						 | 
					a6f7f0259e | ||
| 
						 | 
					0882a71244 | ||
| 
						 | 
					213647b203 | ||
| 
						 | 
					44ca3f22f3 | ||
| 
						 | 
					82fdca61c2 | ||
| 
						 | 
					0fec2b7fb0 | ||
| 
						 | 
					b70d0570c7 | ||
| 
						 | 
					13d9120f93 | ||
| 
						 | 
					1289b92d06 | ||
| 
						 | 
					bdc4e08454 | ||
| 
						 | 
					65e3bf19ab | ||
| 
						 | 
					bb545f9aaa | ||
| 
						 | 
					30bd1f269c | ||
| 
						 | 
					9114af9fdf | ||
| 
						 | 
					0e57efd4e5 | ||
| 
						 | 
					6b548d62dd | ||
| 
						 | 
					afe57f9ee9 | ||
| 
						 | 
					38b00dfae0 | ||
| 
						 | 
					a5f0bed342 | ||
| 
						 | 
					1b6eb7b27d | ||
| 
						 | 
					8f4611fe34 | ||
| 
						 | 
					27b46e687b | ||
| 
						 | 
					260ecffab8 | ||
| 
						 | 
					92a4453165 | ||
| 
						 | 
					05eb7e1f76 | ||
| 
						 | 
					6407e9cdbf | ||
| 
						 | 
					492c7788d0 | ||
| 
						 | 
					f14684a685 | ||
| 
						 | 
					d74b27fcb9 | ||
| 
						 | 
					46779ed121 | ||
| 
						 | 
					27a961b25d | ||
| 
						 | 
					a1fd1f436a | ||
| 
						 | 
					bb997fff98 | ||
| 
						 | 
					671c02c5f2 | ||
| 
						 | 
					abf854c16a | ||
| 
						 | 
					691ce2b843 | ||
| 
						 | 
					63e37821f3 | ||
| 
						 | 
					77e926d754 | ||
| 
						 | 
					ade863b5e3 | ||
| 
						 | 
					4aaa1f5356 | ||
| 
						 | 
					c965b623f9 | ||
| 
						 | 
					d27d97d07b | ||
| 
						 | 
					3af9d90f4a | ||
| 
						 | 
					70bbae9b75 | ||
| 
						 | 
					669f7a6b17 | ||
| 
						 | 
					754a69a79a | ||
| 
						 | 
					e81082d8ed | ||
| 
						 | 
					f87c35d7b2 | ||
| 
						 | 
					960d4aa3a9 | ||
| 
						 | 
					34ce0648de | ||
| 
						 | 
					127baf677b | ||
| 
						 | 
					616923612c | ||
| 
						 | 
					d1f3444da1 | ||
| 
						 | 
					f3c73befd2 | ||
| 
						 | 
					e894161eb2 | ||
| 
						 | 
					f8fbb9198d | ||
| 
						 | 
					2af3fb1c03 | ||
| 
						 | 
					3b22c01a66 | ||
| 
						 | 
					4b261a3f80 | ||
| 
						 | 
					9b0aa47f17 | ||
| 
						 | 
					3af2e87c77 | ||
| 
						 | 
					8014f2590b | ||
| 
						 | 
					960018d198 | ||
| 
						 | 
					27c03c773b | ||
| 
						 | 
					ac2bd3eda8 | ||
| 
						 | 
					b1bae173de | ||
| 
						 | 
					e35db38422 | ||
| 
						 | 
					95525908bf | ||
| 
						 | 
					cf0e724f7d | ||
| 
						 | 
					0659b93dff | ||
| 
						 | 
					afb07a1f8b | ||
| 
						 | 
					d2448ea6f3 | ||
| 
						 | 
					dfda639756 | ||
| 
						 | 
					be63bf2d42 | ||
| 
						 | 
					06d907146d | ||
| 
						 | 
					bd4cd7b570 | ||
| 
						 | 
					a444c860d2 | ||
| 
						 | 
					0289863af0 | ||
| 
						 | 
					210fc000cd | ||
| 
						 | 
					93568304b0 | ||
| 
						 | 
					23cdbd5336 | ||
| 
						 | 
					17a37aa394 | ||
| 
						 | 
					f082d4cb85 | ||
| 
						 | 
					b5c90ca5a4 | ||
| 
						 | 
					f4cde0843d | ||
| 
						 | 
					fce4841810 | ||
| 
						 | 
					02dfde47ab | ||
| 
						 | 
					a8b0903fe7 | ||
| 
						 | 
					6eed554232 | ||
| 
						 | 
					c591e6ef33 | ||
| 
						 | 
					a72db75b78 | ||
| 
						 | 
					8f3c38219a | ||
| 
						 | 
					0d56ca7d04 | ||
| 
						 | 
					70347bbfe9 | ||
| 
						 | 
					06437c5866 | ||
| 
						 | 
					72c987735e | ||
| 
						 | 
					8e752ed036 | ||
| 
						 | 
					36911a1239 | ||
| 
						 | 
					7cadf4450c | ||
| 
						 | 
					2a2677ea66 | ||
| 
						 | 
					37283cfdad | ||
| 
						 | 
					b85a419f28 | ||
| 
						 | 
					507da6f040 | ||
| 
						 | 
					11daaa2e1c | ||
| 
						 | 
					0d3113e6b9 | ||
| 
						 | 
					94d7978b44 | ||
| 
						 | 
					86de0911cc | ||
| 
						 | 
					8279241591 | ||
| 
						 | 
					88c34d1415 | ||
| 
						 | 
					a331fb8e03 | ||
| 
						 | 
					9d564134de | ||
| 
						 | 
					731b2879f0 | ||
| 
						 | 
					2f140e2168 | ||
| 
						 | 
					2bf9475dda | ||
| 
						 | 
					6fe6cfdc15 | ||
| 
						 | 
					a6584c2f75 | ||
| 
						 | 
					bdefedae37 | ||
| 
						 | 
					af50e25023 | ||
| 
						 | 
					abfda54900 | ||
| 
						 | 
					0ea8e591f4 | ||
| 
						 | 
					db3d7adbaa | ||
| 
						 | 
					f353017948 | ||
| 
						 | 
					f66f7fde8c | ||
| 
						 | 
					9049a19434 | ||
| 
						 | 
					f7da79ed88 | ||
| 
						 | 
					9d0aa0fdc1 | ||
| 
						 | 
					fb552b8e31 | ||
| 
						 | 
					a0b502df75 | ||
| 
						 | 
					5a7f1d7621 | ||
| 
						 | 
					61fb170a1e | ||
| 
						 | 
					ffbbc1e2e3 | ||
| 
						 | 
					40ac07d0e0 | ||
| 
						 | 
					7902405bd8 | ||
| 
						 | 
					ef7c79a86b | ||
| 
						 | 
					c6944b0ac8 | ||
| 
						 | 
					333d78590a | ||
| 
						 | 
					841cb61ad1 | ||
| 
						 | 
					97902ce2dd | ||
| 
						 | 
					302b785893 | ||
| 
						 | 
					fd6b79d33d | ||
| 
						 | 
					96e630a009 | ||
| 
						 | 
					7ad67781ef | ||
| 
						 | 
					616f4f4eaf | ||
| 
						 | 
					513240b350 | ||
| 
						 | 
					e0db8f3480 | ||
| 
						 | 
					8f2b396347 | ||
| 
						 | 
					3d611432e3 | ||
| 
						 | 
					561becc92e | ||
| 
						 | 
					1dd5bf2568 | ||
| 
						 | 
					ad3fa88935 | ||
| 
						 | 
					8dba7d8869 | ||
| 
						 | 
					a2cacf7d6b | ||
| 
						 | 
					bfb4474267 | ||
| 
						 | 
					8cd96ef559 | ||
| 
						 | 
					2fd0624294 | ||
| 
						 | 
					59bb8d0ced | ||
| 
						 | 
					739ce693dc | ||
| 
						 | 
					77f56522c5 | ||
| 
						 | 
					b40e08fb74 | ||
| 
						 | 
					36657db940 | ||
| 
						 | 
					486cc220c4 | ||
| 
						 | 
					baea8b9603 | ||
| 
						 | 
					e7b174f995 | ||
| 
						 | 
					0f62dc7e3b | ||
| 
						 | 
					2e670cc0d8 | ||
| 
						 | 
					9248d72018 | ||
| 
						 | 
					da622f70c7 | ||
| 
						 | 
					a0cb2b913d | ||
| 
						 | 
					71310d645d | ||
| 
						 | 
					b05cfacb3d | ||
| 
						 | 
					2356852a8c | ||
| 
						 | 
					59a07e10f1 | ||
| 
						 | 
					974eb766de | ||
| 
						 | 
					d48e4086d5 | ||
| 
						 | 
					d9361d388c | ||
| 
						 | 
					b6885555c1 | ||
| 
						 | 
					d44df22180 | ||
| 
						 | 
					2e4ec2a85c | ||
| 
						 | 
					260440e6ee | ||
| 
						 | 
					8b8ceec1bf | ||
| 
						 | 
					0bb5215f84 | ||
| 
						 | 
					59f5f092fb | ||
| 
						 | 
					32c0ced22a | ||
| 
						 | 
					fd95ab60a4 | ||
| 
						 | 
					b4038c9828 | ||
| 
						 | 
					e64dc16608 | ||
| 
						 | 
					4e25a1dbd5 | ||
| 
						 | 
					c0641998cf | ||
| 
						 | 
					9cf583b2fa | ||
| 
						 | 
					2d1d157fc4 | ||
| 
						 | 
					9c97f59c15 | ||
| 
						 | 
					82daee6f29 | ||
| 
						 | 
					e329617831 | ||
| 
						 | 
					6d8c10d4ae | ||
| 
						 | 
					13cf3ae4d0 | ||
| 
						 | 
					6893d89fd8 | ||
| 
						 | 
					35e900692a | ||
| 
						 | 
					8e8cb05168 | ||
| 
						 | 
					a510ed1271 | ||
| 
						 | 
					3b4e0378f9 | ||
| 
						 | 
					bb1c7f9192 | ||
| 
						 | 
					e7c77a85e9 | ||
| 
						 | 
					d72da1bb2f | ||
| 
						 | 
					4b3fcf149a | ||
| 
						 | 
					09e1353d0d | ||
| 
						 | 
					79f5a9c667 | ||
| 
						 | 
					864867aeeb | ||
| 
						 | 
					8750ff351e | ||
| 
						 | 
					bfcc8c3944 | ||
| 
						 | 
					bf19661382 | ||
| 
						 | 
					20016762a6 | ||
| 
						 | 
					0a7bd78704 | ||
| 
						 | 
					2e454140f1 | ||
| 
						 | 
					fc506344ea | ||
| 
						 | 
					e7f5588ee9 | ||
| 
						 | 
					b55ee6117f | ||
| 
						 | 
					902b6a8f16 | ||
| 
						 | 
					d18a6cf2ce | ||
| 
						 | 
					8ced0f5889 | ||
| 
						 | 
					a33b97ef9d | ||
| 
						 | 
					3c3118521d | ||
| 
						 | 
					f07551a43d | ||
| 
						 | 
					37eb76e767 | ||
| 
						 | 
					e2196888ca | ||
| 
						 | 
					8b9b984701 | ||
| 
						 | 
					aa6d16e47b | ||
| 
						 | 
					f3f051ecba | ||
| 
						 | 
					51c5c3ac22 | ||
| 
						 | 
					61c262dd7e | ||
| 
						 | 
					954a78f200 | ||
| 
						 | 
					a90bffbbf6 | ||
| 
						 | 
					6bf243c901 | ||
| 
						 | 
					dd5c4a716b | ||
| 
						 | 
					0dc0c2d7f0 | ||
| 
						 | 
					a584809b1c | ||
| 
						 | 
					5e97af535f | ||
| 
						 | 
					7efcda3082 | ||
| 
						 | 
					5a1fa089f3 | ||
| 
						 | 
					a129a83c45 | ||
| 
						 | 
					65fbcf1ea3 | ||
| 
						 | 
					d145edb435 | ||
| 
						 | 
					fc2d1f07c3 | ||
| 
						 | 
					694ad7adb7 | ||
| 
						 | 
					d8a7175820 | ||
| 
						 | 
					fe56feb875 | ||
| 
						 | 
					5e9d34c91a | ||
| 
						 | 
					0e086aef25 | ||
| 
						 | 
					540385da7e | ||
| 
						 | 
					540cd68691 | ||
| 
						 | 
					c41d6e5a77 | ||
| 
						 | 
					74ca45f795 | ||
| 
						 | 
					5f4131f248 | ||
| 
						 | 
					4bfef8c254 | 
@@ -1,12 +1,12 @@
 | 
			
		||||
Makefile
 | 
			
		||||
Makefile.in
 | 
			
		||||
aclocal.m4
 | 
			
		||||
alpha-dec-osf1
 | 
			
		||||
autoh31167
 | 
			
		||||
config.cache
 | 
			
		||||
config.h
 | 
			
		||||
config.h.in
 | 
			
		||||
config.log
 | 
			
		||||
config.sub
 | 
			
		||||
config.guess
 | 
			
		||||
config.status
 | 
			
		||||
configure
 | 
			
		||||
gtopConf.sh
 | 
			
		||||
@@ -25,3 +25,7 @@ sun4
 | 
			
		||||
sun4sol2
 | 
			
		||||
support
 | 
			
		||||
i386-freebsd
 | 
			
		||||
alpha-dec-osf3.0
 | 
			
		||||
i686-pc-linux-gnu-linux
 | 
			
		||||
libgtop-config
 | 
			
		||||
ABOUT-NLS
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										225
									
								
								ABOUT-NLS
									
									
									
									
									
								
							
							
						
						
									
										225
									
								
								ABOUT-NLS
									
									
									
									
									
								
							@@ -1,225 +0,0 @@
 | 
			
		||||
Notes on the Free Translation Project
 | 
			
		||||
*************************************
 | 
			
		||||
 | 
			
		||||
   Free software is going international!  The Free Translation Project
 | 
			
		||||
is a way to get maintainers of free software, translators, and users all
 | 
			
		||||
together, so that will gradually become able to speak many languages.
 | 
			
		||||
A few packages already provide translations for their messages.
 | 
			
		||||
 | 
			
		||||
   If you found this `ABOUT-NLS' file inside a distribution, you may
 | 
			
		||||
assume that the distributed package does use GNU `gettext' internally,
 | 
			
		||||
itself available at your nearest GNU archive site.  But you do *not*
 | 
			
		||||
need to install GNU `gettext' prior to configuring, installing or using
 | 
			
		||||
this package with messages translated.
 | 
			
		||||
 | 
			
		||||
   Installers will find here some useful hints.  These notes also
 | 
			
		||||
explain how users should proceed for getting the programs to use the
 | 
			
		||||
available translations.  They tell how people wanting to contribute and
 | 
			
		||||
work at translations should contact the appropriate team.
 | 
			
		||||
 | 
			
		||||
   When reporting bugs in the `intl/' directory or bugs which may be
 | 
			
		||||
related to internationalization, you should tell about the version of
 | 
			
		||||
`gettext' which is used.  The information can be found in the
 | 
			
		||||
`intl/VERSION' file, in internationalized packages.
 | 
			
		||||
 | 
			
		||||
One advise in advance
 | 
			
		||||
=====================
 | 
			
		||||
 | 
			
		||||
   If you want to exploit the full power of internationalization, you
 | 
			
		||||
should configure it using
 | 
			
		||||
 | 
			
		||||
     ./configure --with-included-gettext
 | 
			
		||||
 | 
			
		||||
to force usage of internationalizing routines provided within this
 | 
			
		||||
package, despite the existence of internationalizing capabilities in the
 | 
			
		||||
operating system where this package is being installed.  So far, only
 | 
			
		||||
the `gettext' implementation in the GNU C library version 2 provides as
 | 
			
		||||
many features (such as locale alias or message inheritance) as the
 | 
			
		||||
implementation here.  It is also not possible to offer this additional
 | 
			
		||||
functionality on top of a `catgets' implementation.  Future versions of
 | 
			
		||||
GNU `gettext' will very likely convey even more functionality.  So it
 | 
			
		||||
might be a good idea to change to GNU `gettext' as soon as possible.
 | 
			
		||||
 | 
			
		||||
   So you need not provide this option if you are using GNU libc 2 or
 | 
			
		||||
you have installed a recent copy of the GNU gettext package with the
 | 
			
		||||
included `libintl'.
 | 
			
		||||
 | 
			
		||||
INSTALL Matters
 | 
			
		||||
===============
 | 
			
		||||
 | 
			
		||||
   Some packages are "localizable" when properly installed; the
 | 
			
		||||
programs they contain can be made to speak your own native language.
 | 
			
		||||
Most such packages use GNU `gettext'.  Other packages have their own
 | 
			
		||||
ways to internationalization, predating GNU `gettext'.
 | 
			
		||||
 | 
			
		||||
   By default, this package will be installed to allow translation of
 | 
			
		||||
messages.  It will automatically detect whether the system provides
 | 
			
		||||
usable `catgets' (if using this is selected by the installer) or
 | 
			
		||||
`gettext' functions.  If neither is available, the GNU `gettext' own
 | 
			
		||||
library will be used.  This library is wholly contained within this
 | 
			
		||||
package, usually in the `intl/' subdirectory, so prior installation of
 | 
			
		||||
the GNU `gettext' package is *not* required.  Installers may use
 | 
			
		||||
special options at configuration time for changing the default
 | 
			
		||||
behaviour.  The commands:
 | 
			
		||||
 | 
			
		||||
     ./configure --with-included-gettext
 | 
			
		||||
     ./configure --with-catgets
 | 
			
		||||
     ./configure --disable-nls
 | 
			
		||||
 | 
			
		||||
will respectively bypass any pre-existing `catgets' or `gettext' to use
 | 
			
		||||
the internationalizing routines provided within this package, enable
 | 
			
		||||
the use of the `catgets' functions (if found on the locale system), or
 | 
			
		||||
else, *totally* disable translation of messages.
 | 
			
		||||
 | 
			
		||||
   When you already have GNU `gettext' installed on your system and run
 | 
			
		||||
configure without an option for your new package, `configure' will
 | 
			
		||||
probably detect the previously built and installed `libintl.a' file and
 | 
			
		||||
will decide to use this.  This might be not what is desirable.  You
 | 
			
		||||
should use the more recent version of the GNU `gettext' library.  I.e.
 | 
			
		||||
if the file `intl/VERSION' shows that the library which comes with this
 | 
			
		||||
package is more recent, you should use
 | 
			
		||||
 | 
			
		||||
     ./configure --with-included-gettext
 | 
			
		||||
 | 
			
		||||
to prevent auto-detection.
 | 
			
		||||
 | 
			
		||||
   By default the configuration process will not test for the `catgets'
 | 
			
		||||
function and therefore they will not be used.  The reasons are already
 | 
			
		||||
given above: the emulation on top of `catgets' cannot provide all the
 | 
			
		||||
extensions provided by the GNU `gettext' library.  If you nevertheless
 | 
			
		||||
want to use the `catgets' functions use
 | 
			
		||||
 | 
			
		||||
     ./configure --with-catgets
 | 
			
		||||
 | 
			
		||||
to enable the test for `catgets' (this causes no harm if `catgets' is
 | 
			
		||||
not available on your system).  If you really select this option we
 | 
			
		||||
would like to hear about the reasons because we cannot think of any
 | 
			
		||||
good one ourself.
 | 
			
		||||
 | 
			
		||||
   Internationalized packages have usually many `po/LL.po' files, where
 | 
			
		||||
LL gives an ISO 639 two-letter code identifying the language.  Unless
 | 
			
		||||
translations have been forbidden at `configure' time by using the
 | 
			
		||||
`--disable-nls' switch, all available translations are installed
 | 
			
		||||
together with the package.  However, the environment variable `LINGUAS'
 | 
			
		||||
may be set, prior to configuration, to limit the installed set.
 | 
			
		||||
`LINGUAS' should then contain a space separated list of two-letter
 | 
			
		||||
codes, stating which languages are allowed.
 | 
			
		||||
 | 
			
		||||
Using This Package
 | 
			
		||||
==================
 | 
			
		||||
 | 
			
		||||
   As a user, if your language has been installed for this package, you
 | 
			
		||||
only have to set the `LANG' environment variable to the appropriate
 | 
			
		||||
ISO 639 `LL' two-letter code prior to using the programs in the
 | 
			
		||||
package.  For example, let's suppose that you speak German.  At the
 | 
			
		||||
shell prompt, merely execute `setenv LANG de' (in `csh'),
 | 
			
		||||
`export LANG; LANG=de' (in `sh') or `export LANG=de' (in `bash').  This
 | 
			
		||||
can be done from your `.login' or `.profile' file, once and for all.
 | 
			
		||||
 | 
			
		||||
   An operating system might already offer message localization for
 | 
			
		||||
many of its programs, while other programs have been installed locally
 | 
			
		||||
with the full capabilities of GNU `gettext'.  Just using `gettext'
 | 
			
		||||
extended syntax for `LANG' would break proper localization of already
 | 
			
		||||
available operating system programs.  In this case, users should set
 | 
			
		||||
both `LANGUAGE' and `LANG' variables in their environment, as programs
 | 
			
		||||
using GNU `gettext' give preference to `LANGUAGE'.  For example, some
 | 
			
		||||
Swedish users would rather read translations in German than English for
 | 
			
		||||
when Swedish is not available.  This is easily accomplished by setting
 | 
			
		||||
`LANGUAGE' to `sv:de' while leaving `LANG' to `sv'.
 | 
			
		||||
 | 
			
		||||
Translating Teams
 | 
			
		||||
=================
 | 
			
		||||
 | 
			
		||||
   For the Free Translation Project to be a success, we need interested
 | 
			
		||||
people who like their own language and write it well, and who are also
 | 
			
		||||
able to synergize with other translators speaking the same language.
 | 
			
		||||
Each translation team has its own mailing list, courtesy of Linux
 | 
			
		||||
International.  You may reach your translation team at the address
 | 
			
		||||
`LL@li.org', replacing LL by the two-letter ISO 639 code for your
 | 
			
		||||
language.  Language codes are *not* the same as the country codes given
 | 
			
		||||
in ISO 3166.  The following translation teams exist, as of August 1997:
 | 
			
		||||
 | 
			
		||||
     Chinese `zh', Czech `cs', Danish `da', Dutch `nl', English `en',
 | 
			
		||||
     Esperanto `eo', Finnish `fi', French `fr', German `de', Hungarian
 | 
			
		||||
     `hu', Irish `ga', Italian `it', Indonesian `id', Japanese `ja',
 | 
			
		||||
     Korean `ko', Latin `la', Norwegian `no', Persian `fa', Polish
 | 
			
		||||
     `pl', Portuguese `pt', Russian `ru', Slovenian `sl', Spanish `es',
 | 
			
		||||
     Swedish `sv', and Turkish `tr'.
 | 
			
		||||
 | 
			
		||||
For example, you may reach the Chinese translation team by writing to
 | 
			
		||||
`zh@li.org'.
 | 
			
		||||
 | 
			
		||||
   If you'd like to volunteer to *work* at translating messages, you
 | 
			
		||||
should become a member of the translating team for your own language.
 | 
			
		||||
The subscribing address is *not* the same as the list itself, it has
 | 
			
		||||
`-request' appended.  For example, speakers of Swedish can send a
 | 
			
		||||
message to `sv-request@li.org', having this message body:
 | 
			
		||||
 | 
			
		||||
     subscribe
 | 
			
		||||
 | 
			
		||||
   Keep in mind that team members are expected to participate
 | 
			
		||||
*actively* in translations, or at solving translational difficulties,
 | 
			
		||||
rather than merely lurking around.  If your team does not exist yet and
 | 
			
		||||
you want to start one, or if you are unsure about what to do or how to
 | 
			
		||||
get started, please write to `translation@iro.umontreal.ca' to reach the
 | 
			
		||||
coordinator for all translator teams.
 | 
			
		||||
 | 
			
		||||
   The English team is special.  It works at improving and uniformizing
 | 
			
		||||
the terminology in use.  Proven linguistic skill are praised more than
 | 
			
		||||
programming skill, here.
 | 
			
		||||
 | 
			
		||||
Available Packages
 | 
			
		||||
==================
 | 
			
		||||
 | 
			
		||||
   Languages are not equally supported in all packages.  The following
 | 
			
		||||
matrix shows the current state of internationalization, as of August
 | 
			
		||||
1997.  The matrix shows, in regard of each package, for which languages
 | 
			
		||||
PO files have been submitted to translation coordination.
 | 
			
		||||
 | 
			
		||||
     Ready PO files    cs da de en es fi fr it ja ko nl no pl pt sl sv
 | 
			
		||||
                     .-------------------------------------------------.
 | 
			
		||||
     bash            |       []          []          []                |  3
 | 
			
		||||
     bison           |       []          []          []                |  3
 | 
			
		||||
     clisp           |       [] [] []    []                            |  4
 | 
			
		||||
     cpio            |       []    []    []          []    []          |  5
 | 
			
		||||
     diffutils       |       []    []    []                []       [] |  5
 | 
			
		||||
     enscript        |       []    [] [] []          []          []    |  6
 | 
			
		||||
     fileutils       | []    []    []    []       [] []    [] [] [] [] | 10
 | 
			
		||||
     findutils       |       []    []    [] []    [] []    []       [] |  8
 | 
			
		||||
     flex            |             []    []       []                [] |  4
 | 
			
		||||
     gcal            |       []          []          []    []       [] |  5
 | 
			
		||||
     gettext         |       []    []    []       [] [] [] [] [] [] [] | 11
 | 
			
		||||
     grep            |       []    []    []       [] [] [] []    [] [] |  9
 | 
			
		||||
     hello           |       []    []    []       [] [] [] [] [] [] [] | 10
 | 
			
		||||
     id-utils        |       []          []                []          |  3
 | 
			
		||||
     indent          |    [] []                   []       []          |  4
 | 
			
		||||
     libc            |       []    []    []       [] []    []       [] |  7
 | 
			
		||||
     m4              |       []          []    []    []             [] |  5
 | 
			
		||||
     make            |       []    []    []       [] []    []          |  6
 | 
			
		||||
     music           |                   []                []          |  2
 | 
			
		||||
     ptx             |       []    []    []          [] [] [] []    [] |  8
 | 
			
		||||
     recode          |    [] []    []    []          []    [] [] [] [] |  9
 | 
			
		||||
     sh-utils        |       []          []          [] [] [] []    [] |  7
 | 
			
		||||
     sharutils       |       []    []    []          []             [] |  5
 | 
			
		||||
     tar             |       []          [] []    [] [] [] [] [] [] [] | 10
 | 
			
		||||
     texinfo         |                   []                            |  1
 | 
			
		||||
     textutils       | []    []    []    []       [] [] [] []       [] |  9
 | 
			
		||||
     wdiff           | []    []    []    []          [] [] []       [] |  8
 | 
			
		||||
                     `-------------------------------------------------'
 | 
			
		||||
       16 languages    cs da de en es fi fr it ja ko nl no pl pt sl sv
 | 
			
		||||
       27 packages      3  2 24  1 17  1 26  2  1 11 20  9 19  7  7 17  167
 | 
			
		||||
 | 
			
		||||
   Some counters in the preceding matrix are higher than the number of
 | 
			
		||||
visible blocks let us expect.  This is because a few extra PO files are
 | 
			
		||||
used for implementing regional variants of languages, or language
 | 
			
		||||
dialects.
 | 
			
		||||
 | 
			
		||||
   For a PO file in the matrix above to be effective, the package to
 | 
			
		||||
which it applies should also have been internationalized and
 | 
			
		||||
distributed as such by its maintainer.  There might be an observable
 | 
			
		||||
lag between the mere existence a PO file and its wide availability in a
 | 
			
		||||
distribution.
 | 
			
		||||
 | 
			
		||||
   If August 1997 seems to be old, you may fetch a more recent copy of
 | 
			
		||||
this `ABOUT-NLS' file on most GNU archive sites.
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										241
									
								
								ANNOUNCE-0.25
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										241
									
								
								ANNOUNCE-0.25
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,241 @@
 | 
			
		||||
[Posted to the Gnome Mailing List on Fri Aug 21 1998]
 | 
			
		||||
 | 
			
		||||
About this release:
 | 
			
		||||
------------------
 | 
			
		||||
 | 
			
		||||
LibGTop 0.25 is a stable release.
 | 
			
		||||
 | 
			
		||||
Of cause it has its bug like any software has, I'm planning
 | 
			
		||||
to fix as many bugs as possible in _this_ release and then
 | 
			
		||||
re-release it as libgtop-0.26 or even libgtop-0.30.
 | 
			
		||||
 | 
			
		||||
Especially portings to new operating systems should be made
 | 
			
		||||
in this release.
 | 
			
		||||
 | 
			
		||||
This also means that we can safely use this version of LibGTop
 | 
			
		||||
all over the GNOME project.
 | 
			
		||||
 | 
			
		||||
Currently LibGTop-Apps is still a little bit under development -
 | 
			
		||||
especially the LibGTop-Apps GTop does not yet have the full
 | 
			
		||||
functionallity of the real GTop.
 | 
			
		||||
 | 
			
		||||
We should test this extensively and then decide whether to continue
 | 
			
		||||
with the `libgtop-apps' module or whether to merge all its code
 | 
			
		||||
back into the modules it came from. I'd like to hear some comments
 | 
			
		||||
about this from you !
 | 
			
		||||
 | 
			
		||||
Please look at the release notes below for more details about this
 | 
			
		||||
release.
 | 
			
		||||
 | 
			
		||||
Where to get the sources
 | 
			
		||||
------------------------
 | 
			
		||||
 | 
			
		||||
The sources can be found at:
 | 
			
		||||
 | 
			
		||||
	ftp://ftp.home-of-linux.org/pub/
 | 
			
		||||
 | 
			
		||||
Tarballs:
 | 
			
		||||
 | 
			
		||||
	libgtop-0.25.0.tar.gz
 | 
			
		||||
	libgtop-apps-0.25.0.tar.gz
 | 
			
		||||
 | 
			
		||||
Source RPM:
 | 
			
		||||
 | 
			
		||||
	libgtop-0.25.0-REL.src.rpm
 | 
			
		||||
	libgtop-apps-0.25.0-REL.src.rpm
 | 
			
		||||
 | 
			
		||||
Binary RPMS:
 | 
			
		||||
 | 
			
		||||
	libgtop-0.25.0-REL.i386.rpm
 | 
			
		||||
	libgtop-devel-0.25.0-REL.i386.rpm
 | 
			
		||||
	libgtop-examples-0.25.0-REL.i386.rpm
 | 
			
		||||
	libgtop-apps-0.25.0-REL.i386.rpm
 | 
			
		||||
 | 
			
		||||
There is some little problem with the binary RPMS of `libgtop-apps':
 | 
			
		||||
 | 
			
		||||
Most of its files will conflict with ones from `gnome-core' and `gnome-utils',
 | 
			
		||||
so you'll need to use the `--force' parameter to install it.
 | 
			
		||||
 | 
			
		||||
Getting the sources from CVS:
 | 
			
		||||
----------------------------
 | 
			
		||||
 | 
			
		||||
You can also fetch the sources from the GNOME CVS tree
 | 
			
		||||
(see http://www.gnome.org/ for details).
 | 
			
		||||
 | 
			
		||||
To get the latest sources:
 | 
			
		||||
 | 
			
		||||
$ cvs checkout libgtop
 | 
			
		||||
$ cvs checkout libgtop-apps
 | 
			
		||||
 | 
			
		||||
To get the sources of *this* release:
 | 
			
		||||
 | 
			
		||||
$ cvs checkout -r LIBGTOP_0_25 libgtop
 | 
			
		||||
$ cvs checkout -r LIBGTOP_0_25 libgtop-apps
 | 
			
		||||
 | 
			
		||||
To get the sources of this release with all bug-fixes applied:
 | 
			
		||||
 | 
			
		||||
$ cvs checkout -r LIBGTOP_0_25_PATCHES libgtop
 | 
			
		||||
$ cvs checkout -r LIBGTOP_0_25_PATCHES libgtop-apps
 | 
			
		||||
 | 
			
		||||
To get a patch to apply to the tarballs to get all bug-fixes:
 | 
			
		||||
 | 
			
		||||
$ cvs rdiff -r LIBGTOP_0_25 -r LIBGTOP_0_25_PATCHES libgtop
 | 
			
		||||
$ cvs rdiff -r LIBGTOP_0_25 -r LIBGTOP_0_25_PATCHES libgtop-apps
 | 
			
		||||
 | 
			
		||||
[Note for people having write access to the GNOME CVS tree:
 | 
			
		||||
 | 
			
		||||
 Please apply bug fixes to the `LIBGTOP_0_25_PATCHES' branch and
 | 
			
		||||
 merge them into the main trunk.
 | 
			
		||||
 | 
			
		||||
 After merging, please re-tag the branch `libgtop_0_25_after_merge'.
 | 
			
		||||
 | 
			
		||||
 This will help us to re-release this package when all bugs are
 | 
			
		||||
 fixed.
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
RELEASE NOTES FOR LIBGTOP 0.25 STABLE
 | 
			
		||||
=====================================
 | 
			
		||||
 | 
			
		||||
OVERVIEW
 | 
			
		||||
--------
 | 
			
		||||
 | 
			
		||||
LibGTop is a library that read information about processes and the running
 | 
			
		||||
systems. This information include:
 | 
			
		||||
 | 
			
		||||
General System Information
 | 
			
		||||
 | 
			
		||||
cpu		- CPU Usage
 | 
			
		||||
mem		- Memory Usage
 | 
			
		||||
swap		- Swap Usage (including paging activity)
 | 
			
		||||
loadavg		- Load average (including nr_running, nr_tasks, last_pid)
 | 
			
		||||
uptime		- Uptime and Idle time, can be calculated from CPU usage
 | 
			
		||||
 | 
			
		||||
SYS V IPC Limits:
 | 
			
		||||
 | 
			
		||||
shm_limits	- Shared Memory Limits
 | 
			
		||||
msg_limits	- Message Queue Limits
 | 
			
		||||
sem_limits	- Semaphore Set Limits
 | 
			
		||||
 | 
			
		||||
Process List:
 | 
			
		||||
 | 
			
		||||
proclist	- List of processes
 | 
			
		||||
 | 
			
		||||
Process information:
 | 
			
		||||
 | 
			
		||||
proc_state	- cmd, state, uid, gid
 | 
			
		||||
proc_uid	- uid,euid,gid,egid,pid,ppid,pgrp
 | 
			
		||||
		  session,tty,tpgid,priority,nice
 | 
			
		||||
proc_mem	- size,vsize,resident,share,rss,rss_rlim
 | 
			
		||||
proc_time	- start_time,rtime,utime,stime,cutime,cstime
 | 
			
		||||
		  timeout,it_real_value,frequency
 | 
			
		||||
proc_signal	- signal,blocked,sigignore,sigcatch
 | 
			
		||||
proc_kernel	- k_flags,min_flt,maj_flt,cmin_flt,cmaj_flt
 | 
			
		||||
		  kstk_esp,kstk_eip,nwchan,wchan
 | 
			
		||||
proc_segment	- text_rss,shlib_rss,data_rss,stack_rss,dirty_size
 | 
			
		||||
		  start_code,end_code,start_stack
 | 
			
		||||
 | 
			
		||||
Process maps:
 | 
			
		||||
 | 
			
		||||
proc_map	- Process map (/proc/<pid>/maps under Linux)
 | 
			
		||||
 | 
			
		||||
File system usage:
 | 
			
		||||
 | 
			
		||||
mountlist	- List of currently mounted filesystems
 | 
			
		||||
fsusage		- File system usage
 | 
			
		||||
 | 
			
		||||
PORTABILITY:
 | 
			
		||||
-----------
 | 
			
		||||
 | 
			
		||||
LibGtop is designed to be as portable as possible. None of the functions
 | 
			
		||||
and retrieved information should be specific to a specific operating
 | 
			
		||||
system. So you only need to port the system dependent part of the library
 | 
			
		||||
to a new system and all application programs can then use libgtop on this
 | 
			
		||||
new system.
 | 
			
		||||
 | 
			
		||||
CLIENT/SERVER MODEL:
 | 
			
		||||
-------------------
 | 
			
		||||
 | 
			
		||||
Some systems like DEC OSF/1 or BSD require special priviledges for the calling
 | 
			
		||||
proces to fetch the required information (SUID root/SGID kmem). To solve this
 | 
			
		||||
problem, I designed a client/server model which makes a call to a SUID/SGID
 | 
			
		||||
server which fetches the required information whenever it is required. This
 | 
			
		||||
server is only called for features that really require priviledges, otherwise
 | 
			
		||||
the sysdeps code is called directory (every user can get the CPU usage on
 | 
			
		||||
DEC OSF/1, but only root can get information about processes other than the
 | 
			
		||||
current one).
 | 
			
		||||
 | 
			
		||||
There is also some kind of daemon which can be used to fetch information from
 | 
			
		||||
remote systems (still experimental). This daemon normally runs as nobody and
 | 
			
		||||
calls the SUID/SGID itself when needed.
 | 
			
		||||
 | 
			
		||||
GNOME APPLETS:
 | 
			
		||||
--------------
 | 
			
		||||
 | 
			
		||||
There are some applets and applications which already use LibGTop. They can
 | 
			
		||||
be found in the `libgtop-apps' module in the GNOME CVS tree:
 | 
			
		||||
 | 
			
		||||
* Applets:  cpuload, cpumemusage - they need LibGTop to get their information
 | 
			
		||||
                                   on all systems other than Linux.
 | 
			
		||||
 | 
			
		||||
* Applets:  diskusage - just uses the mountlist/fsusage features of LibGTop,
 | 
			
		||||
                        the one in gnome-core also works on other systems.
 | 
			
		||||
 | 
			
		||||
* Applets:  multiload - I enhanced the cpuload applet a little bit, it is
 | 
			
		||||
                        now a multi applet and can display CPU, Memory and
 | 
			
		||||
                        Swap usages.
 | 
			
		||||
 | 
			
		||||
GTOP:
 | 
			
		||||
----
 | 
			
		||||
 | 
			
		||||
This cool GNOME app has been ported to use LibGTop. It can be found in
 | 
			
		||||
`libgtop-apps/gtop' in the GNOME CVS tree.
 | 
			
		||||
 | 
			
		||||
You can now use nearly the full functionality of GTop on FreeBSD !
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
PLATTFORM SPECIFIC NOTES FOR LINUX:
 | 
			
		||||
==================================
 | 
			
		||||
 | 
			
		||||
Under Linux, LibGTop should work without problems and read everything
 | 
			
		||||
from /proc.
 | 
			
		||||
 | 
			
		||||
There is also an experimental kernel interface to read this information
 | 
			
		||||
directly from the kernel with a system call - but this is still experimental
 | 
			
		||||
and not well tested while I made this release.
 | 
			
		||||
 | 
			
		||||
PLATTFORM SPECIFIC NOTES FOR FREEBSD:
 | 
			
		||||
====================================
 | 
			
		||||
 | 
			
		||||
LibGTop should now work under FreeBSD and give you the full functionality
 | 
			
		||||
of GTop.
 | 
			
		||||
 | 
			
		||||
There are a few caveats:
 | 
			
		||||
 | 
			
		||||
* You need to manually make the `$(prefix)/bin/libgtop_server' SGID to kmem
 | 
			
		||||
  after installation and mount the /proc filesystem of FreeBSD
 | 
			
		||||
  (/proc/<pid>/mem is used withing kvm_uread ()).
 | 
			
		||||
 | 
			
		||||
* To get the filenames of the process maps displayed in GTop, you need to
 | 
			
		||||
  configure with the `--with-libgtop-inodedb' option (you need GDBM for this
 | 
			
		||||
  to work).
 | 
			
		||||
 | 
			
		||||
* You have then to create an inode database which is used to look up to
 | 
			
		||||
  filenames. This is done using the `mkinodedb' program which comes along
 | 
			
		||||
  with libgtop.
 | 
			
		||||
 | 
			
		||||
  See the file src/inodedb/README for details:
 | 
			
		||||
 | 
			
		||||
  The `mkinodedb' program which is build in this directory takes two
 | 
			
		||||
  command line arguments: the full pathname of the database to be created
 | 
			
		||||
  and the name of a configuration file consisting of directory and file names
 | 
			
		||||
  each on a line by itself - see `/etc/ld.so.conf' for an example.
 | 
			
		||||
 | 
			
		||||
  Putting a directory name in this file means all regular files found in this
 | 
			
		||||
  directory are included in the database, but it will not recursively descend
 | 
			
		||||
  into subdirectories (for instance, we want everythink in `/usr/lib' but not
 | 
			
		||||
  every single file in `/usr/lib/sgml'). You can also use filenames to include
 | 
			
		||||
  a single file.
 | 
			
		||||
 | 
			
		||||
Have fun,
 | 
			
		||||
 | 
			
		||||
Martin <martin@home-of-linux.org>
 | 
			
		||||
							
								
								
									
										1
									
								
								AUTHORS
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								AUTHORS
									
									
									
									
									
								
							@@ -1 +1,2 @@
 | 
			
		||||
Martin Baulig (martin@home-of-linux.org)
 | 
			
		||||
Josh Sled <jsled@scam.XCF.Berkeley.EDU>
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										741
									
								
								ChangeLog
									
									
									
									
									
								
							
							
						
						
									
										741
									
								
								ChangeLog
									
									
									
									
									
								
							@@ -1,3 +1,744 @@
 | 
			
		||||
1999-01-03  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	Released LibGTop 0.99.1.
 | 
			
		||||
 | 
			
		||||
1998-12-25  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* configure.in (LIBGTOP_INCS): Define `HAVE_LIBGTOP_SMP' if SMP
 | 
			
		||||
	support was enabled.
 | 
			
		||||
 | 
			
		||||
1998-12-22  Yukihiro Nakai  <Nakai@TokyoNet.AD.JP>
 | 
			
		||||
 | 
			
		||||
	* configure.in (ALL_LINGUAS): Added `ja'.
 | 
			
		||||
 | 
			
		||||
1998-12-18  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* Makefile.am: Applied patch from Edward Jason Riedy to use '#'
 | 
			
		||||
	as separator in sed commands.
 | 
			
		||||
 | 
			
		||||
1998-12-15  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	Released LibGTop 0.99.0 which is a feature-freezed version
 | 
			
		||||
	for GNOME 1.0.
 | 
			
		||||
 | 
			
		||||
1998-12-09  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* configure.in: We need to define LIBSUPPORT and SUPPORTINCS under
 | 
			
		||||
	all circumstances as it is in gnome-libs.
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/procargs.h (glibtop_get_proc_args): Make the
 | 
			
		||||
	return value a `char *' instead of a `const char *'.
 | 
			
		||||
 | 
			
		||||
1998-12-09  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* LIBGTOP-VERSION: Set version number to 0.29.1.
 | 
			
		||||
 | 
			
		||||
1998-12-09  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* libgtop-sysdeps.m4: Moved here from the macros directory,
 | 
			
		||||
	formerly known as `macros/gnome-libgtop-sysdeps.m4'.
 | 
			
		||||
	(--enable-hacker-mode): New command line parameter to configure,
 | 
			
		||||
	enables building of unstable sysdeps directories.
 | 
			
		||||
	(LIBGTOP_HACKER_TESTS): New macro to check for unsafe things when
 | 
			
		||||
	hacker mode was enabled.
 | 
			
		||||
 | 
			
		||||
1998-12-06  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* configure.in: Make it abort if GNOME cannot be found and
 | 
			
		||||
	the --without-gnome parameter was not given.
 | 
			
		||||
 | 
			
		||||
1998-12-03  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* LIBGTOP-VERSION (LIBGTOP_VERSION_CODE): Pipe the expression
 | 
			
		||||
	through `dc' so we get a real number.
 | 
			
		||||
 | 
			
		||||
1998-12-03  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	LibGTop now requires gettext >= 0.10.35.
 | 
			
		||||
 | 
			
		||||
	* intl: Removed &intl CVS alias.
 | 
			
		||||
 | 
			
		||||
1998-11-27  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* LIBGTOP-VERSION: Set version number to 0.29.0.
 | 
			
		||||
 | 
			
		||||
	* TODO: Add things that need to be done before Dec 15.
 | 
			
		||||
 | 
			
		||||
	This is basically a feature freeze for the C language part
 | 
			
		||||
	of LibGTop except for things that are marked with (***) in
 | 
			
		||||
	the TODO.
 | 
			
		||||
 | 
			
		||||
1998-11-20  Martin Baulig  <baulig@merkur.uni-trier.de>
 | 
			
		||||
 | 
			
		||||
	* sysdeps/common/mountlist.c: Applied a patch from Kenneth Stailey to
 | 
			
		||||
	make it work on OpenBSD.
 | 
			
		||||
 | 
			
		||||
1998-11-18  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* lib/open.c (glibtop_open_l): We need to set argv[0] in call
 | 
			
		||||
	to execl () to avoid a core dump in _init () on FreeBSD 3.0.
 | 
			
		||||
 | 
			
		||||
1998-11-11  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/gnuserv.h (MCOOKIE_SCREEN): Don't define this
 | 
			
		||||
	any longer, we now use the port the daemon is listening on instead
 | 
			
		||||
	of a fixed screen.
 | 
			
		||||
 | 
			
		||||
1998-11-11  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* configure.in (--enable-debug): Define LIBGTOP_ENABLE_DEBUG
 | 
			
		||||
	if this parameter is given.
 | 
			
		||||
	(--enable-fatal-warnings): New parameter to make all warnings
 | 
			
		||||
	fatal; define `LIBGTOP_FATAL_WARNINGS' if given.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/common/error.c (glibtop_error_r): Use abort () instead
 | 
			
		||||
	of exit () if LIBGTOP_ENABLE_DEBUG.
 | 
			
		||||
	(glibtop_error_io_r): Likewise.
 | 
			
		||||
	(glibtop_warn_r): Call abort () if LIBGTOP_FATAL_WARNINGS.
 | 
			
		||||
	(glibtop_warn_io_r): Likewise.
 | 
			
		||||
 | 
			
		||||
	[NOTE: To get a core dump of the libgtop_server, you need to
 | 
			
		||||
	remove all suid/sgid bits and invoke it as a priviledged user.]
 | 
			
		||||
 | 
			
		||||
1998-11-08  Raja R Harinath  <harinath@cs.umn.edu>
 | 
			
		||||
 | 
			
		||||
	* Makefile.am (support): Don't build if not BUILD_GNOME_SUPPORT.
 | 
			
		||||
 | 
			
		||||
1998-11-02  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/parameter.h: Added `GLIBTOP_PARAM_REQUIRED'.
 | 
			
		||||
 | 
			
		||||
	* lib/parameter.c (glibtop_set_parameter_l): It's no longer
 | 
			
		||||
	allowed to set GLIBTOP_PARAM_FEATURES.
 | 
			
		||||
	(glibtop_get_parameter_l): You can use `GLIBTOP_PARAM_REQUIRED'
 | 
			
		||||
	to read server->required and ...
 | 
			
		||||
	(glibtop_set_parameter_l): ... set it here.
 | 
			
		||||
 | 
			
		||||
1998-10-26  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	Added `Network Load' feature (netload).
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/netload.h: New file.
 | 
			
		||||
	* features.def: Added new feature `netload'.
 | 
			
		||||
 | 
			
		||||
1998-10-26  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	Added `Command Line Parameters' feature (proc_args).
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/proc_args.h: New file.
 | 
			
		||||
	* features.def: Added new feature `proc_args'.
 | 
			
		||||
 | 
			
		||||
	* lib/lib.awk: New type `unsigned' for the features.def which
 | 
			
		||||
	is `unsigned'.
 | 
			
		||||
 | 
			
		||||
1998-10-25  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	Added PPP/ISDN support.
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/ppp.h: New file.
 | 
			
		||||
	* features.def: Added new feature `ppp'.
 | 
			
		||||
 | 
			
		||||
	* acconfig.h (HAVE_I4B): Defined if we have the I4B package.
 | 
			
		||||
	(HAVE_I4B_ACCT): Defined if we have ISDN statistics with I4B.
 | 
			
		||||
 | 
			
		||||
	* misc: New directory.
 | 
			
		||||
	* misc/i4b_acct.txt: Read this file to get ISDN statistics on BSD.
 | 
			
		||||
 | 
			
		||||
	* lib/lib.awk: New type `ushort' for the features.def which is
 | 
			
		||||
	`unsigned short'.
 | 
			
		||||
 | 
			
		||||
1998-10-20  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/proc_signal.h: Use a 2-element-array of
 | 
			
		||||
	type `u_int64_t' for all signal masks instead of just
 | 
			
		||||
	scalar numbers. This avoids problems on systems with more
 | 
			
		||||
	than 64 signals.
 | 
			
		||||
 | 
			
		||||
	If there is any operating system out there with even more than
 | 
			
		||||
	128 signals, we can simply increase the number of array elements
 | 
			
		||||
	here.
 | 
			
		||||
 | 
			
		||||
	[NOTE for people porting libgtop:
 | 
			
		||||
	
 | 
			
		||||
 	 Please use all 64 bits of the `u_int64_t' and not just 32 - the
 | 
			
		||||
	 signal number (as it is used in calls to kill () ...) should be
 | 
			
		||||
	 a bit-index into this field; if a process ignores for instance
 | 
			
		||||
	 signal 64, it has the 0-bit of sigcatch[1] set, if it ignores 63,
 | 
			
		||||
	 this is the 63-bit of sigcatch[0] and so on ...
 | 
			
		||||
 | 
			
		||||
	 The mapping between signal numbers and their names is done via the
 | 
			
		||||
	 glibtop_sys_siglist [] field which should be declared in
 | 
			
		||||
	 sysdeps/@sysdeps_dir@/siglist.c - see linux for an example.
 | 
			
		||||
	]
 | 
			
		||||
 | 
			
		||||
	* features.def: It's now safe to put things like `loadavg[3]'
 | 
			
		||||
	here - the awk skripts should correctly threat this as an array.
 | 
			
		||||
 | 
			
		||||
1998-10-12  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* configure.in (GNOME_COMPILE_WARNINGS): Let the user enable
 | 
			
		||||
	compiler warnings.
 | 
			
		||||
	(--with-libgtop-guile): Make the default to build the guile
 | 
			
		||||
	interface if guile can be found.
 | 
			
		||||
 | 
			
		||||
	* Makefile.am (confexec_DATA): Install `feature.def' as
 | 
			
		||||
	`libgtop-features.def'.
 | 
			
		||||
	* libgtop.spec: Added `%{prefix}/lib/*.def' to the file list.
 | 
			
		||||
 | 
			
		||||
1998-10-11  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* configure.in: Don't create `guile/Makefile'.
 | 
			
		||||
	* Makefile.am (DIST_SUBDIRS): Removed.
 | 
			
		||||
	(SUBDIRS): Removed `guile'.
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/*.h: Removed external delarations of all
 | 
			
		||||
	`glibtop_guile_*' functions that were formerly defined in
 | 
			
		||||
	sysdeps/guile/guile.c and sysdeps/guile/names/guile-names.c.
 | 
			
		||||
 | 
			
		||||
1998-10-11  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* sysdeps/guile/ChangeLog: New file.
 | 
			
		||||
 | 
			
		||||
	* LIBGTOP-VERSION: Set version number to 0.26.3.
 | 
			
		||||
	* libgtop.spec: Likewise.
 | 
			
		||||
 | 
			
		||||
	* Makefile.am (confexec_DATA): Added `features.def'.
 | 
			
		||||
	* libgtop-config.in: Added `--features-def-file' parameter
 | 
			
		||||
	to get pathname of installed `features.def' file.
 | 
			
		||||
 | 
			
		||||
	* perl: Removed everything in this subdirectory. This was
 | 
			
		||||
	only experimental. The real perl bindings for LibGTop are
 | 
			
		||||
	in the libgtop-bindings module.
 | 
			
		||||
 | 
			
		||||
1998-10-11  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* src/inodedb/Makefile.am: Removed @libs_xauth@ and -lgdbm
 | 
			
		||||
	from the _LDADD variables since libtool automatically gets
 | 
			
		||||
	the dependencies.
 | 
			
		||||
	* src/daemon/Makefile.am: Likewise.
 | 
			
		||||
	* examples/Makefile.am: Likewise.
 | 
			
		||||
 | 
			
		||||
1998-10-10  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* configure (LIBGTOP_EXTRA_LIBS): Added `GLIB_LIBS'.
 | 
			
		||||
 | 
			
		||||
	* perl/ChangeLog: New file.
 | 
			
		||||
 | 
			
		||||
1998-10-07  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* configure.in (ALL_LINGUAS): Added `de'.
 | 
			
		||||
 | 
			
		||||
1998-10-03  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/global.h: Only include system header files
 | 
			
		||||
	if we are `_IN_LIBGTOP'.
 | 
			
		||||
	(G_GNUC_NORETURN, G_GNUC_CONST, G_GNUC_UNUSED): Added those
 | 
			
		||||
	definitions if we are `_IN_LIBGTOP'.
 | 
			
		||||
 | 
			
		||||
1998-09-29  Sung-Hyun Nam  <namsh@lgic.co.kr>
 | 
			
		||||
 | 
			
		||||
	* configure.in (ALL_LINGUAS): add `ko'
 | 
			
		||||
	* po/ko.po: new file.
 | 
			
		||||
 | 
			
		||||
1998-09-27  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* configure.in: Make it really *require* GLIB >= 1.1.3.
 | 
			
		||||
 | 
			
		||||
1998-09-27  Raja R Harinath  <harinath@cs.umn.edu>
 | 
			
		||||
 | 
			
		||||
	* configure.in: Move check for `-lresolv', `-lsocket' and `-lnsl'
 | 
			
		||||
	after X11 checks.
 | 
			
		||||
 | 
			
		||||
1998-09-27  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* configure.in: Do not even check for guile if it is disabled.
 | 
			
		||||
 | 
			
		||||
1998-09-12  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/sysinfo.h: New file. This is used in guname to
 | 
			
		||||
	fetch as many information about the system as possible like detailed
 | 
			
		||||
	information about hardware etc.
 | 
			
		||||
 | 
			
		||||
	* configure.in (AM_PATH_GLIB): LibGTop now requires glib.
 | 
			
		||||
 | 
			
		||||
1998-09-09  Martin Baulig <baulig@Stud.Informatik.uni-trier.de>
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/proctime.h (glibtop_proc_time): Added `xcpu_utime'
 | 
			
		||||
 	and `xcpu_stime'.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/linux/ChangeLog: New file.
 | 
			
		||||
 | 
			
		||||
	* glibtop.h (glibtop): Added `ncpu'. This is zero for single processor
 | 
			
		||||
	systems and the number of CPUs otherwise.
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/cpu.h (glibtop_cpu): Added `xcpu_total', `xcpu_user',
 | 
			
		||||
	`xcpu_nice', `xcpu_sys' and `xcpu_idle'.
 | 
			
		||||
	(GLIBTOP_NCPU): #define this to 4.
 | 
			
		||||
 | 
			
		||||
1998-09-08  Martin Baulig  <baulig@merkur.uni-trier.de>
 | 
			
		||||
 | 
			
		||||
	* configure.in: Make the default to disable guile.
 | 
			
		||||
 | 
			
		||||
1998-08-30  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* LIBGTOP-VERSION (LIBGTOP_VERSION_CODE): Added. This is a numerical
 | 
			
		||||
	constant ("1.234.567" -> 1234567) to be used in C preprocessor
 | 
			
		||||
	conditionals.
 | 
			
		||||
 | 
			
		||||
1998-08-29  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* LIBGTOP-VERSION (LIBGTOP_INTERFACE_AGE, LIBGTOP_BINARY_AGE): Added.
 | 
			
		||||
	* configure.in (LIBGTOP_INTERFACE_AGE, LIBGTOP_BINARY_AGE): AC_SUBST.
 | 
			
		||||
	(LT_RELEASE, LT_CURRENT, LT_REVISION, LT_AGE): AC_SUBST.
 | 
			
		||||
	(LT_VERSION_INFO): Sets `-version-info' for libtool.
 | 
			
		||||
 | 
			
		||||
	* */Makefile.am: We now use the correct `-version-info' parameter
 | 
			
		||||
	for libtool.
 | 
			
		||||
 | 
			
		||||
1998-08-25  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/command.h (glibtop_call): Third argument is
 | 
			
		||||
	now `const void *'.
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/xmalloc.h (glibtop_free): Now taking a
 | 
			
		||||
	`const void *'.
 | 
			
		||||
 | 
			
		||||
1998-08-25  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* src/daemon/ChangeLog: New file.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/sun4/ChangeLog: New file.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/stub/ChangeLog: New file.
 | 
			
		||||
 | 
			
		||||
	* configure.in: Added check for `-lsocket'.
 | 
			
		||||
	(LIBGTOP_INCS): Added $(SUPPORTINCS).
 | 
			
		||||
	(INCLUDES): Added $(SUPPORTINCS).
 | 
			
		||||
 | 
			
		||||
	* acconfig.h: Added `NEED_DECLARATION_GETHOSTNAME',
 | 
			
		||||
	`NEED_DECLARATION_SETREUID', `NEED_DECLARATION_SETREGID'
 | 
			
		||||
	and `NEED_DECLARATION_GETPAGESIZE'.
 | 
			
		||||
 | 
			
		||||
	* includue/glibtop/global.h (<gnomesupport.h>): Include this.
 | 
			
		||||
 | 
			
		||||
	* lib/init.c (_init_server): Declared `static'.
 | 
			
		||||
 | 
			
		||||
	* lib/read_data.c: Added cast to `const void *' in calls to
 | 
			
		||||
	`recv' and `read' to avoid compiler warnings.
 | 
			
		||||
 | 
			
		||||
	* configure.in (INCLUDES): No longer using installed header files.
 | 
			
		||||
 | 
			
		||||
1998-08-23  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* features.def (mountlist): Using `int(fs_usage)'.
 | 
			
		||||
 | 
			
		||||
1998-08-21  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* ANNOUNCE-0.25: Released LibGTop 0.25 stable.
 | 
			
		||||
 | 
			
		||||
1998-08-18  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* LIBGTOP-VERSION: Set version number to 0.25.0. There is now really
 | 
			
		||||
	a feature freeze until it's released, bug fixes only ...
 | 
			
		||||
	
 | 
			
		||||
	* include/glibtop/procmap (glibtop_map_entry): Added `flags' and
 | 
			
		||||
	`filename' fields.
 | 
			
		||||
 | 
			
		||||
	* LIBGTOP-VERSION: Added `LIBGTOP_MICRO_VERSION'.
 | 
			
		||||
	* libgtopConf.sh.in: Likewise.
 | 
			
		||||
 | 
			
		||||
	* libgtopConf.sh.in: Added `LIBGTOP_EXTRA_LIBS'.
 | 
			
		||||
	
 | 
			
		||||
	* sysdeps/linux/procmap.c: Added implementation.
 | 
			
		||||
 | 
			
		||||
1998-08-17  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/procmap (glibtop_map_entry): Added `offset' and
 | 
			
		||||
	`perm' fields.
 | 
			
		||||
 | 
			
		||||
	* src/inodedb: New directory.
 | 
			
		||||
	* src/inodedb/README: New file - read it to know what this is about.
 | 
			
		||||
 | 
			
		||||
	* configure.in (--with-libgtop-inodedb): New `configure' parameter.
 | 
			
		||||
	* include/glibtop/inodedb.h: New file.
 | 
			
		||||
	* sysdeps/common/inodedb.c: New file.
 | 
			
		||||
 | 
			
		||||
1998-08-17  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* LIBGTOP-VERSION: Released libgtop-0.25pre1. With this
 | 
			
		||||
	release I made what Linus calles a ``feature freeze'' until
 | 
			
		||||
	0.25 is out. A Tarball and RPMS can be found at my site:
 | 
			
		||||
	`ftp://ftp.home-of-linux.org/pub/'.
 | 
			
		||||
 | 
			
		||||
1998-08-17  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* libgtop-conf.in: New file.
 | 
			
		||||
 | 
			
		||||
1998-08-16  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/loadavg.h (glibtop_loadavg): Added new
 | 
			
		||||
	fields `nr_running', `nr_tasks', `last_pid'.
 | 
			
		||||
	* features.def (loadavg): Added new fields `nr_running',
 | 
			
		||||
	`nr_tasks', `last_pid'.
 | 
			
		||||
 | 
			
		||||
1998-08-12  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/procsegment.h (glibtop_proc_segment): Using
 | 
			
		||||
	`text_rss', `shlib_rss', `data_rss' and `dirty_size' instead of
 | 
			
		||||
	`tsr', `lrs', `drs' and `dt'. New field `stack_rss'.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/linux/procmem.c: Memory sizes now correctly in bytes.
 | 
			
		||||
	* sysdeps/linux/procsegment.c: Dito.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/kernel/procsegment.c: Stack pages are reported via
 | 
			
		||||
	`stack_rss' and no longer count towards `data_rss'
 | 
			
		||||
	* kernel/table.h (table_proc_segment): Added `srs' field.
 | 
			
		||||
	* kernel/table21/module.c (TBL_PROC_SEGMENT): Added kernel support
 | 
			
		||||
	for this.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/{linux, kernel, stub}/procmap.c: New files.
 | 
			
		||||
 | 
			
		||||
1998-08-11  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* guile/features.awk: New file.
 | 
			
		||||
	* guile/make-docbook.scm: Improved automatical generation of
 | 
			
		||||
	the documentation file `reference.sgml'.
 | 
			
		||||
	* guile/reference.sgml: This file is automatically generated,
 | 
			
		||||
	but many people have problems with it, so we add it to CVS.
 | 
			
		||||
 | 
			
		||||
1998-08-10  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/procmap.h (glibtop_proc_map): New file.
 | 
			
		||||
	* features.def: Added definition of `proc_map'.
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/proctime.h (glibtop_proc_time): Added new
 | 
			
		||||
	fields `rtime' and `frequency'.
 | 
			
		||||
 | 
			
		||||
1998-08-09  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/prockernel.h (glibtop_proc_kernel): Renamed
 | 
			
		||||
	`wchan' field to `nwchan'; added `wchan' which is of type `char [40]'.
 | 
			
		||||
 | 
			
		||||
	* features.def: Changed format of this file to support multiple
 | 
			
		||||
	arguments to be passed to a function.
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/proclist.h: `glibtop_get_proclist' now takes two
 | 
			
		||||
	more arguments `method' and `param'.
 | 
			
		||||
 | 
			
		||||
1998-08-07  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* sysdeps/freebsd/ChangeLog: New file.
 | 
			
		||||
 | 
			
		||||
	* src/server: Removed.
 | 
			
		||||
	* src/daemon/{server, version}.c: New files.
 | 
			
		||||
	* src/daemon/Makefile.am: Added `libgtop_server'; this has been
 | 
			
		||||
	moved here from `src/server' since it shares some source code files
 | 
			
		||||
	with the `libgtop_daemon'.
 | 
			
		||||
 | 
			
		||||
	* LIBGTOP-VERSION: Added `LIBGTOP_SERVER_VERSION'.
 | 
			
		||||
	* src/daemon/gnuserv.c, lib/open.c: Improved version check between
 | 
			
		||||
	client and server.
 | 
			
		||||
	
 | 
			
		||||
	* include/glibtop/output.h: Removed.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/stub_suid: New directory. This is mainly used as example
 | 
			
		||||
	for people porting libgtop to other systems.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/common/sysdeps_suid.c: New file.
 | 
			
		||||
	Defines `glibtop_init_hook_p'.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/osf1/*.c (glibtop_init_<no-suid-feature>_s): New functions.
 | 
			
		||||
	(glibtop_init_<suid-feature>_p): New functions.
 | 
			
		||||
	
 | 
			
		||||
1998-08-07  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* glibtop.h (_glibtop): New fields `error_method', `sysdeps' and
 | 
			
		||||
	`required'. I added an improved error handling: the client can tell
 | 
			
		||||
	the libraries which fields are absolutely required for each features
 | 
			
		||||
	and if it fails to set one of them, this will create an error which
 | 
			
		||||
	is handled depending upon the `error_method'.
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/open.h: Define some constants for `error_method'.
 | 
			
		||||
 | 
			
		||||
	* lib/sysdeps.c (glibtop_get_sysdeps_r): No longer actually call any
 | 
			
		||||
	sysdeps function, it now simply copies `server->sysdeps'.
 | 
			
		||||
	(_glibtop_init_hook_s): Added. List of functions to be called during
 | 
			
		||||
	`glibtop_init_s' set to `glibtop_init_<no-suid-feature>_s'.
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/sysdeps.h (<glibtop/union.h>): Removed.
 | 
			
		||||
	(glibtop_init_func_t): New typedef.
 | 
			
		||||
	(_glibtop_init_hook_s): Added.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/linux/*.c (glibtop_init_<feature>_s): New functions.
 | 
			
		||||
	(glibtop_get_proc_*): Zero is now a valid pid.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/kernel/*.c (glibtop_init_<feature>_s): New functions.
 | 
			
		||||
	(glibtop_get_proc_*): Zero is now a valid pid.
 | 
			
		||||
 | 
			
		||||
1998-08-06  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* configure.in (HAVE_SOCKETS, HAVE_SOCKADDR_SUN_LEN): New checks.
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/*.h: Using `GLIBTOP_GUILE' instead of `HAVE_GUILE'
 | 
			
		||||
	so one should be able to use libgtop without guile in an application
 | 
			
		||||
	even if guile is installed.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/common/mountlist.c: Fixed some `xstrdup' problems.
 | 
			
		||||
 | 
			
		||||
	* lib/open.c: Now correctly reading server features for
 | 
			
		||||
	`GLIBTOP_METHOD_PIPE'.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/freebsd: New directory.
 | 
			
		||||
 | 
			
		||||
1998-08-01  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/swap.h (glibtop_swap): Added `pagein' and `pageout'.
 | 
			
		||||
 | 
			
		||||
	* kernel/table20/table.h: Removed.
 | 
			
		||||
	* kernel/table21/table.h: Removed.
 | 
			
		||||
	* kernel/table.h: Added. Things are now binary compatible between
 | 
			
		||||
	both kernel versions.
 | 
			
		||||
 | 
			
		||||
1998-07-30  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* acconfig.h (u_int64_t, int64_t): Added.
 | 
			
		||||
 | 
			
		||||
	* lib/lib.awk: Using correct `(1 << GLIBTOP_SYSDEPS_<feature>)'
 | 
			
		||||
	in call to `glibtop_init_r'.
 | 
			
		||||
 | 
			
		||||
	* configure.in (GNOME_LIBGTOP_TYPES): New check.
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/*.h: Using `u_int64_t' instead of `unsigned long'
 | 
			
		||||
	and `long' to avoid problems when client is on a 32bit system and
 | 
			
		||||
	the server on a 64bit system.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/common/gnuslib.c: Using `0xffffffff' instead of -1
 | 
			
		||||
	as error code for inet_addr () since on 64bit systems,
 | 
			
		||||
	`inet_addr (some_error) != (INET_ADDR) -1'.
 | 
			
		||||
 | 
			
		||||
	* configure.in: Only defining guile stuff if
 | 
			
		||||
	we really have guile.
 | 
			
		||||
 | 
			
		||||
1998-07-29  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* guile/ChangeLog: New file.
 | 
			
		||||
 | 
			
		||||
	* features.def: New format - now includes type of return value
 | 
			
		||||
	and parameters.
 | 
			
		||||
 | 
			
		||||
	* lib/lib.awk: Changed to use new `features.def'.
 | 
			
		||||
	* sysdeps/guile/guile.awk: Dito;
 | 
			
		||||
	* sysdeps/guile/names/guile-names.awk: Dito.
 | 
			
		||||
 | 
			
		||||
	* libgtopConf.sh.in: Added
 | 
			
		||||
	`LIBGTOP_NAMES_LIBS', `LIBGTOP_NAMES_INCS',
 | 
			
		||||
	`LIBGTOP_GUILE_NAMES_LIBS', `LIBGTOP_GUILE_NAMES_INCS',
 | 
			
		||||
	`LIBGTOP_MAJOR_VERSION', `LIBGTOP_MINOR_VERSION'
 | 
			
		||||
	`LIBGTOP_VERSION', `libgtop_sysdeps_dir'.
 | 
			
		||||
 | 
			
		||||
	* acinclude.m4 (AC_LC_SYSDEPS): Removed since this has been
 | 
			
		||||
	replaced with `GNOME_LIBGTOP_SYSDEPS' long ago.
 | 
			
		||||
 | 
			
		||||
	* LIBGTOP-VERSION: New file.
 | 
			
		||||
 | 
			
		||||
	* */Makefile.am (INCLUDES): Removed; now defined in `configure.in'.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/names/mountlist.c: New file.
 | 
			
		||||
 | 
			
		||||
	* lib/{init, open}.c (GTOP_SERVER): Renamed to `LIBGTOP_SERVER'.
 | 
			
		||||
 | 
			
		||||
	* configure.in (INCLUDES): Added definition.
 | 
			
		||||
	(libgtop_want_names): Always true; `libgtop_names.la' is now
 | 
			
		||||
	always created since some other programs rely upon it - but
 | 
			
		||||
	have to use `LIBGTOP_NAMES_LIBS' and `LIBGTOP_NAMES_INCS' to
 | 
			
		||||
	use it in your application.
 | 
			
		||||
	(libgtop_want_guile_names): Always true; but you have to use
 | 
			
		||||
	`LIBGTOP_GUILE_NAMES_LIBS' and `LIBGTOP_GUILE_NAMES_INCS' to
 | 
			
		||||
	use it in your application.
 | 
			
		||||
	(LIBGTOP_LIBS): Removed `-lgtop_names' and `-lgtop_guile_names'.
 | 
			
		||||
	(LIBGTOP_NAMES_LIBS): New variable. Use it to link your
 | 
			
		||||
	application with the names interface.
 | 
			
		||||
	(LIBGTOP_NAMES_INCS): New variable. Also #defines `GLIBTOP_NAMES'
 | 
			
		||||
	which is now required if your application wants to use the names
 | 
			
		||||
	interface.
 | 
			
		||||
	(LIBGTOP_GUILE_NAMES_LIBS): New variable. Use it to link your
 | 
			
		||||
	application with the guile names interface.
 | 
			
		||||
	(LIBGTOP_GUILE_NAMES_INCS): New variable. Also #defines
 | 
			
		||||
	`GLIBTOP_NAMES' and `GLIBTOP_GUILE_NAMES' which are now required
 | 
			
		||||
	if your application wants to use the guile names interface.
 | 
			
		||||
 | 
			
		||||
1998-07-24  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* sysdeps/common/mountlist.c (glibtop_get_mountlist_s):
 | 
			
		||||
	Added `all_fs' parameter.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/{kernel, linux}/*.c: Replaced `glibtop_init_r' with
 | 
			
		||||
	`glibtop_init_s'.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/sun4/open.c (glibtop_init_p): Removed `program_name'
 | 
			
		||||
	parameter.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/osf1/glibtop_suid.h: New file.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/osf1/glibtop_server.h: Now correctly using
 | 
			
		||||
	`(1 << GLIBTOP_SYSDEPS_*)' instead of `GLIBTOP_SYSDEPS_*'.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/osf1/open_suid.c (glibtop_init_p): New function.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/osf1/proc*.c: Done some more work here.
 | 
			
		||||
 | 
			
		||||
1998-07-23  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/procsignal.h (glibtop_proc_signal):
 | 
			
		||||
	Changed type for `signal', `blocked', `sigignore' and
 | 
			
		||||
	`sigcatch' to `unsigned long long'.
 | 
			
		||||
 | 
			
		||||
1998-07-22  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/fsusage.h: New file.
 | 
			
		||||
 | 
			
		||||
	* features.def: Added new feature `fsusage'.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/common/fsusage.c (glibtop_get_fsusage_s): New function.
 | 
			
		||||
	(get_fs_usage): Declared as `static'.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/names/fsusage.c: New file.
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/mountlist.h: New file.
 | 
			
		||||
 | 
			
		||||
	* features.def: Added new feature `mountlist'.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/common/mountlist.c (glibtop_get_mountlist_s): New function.
 | 
			
		||||
	(read_filesystem_list): Declared as `static'.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/common/Makefile.am (libgtop_common_la_SOURCES):
 | 
			
		||||
	Added `fsusage.[ch]' and `mountlist.[ch]'.
 | 
			
		||||
 | 
			
		||||
	* include/glibtop/signal.h: New file.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/{kernel, linux, osf1, sun4, stub}/siglist.c: New files.
 | 
			
		||||
 | 
			
		||||
1998-07-22  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* lib/init.c (glibtop_init_s): Added this init function of
 | 
			
		||||
	the sysdeps directory `libgtop_sysdeps.la'.
 | 
			
		||||
 | 
			
		||||
	* lib/open.c (glibtop_open_l): Unconditionally calling
 | 
			
		||||
	`glibtop_init_s' after server initialization.
 | 
			
		||||
	
 | 
			
		||||
	* lib/lib.awk: Removed references to functions from
 | 
			
		||||
	`libgtop_sysdeps_suid.la' to avoid undefined symbols.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/stub/open.c (glibtop_open_s): Renamed this
 | 
			
		||||
	function from `glibtop_open_r'.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/stub/close.c (glibtop_close_s): Renamed this
 | 
			
		||||
	function from `glibtop_close_l'.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/kernel/open.c (glibtop_open_s): Renamed this
 | 
			
		||||
	function from `glibtop_open_r'.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/kernel/close.c (glibtop_close_s): Renamed this
 | 
			
		||||
	function from `glibtop_close_l'.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/linux/open.c (glibtop_open_s): Renamed this
 | 
			
		||||
	function from `glibtop_open_r'.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/linux/close.c (glibtop_close_s): Renamed this
 | 
			
		||||
	function from `glibtop_close_l'.
 | 
			
		||||
	
 | 
			
		||||
	* sysdeps/osf1/Makefile.am (lib_LTLIBRARIES): Added
 | 
			
		||||
	`libgtop_sysdeps_suid.la' for the suid server.
 | 
			
		||||
	
 | 
			
		||||
	* sysdeps/osf1/open_suid.c (glibtop_open_p): New file.
 | 
			
		||||
	Contains all stuff that was formerly in `open.c'.
 | 
			
		||||
	
 | 
			
		||||
	* sysdeps/osf1/open.c: Moved everything from here into
 | 
			
		||||
	the new file `open_suid.c'.
 | 
			
		||||
	
 | 
			
		||||
	* sysdeps/osf1/open.c (glibtop_open_s): New function.
 | 
			
		||||
	
 | 
			
		||||
	* sysdeps/osf1/close_suid.c (glibtop_close_p): New file.
 | 
			
		||||
	
 | 
			
		||||
	* sysdeps/osf1/close.c (glibtop_close_s): New function.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/osf1/*.c: Using the new init, open and close
 | 
			
		||||
	functions.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/sun4/Makefile.am (lib_LTLIBRARIES): Added
 | 
			
		||||
	`libgtop_sysdeps_suid.la' for the suid server.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/sun4/nosuid.c (glibtop_open_s, glibtop_close_s): New file
 | 
			
		||||
 | 
			
		||||
	* sysdeps/sun4/*.c: All functions now have the `_p' suffix.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/common/Makefile.am (lib_LTLIBRARIES): Added
 | 
			
		||||
	`libgtop_suid_common.la' which only contains stuff that is
 | 
			
		||||
	needed in the suid parts.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/common/xmalloc.c: Using `glibtop_error_io_r' instead
 | 
			
		||||
	of `glibtop_error_r'.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/{kernel, linux, osf1, sun4, stub}/init.c: Removed.
 | 
			
		||||
	`glibtop_init_s' has been moved into `lib/init.c' since it's the
 | 
			
		||||
	same in all the sysdeps directories.
 | 
			
		||||
 | 
			
		||||
	* src/server/main.c: It is now an error to request a feature that
 | 
			
		||||
	does not need the suid server.
 | 
			
		||||
 | 
			
		||||
	* src/proxy: Removed.
 | 
			
		||||
 | 
			
		||||
1998-07-21  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* doc/ChangeLog: New file.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/kernel/*.c: Using `glibtop_error_io_r' instead
 | 
			
		||||
	of `glibtop_error_r'.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/kernel/proclist.c: Now using the table () function, too.
 | 
			
		||||
	This means that currently the table () function can fetch all
 | 
			
		||||
	information for libgtop and you can even unmount /proc !
 | 
			
		||||
 | 
			
		||||
1998-07-18  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* lib/{init, open}.c: Added `GLIBTOP_METHOD_PIPE' again.
 | 
			
		||||
	
 | 
			
		||||
	* src/server/main.c: Removed gettext stuff.
 | 
			
		||||
 | 
			
		||||
1998-07-17  Martin Baulig  <baulig@Stud.Informatik.uni-trier.de>
 | 
			
		||||
 | 
			
		||||
	* sysdeps/common/sysdeps.c (glibtop_get_sysdeps_r): Using
 | 
			
		||||
	library functions with '_l' prefix instead of directly calling
 | 
			
		||||
	sysdeps code with '_r' prefix. This is necessary for client/server
 | 
			
		||||
	mode.
 | 
			
		||||
	
 | 
			
		||||
	* lib/lib.awk (glibtop_get_*): Now correctly using
 | 
			
		||||
	`(1 << GLIBTOP_SYSDEPS_*)' instead of `GLIBTOP_SYSDEPS_*'.
 | 
			
		||||
	
 | 
			
		||||
	* sysdeps/sun4/proclist.c (glibtop_get_proclist_p): Added
 | 
			
		||||
	implementation of that feature.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/sun4/proc_{uid, state}.c: Now working quite well.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/sun4/proc_{mem, time, signal, kernel, segment}.c: Added
 | 
			
		||||
	some basic implementation; this isn't really working yet.
 | 
			
		||||
	
 | 
			
		||||
	* sysdeps/linux/sem_limits.c: Applied patch from Albert K T Hui
 | 
			
		||||
	<avatar@deva.net> for glibc 2.1.
 | 
			
		||||
 | 
			
		||||
1998-07-15  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* sysdeps/sun4/loadavg.h: New file. Imported from top 3.4.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/sun4/uptime.c (glibtop_get_uptime_p): Added
 | 
			
		||||
	implementation of that function using glibtop_get_cpu ().
 | 
			
		||||
 | 
			
		||||
	* sysdeps/sun4/loadavg.c (glibtop_get_loadavg_p): Added
 | 
			
		||||
	implementation of that feature.
 | 
			
		||||
 | 
			
		||||
	* sysdeps/sun4/{shm_limits.c, msg_limits.c, shm_limits.c}:
 | 
			
		||||
	Added implementation of this features.
 | 
			
		||||
 | 
			
		||||
1998-07-14  Martin Baulig  <baulig@Stud.Informatik.uni-trier.de>
 | 
			
		||||
 | 
			
		||||
	* src/daemon/server_config.h.in: Added some comments.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										25
									
								
								LIBGTOP-VERSION
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								LIBGTOP-VERSION
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,25 @@
 | 
			
		||||
# Making releases:
 | 
			
		||||
#   LIBGTOP_MICRO_VERSION += 1;
 | 
			
		||||
#   LIBGTOP_INTERFACE_AGE += 1;
 | 
			
		||||
#   LIBGTOP_BINARY_AGE += 1;
 | 
			
		||||
# if any functions have been added, set LIBGTOP_INTERFACE_AGE to 0.
 | 
			
		||||
# if backwards compatibility has been broken,
 | 
			
		||||
# set LIBGTOP_BINARY_AGE and LIBGTOP_INTERFACE_AGE to 0.
 | 
			
		||||
#
 | 
			
		||||
LIBGTOP_MAJOR_VERSION=0
 | 
			
		||||
LIBGTOP_MINOR_VERSION=99
 | 
			
		||||
LIBGTOP_MICRO_VERSION=1
 | 
			
		||||
 | 
			
		||||
LIBGTOP_INTERFACE_AGE=1
 | 
			
		||||
LIBGTOP_BINARY_AGE=1
 | 
			
		||||
 | 
			
		||||
# Increase each time you change the client/server protocol.
 | 
			
		||||
LIBGTOP_SERVER_VERSION=3
 | 
			
		||||
 | 
			
		||||
# Don't change this
 | 
			
		||||
LIBGTOP_VERSION=$LIBGTOP_MAJOR_VERSION.$LIBGTOP_MINOR_VERSION.$LIBGTOP_MICRO_VERSION
 | 
			
		||||
LIBGTOP_VERSION_CODE=`echo "$LIBGTOP_MAJOR_VERSION 1000000 * $LIBGTOP_MINOR_VERSION 1000 * + $LIBGTOP_MICRO_VERSION + p q" | dc`
 | 
			
		||||
 | 
			
		||||
# For automake.
 | 
			
		||||
VERSION=$LIBGTOP_VERSION
 | 
			
		||||
PACKAGE=libgtop
 | 
			
		||||
							
								
								
									
										103
									
								
								Makefile.am
									
									
									
									
									
								
							
							
						
						
									
										103
									
								
								Makefile.am
									
									
									
									
									
								
							@@ -1,80 +1,83 @@
 | 
			
		||||
## Process this file with automake to produce Makefile.in.
 | 
			
		||||
 | 
			
		||||
if GLIBTOP_EXAMPLES
 | 
			
		||||
examples_SUBDIRS	= examples
 | 
			
		||||
if EXAMPLES
 | 
			
		||||
examples_SUBDIRS = examples
 | 
			
		||||
else
 | 
			
		||||
examples_SUBDIRS =
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
built_SUBDIRS = include sysdeps lib src
 | 
			
		||||
if BUILD_GNOME_SUPPORT
 | 
			
		||||
support = support
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
SUBDIRS = po intl support macros $(built_SUBDIRS) $(examples_SUBDIRS)
 | 
			
		||||
 | 
			
		||||
DIST_SUBDIRS = po intl macros include sysdeps src lib examples
 | 
			
		||||
SUBDIRS = po intl $(support) macros misc include sysdeps lib src \
 | 
			
		||||
	  $(examples_SUBDIRS)
 | 
			
		||||
 | 
			
		||||
include_HEADERS = glibtop.h
 | 
			
		||||
 | 
			
		||||
EXTRA_DIST = autogen.sh libgtop.spec copyright.txt libgtopConf.sh.in
 | 
			
		||||
EXTRA_DIST = autogen.sh libgtop.spec copyright.txt libgtopConf.sh.in \
 | 
			
		||||
	LIBGTOP-VERSION features.def libgtop-config.in RELNOTES-0.25 \
 | 
			
		||||
	libgtop-sysdeps.m4 ANNOUNCE ANNOUNCE-0.25 README.LATEST \
 | 
			
		||||
	libgtop-mirror.sh
 | 
			
		||||
 | 
			
		||||
release:
 | 
			
		||||
	$(MAKE) dist distdir=$(PACKAGE)$(VERSION)
 | 
			
		||||
	$(MAKE) dist distdir=$(PACKAGE)-$(VERSION)
 | 
			
		||||
 | 
			
		||||
## Put `exec' in the name because this should be installed by
 | 
			
		||||
## `install-exec', not `install-data'.
 | 
			
		||||
confexecdir=$(libdir)
 | 
			
		||||
confexec_DATA = $(top_builddir)/libgtopConf.sh
 | 
			
		||||
confexecdir	= $(libdir)
 | 
			
		||||
confexec_DATA	= $(top_builddir)/libgtopConf.sh \
 | 
			
		||||
		  $(top_builddir)/libgtop-features.def
 | 
			
		||||
 | 
			
		||||
noinst_DATA = $(top_builddir)/perl/Makefile.PL \
 | 
			
		||||
		$(top_builddir)/perl/Libgtop.xs
 | 
			
		||||
bin_SCRIPTS = $(top_builddir)/libgtop-config
 | 
			
		||||
 | 
			
		||||
## to automatically rebuild aclocal.m4 if any of the macros in
 | 
			
		||||
## `macros/' change
 | 
			
		||||
@MAINT@include macros/macros.dep
 | 
			
		||||
@MAINT@ include macros/macros.dep
 | 
			
		||||
@MAINT@macros/macros.dep: macros/Makefile.am
 | 
			
		||||
@MAINT@	cd macros && $(MAKE) macros.dep
 | 
			
		||||
 | 
			
		||||
@MAINT@$(top_srcdir)/aclocal.m4: libgtop-sysdeps.m4
 | 
			
		||||
 | 
			
		||||
## We create libgtopConf.sh here and not from configure because we want
 | 
			
		||||
## to get the paths expanded correctly.  Macros like srcdir are given
 | 
			
		||||
## the value NONE in configure if the user doesn't specify them (this
 | 
			
		||||
## is an autoconf feature, not a bug).
 | 
			
		||||
libgtopConf.sh: libgtopConf.sh.in Makefile
 | 
			
		||||
## Use sed and then mv to avoid problems if the user interrupts.
 | 
			
		||||
	sed -e 's,\@LIBGTOP_LIBDIR\@,$(libdir),g' \
 | 
			
		||||
	    -e 's,\@LIBGTOP_INCLUDEDIR\@,$(includedir),g' \
 | 
			
		||||
	    -e 's,\@LIBGTOP_LIBS\@,$(LIBGTOP_LIBS),g' \
 | 
			
		||||
	    -e 's,\@LIBGTOP_INCS\@,$(LIBGTOP_INCS),g' \
 | 
			
		||||
	    -e 's,\@LIBGTOP_GUILE_LIBS\@,$(LIBGTOP_GUILE_LIBS),g' \
 | 
			
		||||
	    -e 's,\@LIBGTOP_GUILE_INCS\@,$(LIBGTOP_GUILE_INCS),g' \
 | 
			
		||||
	    -e 's,\@LIBGTOP_BINDIR\@,$(LIBGTOP_BINDIR),g' \
 | 
			
		||||
	    -e 's,\@LIBGTOP_SERVER\@,$(LIBGTOP_SERVER),g' \
 | 
			
		||||
	    -e 's,\@libgtop_sysdeps_dir\@,$(libgtop_sysdeps_dir),g' \
 | 
			
		||||
	    -e 's,\@libgtop_need_server\@,$(libgtop_need_server),g' \
 | 
			
		||||
	    -e 's,\@libgtop_use_machine_h\@,$(libgtop_use_machine_h),g' \
 | 
			
		||||
	    -e 's,\@libgtop_guile_found\@,$(libgtop_guile_found),g' \
 | 
			
		||||
	    -e 's,\@libgtop_want_names\@,$(libgtop_want_names),g' \
 | 
			
		||||
	    -e 's,\@libgtop_want_guile_names\@,$(libgtop_want_guile_names),g' \
 | 
			
		||||
	    -e 's,\@libgtop_want_examples\@,$(libgtop_want_examples),g' \
 | 
			
		||||
	sed -e 's#\@LIBGTOP_LIBDIR\@#$(libdir)#g' \
 | 
			
		||||
	  -e 's#\@LIBGTOP_INCLUDEDIR\@#$(includedir)#g' \
 | 
			
		||||
	  -e 's#\@LIBGTOP_EXTRA_LIBS\@#$(LIBGTOP_EXTRA_LIBS)#g' \
 | 
			
		||||
	  -e 's#\@LIBGTOP_LIBS\@#$(LIBGTOP_LIBS)#g' \
 | 
			
		||||
	  -e 's#\@LIBGTOP_INCS\@#$(LIBGTOP_INCS)#g' \
 | 
			
		||||
	  -e 's#\@LIBGTOP_NAMES_LIBS\@#$(LIBGTOP_NAMES_LIBS)#g' \
 | 
			
		||||
	  -e 's#\@LIBGTOP_NAMES_INCS\@#$(LIBGTOP_NAMES_INCS)#g' \
 | 
			
		||||
	  -e 's#\@LIBGTOP_GUILE_LIBS\@#$(LIBGTOP_GUILE_LIBS)#g' \
 | 
			
		||||
	  -e 's#\@LIBGTOP_GUILE_INCS\@#$(LIBGTOP_GUILE_INCS)#g' \
 | 
			
		||||
	  -e 's#\@LIBGTOP_GUILE_NAMES_LIBS\@#$(LIBGTOP_GUILE_NAMES_LIBS)#g' \
 | 
			
		||||
	  -e 's#\@LIBGTOP_GUILE_NAMES_INCS\@#$(LIBGTOP_GUILE_NAMES_INCS)#g' \
 | 
			
		||||
	  -e 's#\@LIBGTOP_BINDIR\@#$(LIBGTOP_BINDIR)#g' \
 | 
			
		||||
	  -e 's#\@LIBGTOP_SERVER\@#$(LIBGTOP_SERVER)#g' \
 | 
			
		||||
	  -e 's#\@LIBGTOP_MAJOR_VERSION\@#$(LIBGTOP_MAJOR_VERSION)#g' \
 | 
			
		||||
	  -e 's#\@LIBGTOP_MINOR_VERSION\@#$(LIBGTOP_MINOR_VERSION)#g' \
 | 
			
		||||
	  -e 's#\@LIBGTOP_MICRO_VERSION\@#$(LIBGTOP_MICRO_VERSION)#g' \
 | 
			
		||||
	  -e 's#\@LIBGTOP_VERSION\@#$(LIBGTOP_VERSION)#g' \
 | 
			
		||||
	  -e 's#\@LIBGTOP_VERSION_CODE\@#$(LIBGTOP_VERSION_CODE)#g' \
 | 
			
		||||
	  -e 's#\@LIBGTOP_SERVER_VERSION\@#$(LIBGTOP_SERVER_VERSION)#g' \
 | 
			
		||||
	  -e 's#\@libgtop_sysdeps_dir\@#$(libgtop_sysdeps_dir)#g' \
 | 
			
		||||
	  -e 's#\@libgtop_need_server\@#$(libgtop_need_server)#g' \
 | 
			
		||||
	  -e 's#\@libgtop_use_machine_h\@#$(libgtop_use_machine_h)#g' \
 | 
			
		||||
	  -e 's#\@libgtop_guile_found\@#$(libgtop_guile_found)#g' \
 | 
			
		||||
	  -e 's#\@libgtop_want_examples\@#$(libgtop_want_examples)#g' \
 | 
			
		||||
	      < $(srcdir)/libgtopConf.sh.in > libgtopConf.tmp \
 | 
			
		||||
	  && mv libgtopConf.tmp libgtopConf.sh
 | 
			
		||||
 | 
			
		||||
perl/Makefile.PL: perl/Makefile.PL.in Makefile
 | 
			
		||||
## Use sed and then mv to avoid problems if the user interrupts.
 | 
			
		||||
	sed -e 's,\@LIBGTOP_LIBDIR\@,$(libdir),g' \
 | 
			
		||||
	    -e 's,\@LIBGTOP_INCLUDEDIR\@,$(includedir),g' \
 | 
			
		||||
	    -e 's,\@LIBGTOP_LIBS\@,$(LIBGTOP_LIBS),g' \
 | 
			
		||||
	    -e 's,\@LIBGTOP_INCS\@,$(LIBGTOP_INCS),g' \
 | 
			
		||||
	    -e 's,\@LIBGTOP_GUILE_LIBS\@,$(LIBGTOP_GUILE_LIBS),g' \
 | 
			
		||||
	    -e 's,\@LIBGTOP_GUILE_INCS\@,$(LIBGTOP_GUILE_INCS),g' \
 | 
			
		||||
	    -e 's,\@LIBGTOP_BINDIR\@,$(LIBGTOP_BINDIR),g' \
 | 
			
		||||
	    -e 's,\@LIBGTOP_SERVER\@,$(LIBGTOP_SERVER),g' \
 | 
			
		||||
	    -e 's,\@libgtop_sysdeps_dir\@,$(libgtop_sysdeps_dir),g' \
 | 
			
		||||
	    -e 's,\@libgtop_need_server\@,$(libgtop_need_server),g' \
 | 
			
		||||
	    -e 's,\@libgtop_use_machine_h\@,$(libgtop_use_machine_h),g' \
 | 
			
		||||
	    -e 's,\@libgtop_guile_found\@,$(libgtop_guile_found),g' \
 | 
			
		||||
	    -e 's,\@libgtop_want_names\@,$(libgtop_want_names),g' \
 | 
			
		||||
	    -e 's,\@libgtop_want_guile_names\@,$(libgtop_want_guile_names),g' \
 | 
			
		||||
	    -e 's,\@libgtop_want_examples\@,$(libgtop_want_examples),g' \
 | 
			
		||||
	      < $(srcdir)/perl/Makefile.PL.in > perl/Makefile.tmp \
 | 
			
		||||
	  && mv perl/Makefile.tmp perl/Makefile.PL
 | 
			
		||||
libgtop-config: libgtop-config.in Makefile
 | 
			
		||||
	sed -e 's#\@LIBGTOP_LIBDIR\@#$(libdir)#g' \
 | 
			
		||||
	      < $(srcdir)/libgtop-config.in > libgtop-config.tmp \
 | 
			
		||||
	  && mv libgtop-config.tmp libgtop-config && \
 | 
			
		||||
		chmod 755 libgtop-config
 | 
			
		||||
 | 
			
		||||
libgtop-features.def: features.def
 | 
			
		||||
	@LN_S@ $< $@
 | 
			
		||||
 | 
			
		||||
perl/Libgtop.xs: perl/perl.awk $(top_builddir)/config.h $(top_srcdir)/features.def
 | 
			
		||||
	$(AWK) -f $(top_srcdir)/perl/perl.awk < $(top_srcdir)/features.def > perl/lgt-t
 | 
			
		||||
	mv perl/lgt-t perl/Libgtop.xs
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										146
									
								
								RELNOTES-0.25
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										146
									
								
								RELNOTES-0.25
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,146 @@
 | 
			
		||||
RELEASE NOTES FOR LIBGTOP 0.25 STABLE
 | 
			
		||||
=====================================
 | 
			
		||||
 | 
			
		||||
OVERVIEW
 | 
			
		||||
--------
 | 
			
		||||
 | 
			
		||||
LibGTop is a library that read information about processes and the running
 | 
			
		||||
systems. This information include:
 | 
			
		||||
 | 
			
		||||
General System Information
 | 
			
		||||
 | 
			
		||||
cpu		- CPU Usage
 | 
			
		||||
mem		- Memory Usage
 | 
			
		||||
swap		- Swap Usage (including paging activity)
 | 
			
		||||
loadavg		- Load average (including nr_running, nr_tasks, last_pid)
 | 
			
		||||
uptime		- Uptime and Idle time, can be calculated from CPU usage
 | 
			
		||||
 | 
			
		||||
SYS V IPC Limits:
 | 
			
		||||
 | 
			
		||||
shm_limits	- Shared Memory Limits
 | 
			
		||||
msg_limits	- Message Queue Limits
 | 
			
		||||
sem_limits	- Semaphore Set Limits
 | 
			
		||||
 | 
			
		||||
Process List:
 | 
			
		||||
 | 
			
		||||
proclist	- List of processes
 | 
			
		||||
 | 
			
		||||
Process information:
 | 
			
		||||
 | 
			
		||||
proc_state	- cmd, state, uid, gid
 | 
			
		||||
proc_uid	- uid,euid,gid,egid,pid,ppid,pgrp
 | 
			
		||||
		  session,tty,tpgid,priority,nice
 | 
			
		||||
proc_mem	- size,vsize,resident,share,rss,rss_rlim
 | 
			
		||||
proc_time	- start_time,rtime,utime,stime,cutime,cstime
 | 
			
		||||
		  timeout,it_real_value,frequency
 | 
			
		||||
proc_signal	- signal,blocked,sigignore,sigcatch
 | 
			
		||||
proc_kernel	- k_flags,min_flt,maj_flt,cmin_flt,cmaj_flt
 | 
			
		||||
		  kstk_esp,kstk_eip,nwchan,wchan
 | 
			
		||||
proc_segment	- text_rss,shlib_rss,data_rss,stack_rss,dirty_size
 | 
			
		||||
		  start_code,end_code,start_stack
 | 
			
		||||
 | 
			
		||||
Process maps:
 | 
			
		||||
 | 
			
		||||
proc_map	- Process map (/proc/<pid>/maps under Linux)
 | 
			
		||||
 | 
			
		||||
File system usage:
 | 
			
		||||
 | 
			
		||||
mountlist	- List of currently mounted filesystems
 | 
			
		||||
fsusage		- File system usage
 | 
			
		||||
 | 
			
		||||
PORTABILITY:
 | 
			
		||||
-----------
 | 
			
		||||
 | 
			
		||||
LibGtop is designed to be as portable as possible. None of the functions
 | 
			
		||||
and retrieved information should be specific to a specific operating
 | 
			
		||||
system. So you only need to port the system dependent part of the library
 | 
			
		||||
to a new system and all application programs can then use libgtop on this
 | 
			
		||||
new system.
 | 
			
		||||
 | 
			
		||||
CLIENT/SERVER MODEL:
 | 
			
		||||
-------------------
 | 
			
		||||
 | 
			
		||||
Some systems like DEC OSF/1 or BSD require special priviledges for the calling
 | 
			
		||||
proces to fetch the required information (SUID root/SGID kmem). To solve this
 | 
			
		||||
problem, I designed a client/server model which makes a call to a SUID/SGID
 | 
			
		||||
server which fetches the required information whenever it is required. This
 | 
			
		||||
server is only called for features that really require priviledges, otherwise
 | 
			
		||||
the sysdeps code is called directory (every user can get the CPU usage on
 | 
			
		||||
DEC OSF/1, but only root can get information about processes other than the
 | 
			
		||||
current one).
 | 
			
		||||
 | 
			
		||||
There is also some kind of daemon which can be used to fetch information from
 | 
			
		||||
remote systems (still experimental). This daemon normally runs as nobody and
 | 
			
		||||
calls the SUID/SGID itself when needed.
 | 
			
		||||
 | 
			
		||||
GNOME APPLETS:
 | 
			
		||||
--------------
 | 
			
		||||
 | 
			
		||||
There are some applets and applications which already use LibGTop. They can
 | 
			
		||||
be found in the `libgtop-apps' module in the GNOME CVS tree:
 | 
			
		||||
 | 
			
		||||
* Applets:  cpuload, cpumemusage - they need LibGTop to get their information
 | 
			
		||||
                                   on all systems other than Linux.
 | 
			
		||||
 | 
			
		||||
* Applets:  diskusage - just uses the mountlist/fsusage features of LibGTop,
 | 
			
		||||
                        the one in gnome-core also works on other systems.
 | 
			
		||||
 | 
			
		||||
* Applets:  multiload - I enhanced the cpuload applet a little bit, it is
 | 
			
		||||
                        now a multi applet and can display CPU, Memory and
 | 
			
		||||
                        Swap usages.
 | 
			
		||||
 | 
			
		||||
GTOP:
 | 
			
		||||
----
 | 
			
		||||
 | 
			
		||||
This cool GNOME app has been ported to use LibGTop. It can be found in
 | 
			
		||||
`libgtop-apps/gtop' in the GNOME CVS tree.
 | 
			
		||||
 | 
			
		||||
You can now use nearly the full functionality of GTop on FreeBSD !
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
PLATTFORM SPECIFIC NOTES FOR LINUX:
 | 
			
		||||
==================================
 | 
			
		||||
 | 
			
		||||
Under Linux, LibGTop should work without problems and read everything
 | 
			
		||||
from /proc.
 | 
			
		||||
 | 
			
		||||
There is also an experimental kernel interface to read this information
 | 
			
		||||
directly from the kernel with a system call - but this is still experimental
 | 
			
		||||
and not well tested while I made this release.
 | 
			
		||||
 | 
			
		||||
PLATTFORM SPECIFIC NOTES FOR FREEBSD:
 | 
			
		||||
====================================
 | 
			
		||||
 | 
			
		||||
LibGTop should now work under FreeBSD and give you the full functionality
 | 
			
		||||
of GTop.
 | 
			
		||||
 | 
			
		||||
There are a few caveats:
 | 
			
		||||
 | 
			
		||||
* You need to manually make the `$(prefix)/bin/libgtop_server' SGID to kmem
 | 
			
		||||
  after installation and mount the /proc filesystem of FreeBSD
 | 
			
		||||
  (/proc/<pid>/mem is used withing kvm_uread ()).
 | 
			
		||||
 | 
			
		||||
* To get the filenames of the process maps displayed in GTop, you need to
 | 
			
		||||
  configure with the `--with-libgtop-inodedb' option (you need GDBM for this
 | 
			
		||||
  to work).
 | 
			
		||||
 | 
			
		||||
* You have then to create an inode database which is used to look up to
 | 
			
		||||
  filenames. This is done using the `mkinodedb' program which comes along
 | 
			
		||||
  with libgtop.
 | 
			
		||||
 | 
			
		||||
  See the file src/inodedb/README for details:
 | 
			
		||||
 | 
			
		||||
  The `mkinodedb' program which is build in this directory takes two
 | 
			
		||||
  command line arguments: the full pathname of the database to be created
 | 
			
		||||
  and the name of a configuration file consisting of directory and file names
 | 
			
		||||
  each on a line by itself - see `/etc/ld.so.conf' for an example.
 | 
			
		||||
 | 
			
		||||
  Putting a directory name in this file means all regular files found in this
 | 
			
		||||
  directory are included in the database, but it will not recursively descend
 | 
			
		||||
  into subdirectories (for instance, we want everythink in `/usr/lib' but not
 | 
			
		||||
  every single file in `/usr/lib/sgml'). You can also use filenames to include
 | 
			
		||||
  a single file.
 | 
			
		||||
 | 
			
		||||
Have fun,
 | 
			
		||||
 | 
			
		||||
Martin <martin@home-of-linux.org>
 | 
			
		||||
							
								
								
									
										48
									
								
								TODO
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								TODO
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,48 @@
 | 
			
		||||
This is LibGTop 0.30.0,
 | 
			
		||||
 | 
			
		||||
a feature-freezed version of LibGTop for GNOME 1.0.
 | 
			
		||||
 | 
			
		||||
You need to use the latest version of LibGTop from CVS for Gnome, it will
 | 
			
		||||
no longer work with older releases.
 | 
			
		||||
 | 
			
		||||
Martin
 | 
			
		||||
 | 
			
		||||
--------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
NOTE:  LibGTop is already feature-freezed for GNOME 1.0, so only bug fixes
 | 
			
		||||
       are ok, no API changes !
 | 
			
		||||
 | 
			
		||||
Sysdeps directory 'linux':
 | 
			
		||||
==========================
 | 
			
		||||
 | 
			
		||||
* Add implementation `netload' and `ppp' with modems.
 | 
			
		||||
 | 
			
		||||
* Add implementation for `proc_args'.
 | 
			
		||||
 | 
			
		||||
Sysdeps directory 'freebsd':
 | 
			
		||||
============================
 | 
			
		||||
 | 
			
		||||
* FreeBSD 3.0: It works fine on this system, so please make sure not
 | 
			
		||||
               to break it here.
 | 
			
		||||
 | 
			
		||||
* FreeBSD 2.2: Make sure it still works here.
 | 
			
		||||
 | 
			
		||||
* NetBSD/OpenBSD: Support was added on Dec 6, but we need to check
 | 
			
		||||
                  whether all data are valid.
 | 
			
		||||
 | 
			
		||||
Sysdeps directories 'kernel', 'osf1' and 'sun4':
 | 
			
		||||
================================================
 | 
			
		||||
 | 
			
		||||
* You need to use the `--enable-hacker-mode' parameter to configure
 | 
			
		||||
  to build this directories.
 | 
			
		||||
 | 
			
		||||
--------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
Everything except sysdeps directories:
 | 
			
		||||
======================================
 | 
			
		||||
 | 
			
		||||
* Ready for Gnome 1.0. [ALREADY FEATURE FREEZED]
 | 
			
		||||
 | 
			
		||||
December 15, 1998
 | 
			
		||||
 | 
			
		||||
Martin
 | 
			
		||||
							
								
								
									
										38
									
								
								acconfig.h
									
									
									
									
									
								
							
							
						
						
									
										38
									
								
								acconfig.h
									
									
									
									
									
								
							@@ -1,3 +1,18 @@
 | 
			
		||||
 | 
			
		||||
/* Define if gethostname () must be declared. */
 | 
			
		||||
#undef NEED_DECLARATION_GETHOSTNAME
 | 
			
		||||
 | 
			
		||||
/* Define if setreuid () must be declared. */
 | 
			
		||||
#undef NEED_DECLARATION_SETREUID
 | 
			
		||||
 | 
			
		||||
/* Define if setregid () must be declared. */
 | 
			
		||||
#undef NEED_DECLARATION_SETREGID
 | 
			
		||||
 | 
			
		||||
/* Define if getpagesize () must be declared. */
 | 
			
		||||
#undef NEED_DECLARATION_GETPAGESIZE
 | 
			
		||||
 | 
			
		||||
@TOP@
 | 
			
		||||
 | 
			
		||||
#undef ENABLE_NLS
 | 
			
		||||
#undef HAVE_CATGETS
 | 
			
		||||
#undef HAVE_GETTEXT
 | 
			
		||||
@@ -95,24 +110,45 @@
 | 
			
		||||
/* to fix a bug in autoheader on DEC OSF1. */
 | 
			
		||||
#undef HAVE_PROGRAM_INVOCATION_NAME
 | 
			
		||||
 | 
			
		||||
#undef HAVE_SOCKETS
 | 
			
		||||
#undef HAVE_SOCKADDR_SUN_LEN
 | 
			
		||||
 | 
			
		||||
#undef HAVE_LIBJPEG
 | 
			
		||||
#undef HAVE_LIBGIF
 | 
			
		||||
#undef HAVE_LIBTIFF
 | 
			
		||||
#undef HAVE_LIBZ
 | 
			
		||||
#undef HAVE_LIBPNG
 | 
			
		||||
#undef GNOME_ENABLE_DEBUG
 | 
			
		||||
#undef HAVE_GMP2_INCLUDE_DIR
 | 
			
		||||
#undef HAVE_GUILE
 | 
			
		||||
 | 
			
		||||
#undef ssize_t
 | 
			
		||||
#undef u_int64_t
 | 
			
		||||
#undef int64_t
 | 
			
		||||
 | 
			
		||||
#undef HAVE_GLIBTOP_MACHINE_H
 | 
			
		||||
 | 
			
		||||
#undef GLIBTOP_NAMES
 | 
			
		||||
#undef GLIBTOP_GUILE
 | 
			
		||||
#undef GLIBTOP_GUILE_NAMES
 | 
			
		||||
#undef GLIBTOP_EXAMPLES
 | 
			
		||||
#undef GLIBTOP_INODEDB
 | 
			
		||||
 | 
			
		||||
#undef NEED_LIBGTOP
 | 
			
		||||
 | 
			
		||||
#undef HAVE_LINUX_TABLE
 | 
			
		||||
#undef HAVE_LIBGTOP_SMP
 | 
			
		||||
 | 
			
		||||
#undef HAVE_XAUTH
 | 
			
		||||
 | 
			
		||||
/* Define if your have the I4B package. */
 | 
			
		||||
#undef HAVE_I4B
 | 
			
		||||
#undef HAVE_I4B_ACCT
 | 
			
		||||
 | 
			
		||||
/* Define to enable debugging. */
 | 
			
		||||
#undef LIBGTOP_ENABLE_DEBUG
 | 
			
		||||
#undef LIBGTOP_FATAL_WARNINGS
 | 
			
		||||
 | 
			
		||||
/* Same as LINUX_VERSION_CODE either from <linux/version.h> or from
 | 
			
		||||
 * the running kernel (if we don't have configured kernel sources).
 | 
			
		||||
 */
 | 
			
		||||
#undef GLIBTOP_LINUX_VERSION_CODE
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										491
									
								
								acinclude.m4
									
									
									
									
									
								
							
							
						
						
									
										491
									
								
								acinclude.m4
									
									
									
									
									
								
							@@ -1,491 +0,0 @@
 | 
			
		||||
dnl aclocal.m4 generated automatically by aclocal 1.2h
 | 
			
		||||
 | 
			
		||||
dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
 | 
			
		||||
dnl This Makefile.in is free software; the Free Software Foundation
 | 
			
		||||
dnl gives unlimited permission to copy and/or distribute it,
 | 
			
		||||
dnl with or without modifications, as long as this notice is preserved.
 | 
			
		||||
 | 
			
		||||
dnl This program is distributed in the hope that it will be useful,
 | 
			
		||||
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
 | 
			
		||||
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 | 
			
		||||
dnl PARTICULAR PURPOSE.
 | 
			
		||||
 | 
			
		||||
AC_DEFUN([AC_LC_CANONICAL_HOST],[
 | 
			
		||||
	AC_REQUIRE([AC_CANONICAL_HOST])
 | 
			
		||||
	# The way shlib-versions is used to generate soversions.mk uses a
 | 
			
		||||
	# fairly simplistic model for name recognition that can't distinguish
 | 
			
		||||
	# i486-pc-linux-gnu fully from i486-pc-gnu.  So we mutate a $host_os
 | 
			
		||||
	# of `gnu*' here to be `gnu-gnu*' just so that shlib-versions can
 | 
			
		||||
	# tell.  This doesn't get used much beyond that, so it's fairly safe.
 | 
			
		||||
	case "$host_os" in
 | 
			
		||||
	linux*)
 | 
			
		||||
	  ;;
 | 
			
		||||
	gnu*)
 | 
			
		||||
	  host_os=`echo $host_os | sed -e 's/gnu/gnu-gnu/'`
 | 
			
		||||
	  ;;
 | 
			
		||||
	esac
 | 
			
		||||
])
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
AC_DEFUN([AC_LC_SYSDEPS],[
 | 
			
		||||
	AC_REQUIRE([AC_LC_CANONICAL_HOST])
 | 
			
		||||
	AC_REQUIRE([GNOME_LIBGTOP_SYSDEPS])
 | 
			
		||||
 | 
			
		||||
	AC_MSG_CHECKING(whether we need the gtop_server)
 | 
			
		||||
	
 | 
			
		||||
	AC_ARG_ENABLE(libgtop-server,
 | 
			
		||||
	[  --enable-libgtop-server use gtop_server [default=auto]],
 | 
			
		||||
	[if test "x$enableval" = "xyes" ; then
 | 
			
		||||
	  libgtop_need_server=yes
 | 
			
		||||
	 elif test "x$enableval" = "xno" ; then
 | 
			
		||||
	  libgtop_need_server=no
 | 
			
		||||
	 fi])
 | 
			
		||||
 | 
			
		||||
	AC_MSG_RESULT($libgtop_need_server)
 | 
			
		||||
 | 
			
		||||
	AC_MSG_CHECKING(whether building of libgtop names is requested)
 | 
			
		||||
 | 
			
		||||
	AC_ARG_ENABLE(libgtop-names,
 | 
			
		||||
	[  --enable-libgtop-names  enable building of 'names' subdirs [default=yes]],
 | 
			
		||||
	[if test "x$enableval" = "xyes" ; then
 | 
			
		||||
	  libgtop_want_names=yes
 | 
			
		||||
	 else
 | 
			
		||||
	  libgtop_want_names=$enableval
 | 
			
		||||
	 fi],[libgtop_want_names=yes])
 | 
			
		||||
 | 
			
		||||
	AC_MSG_RESULT($libgtop_want_names)
 | 
			
		||||
 | 
			
		||||
	if test x$libgtop_want_names = xyes ; then
 | 
			
		||||
	  AC_DEFINE(GLIBTOP_NAMES)
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
	AM_CONDITIONAL(GLIBTOP_NAMES, test x$libgtop_want_names = xyes)
 | 
			
		||||
 | 
			
		||||
	AC_MSG_CHECKING(whether building of the guile interface is requested)
 | 
			
		||||
 | 
			
		||||
	AC_ARG_ENABLE(libgtop-guile,
 | 
			
		||||
	[  --enable-libgtop-guile  enable building of the guile interface [default=yes]],
 | 
			
		||||
	[if test "x$enableval" = "xyes" ; then
 | 
			
		||||
	  libgtop_want_guile=yes
 | 
			
		||||
	 else
 | 
			
		||||
	  libgtop_want_guile=$enableval
 | 
			
		||||
	 fi],[libgtop_want_guile=yes])
 | 
			
		||||
 | 
			
		||||
	AC_MSG_RESULT($libgtop_want_guile)
 | 
			
		||||
 | 
			
		||||
	AC_MSG_CHECKING(whether building of the examples is requested)
 | 
			
		||||
 | 
			
		||||
	AC_ARG_ENABLE(libgtop-examples,
 | 
			
		||||
	[  --disable-libgtop-examples disable building of the examples],
 | 
			
		||||
	[if test "x$enableval" = "xyes" ; then
 | 
			
		||||
	  libgtop_want_examples=yes
 | 
			
		||||
	 else
 | 
			
		||||
	  libgtop_want_examples=$enableval
 | 
			
		||||
	 fi],[libgtop_want_examples=yes])
 | 
			
		||||
 | 
			
		||||
	AC_MSG_RESULT($libgtop_want_examples)
 | 
			
		||||
 | 
			
		||||
	if test x$libgtop_want_examples = xyes ; then
 | 
			
		||||
	  AC_DEFINE(GLIBTOP_EXAMPLES)
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
	AM_CONDITIONAL(GLIBTOP_EXAMPLES, test x$libgtop_want_examples = xyes)
 | 
			
		||||
 | 
			
		||||
	if test x$libgtop_use_machine_h = xyes ; then
 | 
			
		||||
	  machine_incs="-I\$(top_srcdir)/sysdeps/$sysdeps_dir"
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
	AC_SUBST(machine_incs)
 | 
			
		||||
	AC_SUBST(libgtop_want_names)
 | 
			
		||||
	AC_SUBST(libgtop_want_guile)
 | 
			
		||||
	AC_SUBST(libgtop_want_examples)
 | 
			
		||||
])
 | 
			
		||||
 | 
			
		||||
######################################################################
 | 
			
		||||
# progtest.m4 from gettext 0.32
 | 
			
		||||
######################################################################
 | 
			
		||||
# Search path for a program which passes the given test.
 | 
			
		||||
# Ulrich Drepper <drepper@cygnus.com>, 1996.
 | 
			
		||||
#
 | 
			
		||||
# This file file be copied and used freely without restrictions.  It can
 | 
			
		||||
# be used in projects which are not available under the GNU Public License
 | 
			
		||||
# but which still want to provide support for the GNU gettext functionality.
 | 
			
		||||
# Please note that the actual code is *not* freely available.
 | 
			
		||||
 | 
			
		||||
# serial 1
 | 
			
		||||
 | 
			
		||||
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
 | 
			
		||||
dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
 | 
			
		||||
AC_DEFUN(AM_PATH_PROG_WITH_TEST,
 | 
			
		||||
[# Extract the first word of "$2", so it can be a program name with args.
 | 
			
		||||
set dummy $2; ac_word=[$]2
 | 
			
		||||
AC_MSG_CHECKING([for $ac_word])
 | 
			
		||||
AC_CACHE_VAL(ac_cv_path_$1,
 | 
			
		||||
[case "[$]$1" in
 | 
			
		||||
  /*)
 | 
			
		||||
  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
 | 
			
		||||
  ;;
 | 
			
		||||
  *)
 | 
			
		||||
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
 | 
			
		||||
  for ac_dir in ifelse([$5], , $PATH, [$5]); do
 | 
			
		||||
    test -z "$ac_dir" && ac_dir=.
 | 
			
		||||
    if test -f $ac_dir/$ac_word; then
 | 
			
		||||
      if [$3]; then
 | 
			
		||||
	ac_cv_path_$1="$ac_dir/$ac_word"
 | 
			
		||||
	break
 | 
			
		||||
      fi
 | 
			
		||||
    fi
 | 
			
		||||
  done
 | 
			
		||||
  IFS="$ac_save_ifs"
 | 
			
		||||
dnl If no 4th arg is given, leave the cache variable unset,
 | 
			
		||||
dnl so AC_PATH_PROGS will keep looking.
 | 
			
		||||
ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
 | 
			
		||||
])dnl
 | 
			
		||||
  ;;
 | 
			
		||||
esac])dnl
 | 
			
		||||
$1="$ac_cv_path_$1"
 | 
			
		||||
if test -n "[$]$1"; then
 | 
			
		||||
  AC_MSG_RESULT([$]$1)
 | 
			
		||||
else
 | 
			
		||||
  AC_MSG_RESULT(no)
 | 
			
		||||
fi
 | 
			
		||||
AC_SUBST($1)dnl
 | 
			
		||||
])
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
######################################################################
 | 
			
		||||
# lcmessage.m4 from gettext 0.32
 | 
			
		||||
######################################################################
 | 
			
		||||
# Check whether LC_MESSAGES is available in <locale.h>.
 | 
			
		||||
# Ulrich Drepper <drepper@cygnus.com>, 1995.
 | 
			
		||||
#
 | 
			
		||||
# This file file be copied and used freely without restrictions.  It can
 | 
			
		||||
# be used in projects which are not available under the GNU Public License
 | 
			
		||||
# but which still want to provide support for the GNU gettext functionality.
 | 
			
		||||
# Please note that the actual code is *not* freely available.
 | 
			
		||||
 | 
			
		||||
# serial 1
 | 
			
		||||
 | 
			
		||||
AC_DEFUN(AM_LC_MESSAGES,
 | 
			
		||||
  [if test $ac_cv_header_locale_h = yes; then
 | 
			
		||||
    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
 | 
			
		||||
      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
 | 
			
		||||
       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
 | 
			
		||||
    if test $am_cv_val_LC_MESSAGES = yes; then
 | 
			
		||||
      AC_DEFINE(HAVE_LC_MESSAGES)
 | 
			
		||||
    fi
 | 
			
		||||
  fi])
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
######################################################################
 | 
			
		||||
# gettext.m4 from gettext 0.32
 | 
			
		||||
######################################################################
 | 
			
		||||
# Macro to add for using GNU gettext.
 | 
			
		||||
# Ulrich Drepper <drepper@cygnus.com>, 1995.
 | 
			
		||||
#
 | 
			
		||||
# This file file be copied and used freely without restrictions.  It can
 | 
			
		||||
# be used in projects which are not available under the GNU Public License
 | 
			
		||||
# but which still want to provide support for the GNU gettext functionality.
 | 
			
		||||
# Please note that the actual code is *not* freely available.
 | 
			
		||||
 | 
			
		||||
# serial 3
 | 
			
		||||
 | 
			
		||||
AC_DEFUN(AM_WITH_NLS,
 | 
			
		||||
  [AC_MSG_CHECKING([whether NLS is requested])
 | 
			
		||||
    dnl Default is enabled NLS
 | 
			
		||||
    AC_ARG_ENABLE(nls,
 | 
			
		||||
      [  --disable-nls           do not use Native Language Support],
 | 
			
		||||
      USE_NLS=$enableval, USE_NLS=yes)
 | 
			
		||||
    AC_MSG_RESULT($USE_NLS)
 | 
			
		||||
    AC_SUBST(USE_NLS)
 | 
			
		||||
 | 
			
		||||
    USE_INCLUDED_LIBINTL=no
 | 
			
		||||
 | 
			
		||||
    dnl If we use NLS figure out what method
 | 
			
		||||
    if test "$USE_NLS" = "yes"; then
 | 
			
		||||
      AC_DEFINE(ENABLE_NLS)
 | 
			
		||||
      AC_MSG_CHECKING([whether included gettext is requested])
 | 
			
		||||
      AC_ARG_WITH(included-gettext,
 | 
			
		||||
        [  --with-included-gettext use the GNU gettext library included here],
 | 
			
		||||
        nls_cv_force_use_gnu_gettext=$withval,
 | 
			
		||||
        nls_cv_force_use_gnu_gettext=no)
 | 
			
		||||
      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
 | 
			
		||||
 | 
			
		||||
      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
 | 
			
		||||
      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
 | 
			
		||||
        dnl User does not insist on using GNU NLS library.  Figure out what
 | 
			
		||||
        dnl to use.  If gettext or catgets are available (in this order) we
 | 
			
		||||
        dnl use this.  Else we have to fall back to GNU NLS library.
 | 
			
		||||
	dnl catgets is only used if permitted by option --with-catgets.
 | 
			
		||||
	nls_cv_header_intl=
 | 
			
		||||
	nls_cv_header_libgt=
 | 
			
		||||
	CATOBJEXT=NONE
 | 
			
		||||
 | 
			
		||||
	AC_CHECK_HEADER(libintl.h,
 | 
			
		||||
	  [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
 | 
			
		||||
	    [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
 | 
			
		||||
	       gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
 | 
			
		||||
 | 
			
		||||
	   if test "$gt_cv_func_gettext_libc" != "yes"; then
 | 
			
		||||
	     AC_CHECK_LIB(intl, bindtextdomain,
 | 
			
		||||
	       [AC_CACHE_CHECK([for gettext in libintl],
 | 
			
		||||
		 gt_cv_func_gettext_libintl,
 | 
			
		||||
		 [AC_TRY_LINK([], [return (int) gettext ("")],
 | 
			
		||||
		 gt_cv_func_gettext_libintl=yes,
 | 
			
		||||
		 gt_cv_func_gettext_libintl=no)])])
 | 
			
		||||
	   fi
 | 
			
		||||
 | 
			
		||||
	   if test "$gt_cv_func_gettext_libc" = "yes" \
 | 
			
		||||
	      || test "$gt_cv_func_gettext_libintl" = "yes"; then
 | 
			
		||||
	      AC_DEFINE(HAVE_GETTEXT)
 | 
			
		||||
	      AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
 | 
			
		||||
		[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
 | 
			
		||||
	      if test "$MSGFMT" != "no"; then
 | 
			
		||||
		AC_CHECK_FUNCS(dcgettext)
 | 
			
		||||
		AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
 | 
			
		||||
		AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
 | 
			
		||||
		  [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
 | 
			
		||||
		AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
 | 
			
		||||
			       return _nl_msg_cat_cntr],
 | 
			
		||||
		  [CATOBJEXT=.gmo
 | 
			
		||||
		   DATADIRNAME=share],
 | 
			
		||||
		  [CATOBJEXT=.mo
 | 
			
		||||
		   DATADIRNAME=lib])
 | 
			
		||||
		INSTOBJEXT=.mo
 | 
			
		||||
	      fi
 | 
			
		||||
	    fi
 | 
			
		||||
	])
 | 
			
		||||
 | 
			
		||||
        if test "$CATOBJEXT" = "NONE"; then
 | 
			
		||||
	  AC_MSG_CHECKING([whether catgets can be used])
 | 
			
		||||
	  AC_ARG_WITH(catgets,
 | 
			
		||||
	    [  --with-catgets          use catgets functions if available],
 | 
			
		||||
	    nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
 | 
			
		||||
	  AC_MSG_RESULT($nls_cv_use_catgets)
 | 
			
		||||
 | 
			
		||||
	  if test "$nls_cv_use_catgets" = "yes"; then
 | 
			
		||||
	    dnl No gettext in C library.  Try catgets next.
 | 
			
		||||
	    AC_CHECK_LIB(i, main)
 | 
			
		||||
	    AC_CHECK_FUNC(catgets,
 | 
			
		||||
	      [AC_DEFINE(HAVE_CATGETS)
 | 
			
		||||
	       INTLOBJS="\$(CATOBJS)"
 | 
			
		||||
	       AC_PATH_PROG(GENCAT, gencat, no)dnl
 | 
			
		||||
	       if test "$GENCAT" != "no"; then
 | 
			
		||||
		 AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
 | 
			
		||||
		 if test "$GMSGFMT" = "no"; then
 | 
			
		||||
		   AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
 | 
			
		||||
		    [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
 | 
			
		||||
		 fi
 | 
			
		||||
		 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
 | 
			
		||||
		   [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
 | 
			
		||||
		 USE_INCLUDED_LIBINTL=yes
 | 
			
		||||
		 CATOBJEXT=.cat
 | 
			
		||||
		 INSTOBJEXT=.cat
 | 
			
		||||
		 DATADIRNAME=lib
 | 
			
		||||
		 INTLDEPS='$(top_builddir)/intl/libintl.a'
 | 
			
		||||
		 INTLLIBS=$INTLDEPS
 | 
			
		||||
		 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
 | 
			
		||||
		 nls_cv_header_intl=intl/libintl.h
 | 
			
		||||
		 nls_cv_header_libgt=intl/libgettext.h
 | 
			
		||||
	       fi])
 | 
			
		||||
	  fi
 | 
			
		||||
        fi
 | 
			
		||||
 | 
			
		||||
        if test "$CATOBJEXT" = "NONE"; then
 | 
			
		||||
	  dnl Neither gettext nor catgets in included in the C library.
 | 
			
		||||
	  dnl Fall back on GNU gettext library.
 | 
			
		||||
	  nls_cv_use_gnu_gettext=yes
 | 
			
		||||
        fi
 | 
			
		||||
      fi
 | 
			
		||||
 | 
			
		||||
      if test "$nls_cv_use_gnu_gettext" = "yes"; then
 | 
			
		||||
        dnl Mark actions used to generate GNU NLS library.
 | 
			
		||||
        INTLOBJS="\$(GETTOBJS)"
 | 
			
		||||
        AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
 | 
			
		||||
	  [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
 | 
			
		||||
        AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
 | 
			
		||||
        AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
 | 
			
		||||
	  [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
 | 
			
		||||
        AC_SUBST(MSGFMT)
 | 
			
		||||
	USE_INCLUDED_LIBINTL=yes
 | 
			
		||||
        CATOBJEXT=.gmo
 | 
			
		||||
        INSTOBJEXT=.mo
 | 
			
		||||
        DATADIRNAME=share
 | 
			
		||||
	INTLDEPS='$(top_builddir)/intl/libintl.a'
 | 
			
		||||
	INTLLIBS=$INTLDEPS
 | 
			
		||||
	LIBS=`echo $LIBS | sed -e 's/-lintl//'`
 | 
			
		||||
        nls_cv_header_intl=intl/libintl.h
 | 
			
		||||
        nls_cv_header_libgt=intl/libgettext.h
 | 
			
		||||
      fi
 | 
			
		||||
 | 
			
		||||
      dnl Test whether we really found GNU xgettext.
 | 
			
		||||
      if test "$XGETTEXT" != ":"; then
 | 
			
		||||
	dnl If it is no GNU xgettext we define it as : so that the
 | 
			
		||||
	dnl Makefiles still can work.
 | 
			
		||||
	if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
 | 
			
		||||
	  : ;
 | 
			
		||||
	else
 | 
			
		||||
	  AC_MSG_RESULT(
 | 
			
		||||
	    [found xgettext programs is not GNU xgettext; ignore it])
 | 
			
		||||
	  XGETTEXT=":"
 | 
			
		||||
	fi
 | 
			
		||||
      fi
 | 
			
		||||
 | 
			
		||||
      # We need to process the po/ directory.
 | 
			
		||||
      POSUB=po
 | 
			
		||||
    else
 | 
			
		||||
      DATADIRNAME=share
 | 
			
		||||
      nls_cv_header_intl=intl/libintl.h
 | 
			
		||||
      nls_cv_header_libgt=intl/libgettext.h
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
    # If this is used in GNU gettext we have to set USE_NLS to `yes'
 | 
			
		||||
    # because some of the sources are only built for this goal.
 | 
			
		||||
    if test "$PACKAGE" = gettext; then
 | 
			
		||||
      USE_NLS=yes
 | 
			
		||||
      USE_INCLUDED_LIBINTL=yes
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
    dnl These rules are solely for the distribution goal.  While doing this
 | 
			
		||||
    dnl we only have to keep exactly one list of the available catalogs
 | 
			
		||||
    dnl in configure.in.
 | 
			
		||||
    for lang in $ALL_LINGUAS; do
 | 
			
		||||
      GMOFILES="$GMOFILES $lang.gmo"
 | 
			
		||||
      POFILES="$POFILES $lang.po"
 | 
			
		||||
    done
 | 
			
		||||
 | 
			
		||||
    dnl Make all variables we use known to autoconf.
 | 
			
		||||
    AC_SUBST(USE_INCLUDED_LIBINTL)
 | 
			
		||||
    AC_SUBST(CATALOGS)
 | 
			
		||||
    AC_SUBST(CATOBJEXT)
 | 
			
		||||
    AC_SUBST(DATADIRNAME)
 | 
			
		||||
    AC_SUBST(GMOFILES)
 | 
			
		||||
    AC_SUBST(INSTOBJEXT)
 | 
			
		||||
    AC_SUBST(INTLDEPS)
 | 
			
		||||
    AC_SUBST(INTLLIBS)
 | 
			
		||||
    AC_SUBST(INTLOBJS)
 | 
			
		||||
    AC_SUBST(POFILES)
 | 
			
		||||
    AC_SUBST(POSUB)
 | 
			
		||||
  ])
 | 
			
		||||
 | 
			
		||||
AC_DEFUN(AM_GNU_GETTEXT,
 | 
			
		||||
  [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
 | 
			
		||||
   AC_REQUIRE([AC_PROG_CC])dnl
 | 
			
		||||
   AC_REQUIRE([AC_PROG_RANLIB])dnl
 | 
			
		||||
   AC_REQUIRE([AC_ISC_POSIX])dnl
 | 
			
		||||
   AC_REQUIRE([AC_HEADER_STDC])dnl
 | 
			
		||||
   AC_REQUIRE([AC_C_CONST])dnl
 | 
			
		||||
   AC_REQUIRE([AC_C_INLINE])dnl
 | 
			
		||||
   AC_REQUIRE([AC_TYPE_OFF_T])dnl
 | 
			
		||||
   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
 | 
			
		||||
   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
 | 
			
		||||
   AC_REQUIRE([AC_FUNC_MMAP])dnl
 | 
			
		||||
 | 
			
		||||
   AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
 | 
			
		||||
unistd.h values.h sys/param.h])
 | 
			
		||||
   AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
 | 
			
		||||
__argz_count __argz_stringify __argz_next])
 | 
			
		||||
 | 
			
		||||
   if test "${ac_cv_func_stpcpy+set}" != "set"; then
 | 
			
		||||
     AC_CHECK_FUNCS(stpcpy)
 | 
			
		||||
   fi
 | 
			
		||||
   if test "${ac_cv_func_stpcpy}" = "yes"; then
 | 
			
		||||
     AC_DEFINE(HAVE_STPCPY)
 | 
			
		||||
   fi
 | 
			
		||||
 | 
			
		||||
   AM_LC_MESSAGES
 | 
			
		||||
   AM_WITH_NLS
 | 
			
		||||
 | 
			
		||||
   if test "x$CATOBJEXT" != "x"; then
 | 
			
		||||
     if test "x$ALL_LINGUAS" = "x"; then
 | 
			
		||||
       LINGUAS=
 | 
			
		||||
     else
 | 
			
		||||
       AC_MSG_CHECKING(for catalogs to be installed)
 | 
			
		||||
       NEW_LINGUAS=
 | 
			
		||||
       for lang in ${LINGUAS=$ALL_LINGUAS}; do
 | 
			
		||||
         case "$ALL_LINGUAS" in
 | 
			
		||||
          *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
 | 
			
		||||
         esac
 | 
			
		||||
       done
 | 
			
		||||
       LINGUAS=$NEW_LINGUAS
 | 
			
		||||
       AC_MSG_RESULT($LINGUAS)
 | 
			
		||||
     fi
 | 
			
		||||
 | 
			
		||||
     dnl Construct list of names of catalog files to be constructed.
 | 
			
		||||
     if test -n "$LINGUAS"; then
 | 
			
		||||
       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
 | 
			
		||||
     fi
 | 
			
		||||
   fi
 | 
			
		||||
 | 
			
		||||
   dnl The reference to <locale.h> in the installed <libintl.h> file
 | 
			
		||||
   dnl must be resolved because we cannot expect the users of this
 | 
			
		||||
   dnl to define HAVE_LOCALE_H.
 | 
			
		||||
   if test $ac_cv_header_locale_h = yes; then
 | 
			
		||||
     INCLUDE_LOCALE_H="#include <locale.h>"
 | 
			
		||||
   else
 | 
			
		||||
     INCLUDE_LOCALE_H="\
 | 
			
		||||
/* The system does not provide the header <locale.h>.  Take care yourself.  */"
 | 
			
		||||
   fi
 | 
			
		||||
   AC_SUBST(INCLUDE_LOCALE_H)
 | 
			
		||||
 | 
			
		||||
   dnl Determine which catalog format we have (if any is needed)
 | 
			
		||||
   dnl For now we know about two different formats:
 | 
			
		||||
   dnl   Linux libc-5 and the normal X/Open format
 | 
			
		||||
   test -d intl || mkdir intl
 | 
			
		||||
   if test "$CATOBJEXT" = ".cat"; then
 | 
			
		||||
     AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
 | 
			
		||||
 | 
			
		||||
     dnl Transform the SED scripts while copying because some dumb SEDs
 | 
			
		||||
     dnl cannot handle comments.
 | 
			
		||||
     sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
 | 
			
		||||
   fi
 | 
			
		||||
   dnl po2tbl.sed is always needed.
 | 
			
		||||
   sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
 | 
			
		||||
     $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
 | 
			
		||||
 | 
			
		||||
   dnl In the intl/Makefile.in we have a special dependency which makes
 | 
			
		||||
   dnl only sense for gettext.  We comment this out for non-gettext
 | 
			
		||||
   dnl packages.
 | 
			
		||||
   if test "$PACKAGE" = "gettext"; then
 | 
			
		||||
     GT_NO="#NO#"
 | 
			
		||||
     GT_YES=
 | 
			
		||||
   else
 | 
			
		||||
     GT_NO=
 | 
			
		||||
     GT_YES="#YES#"
 | 
			
		||||
   fi
 | 
			
		||||
   AC_SUBST(GT_NO)
 | 
			
		||||
   AC_SUBST(GT_YES)
 | 
			
		||||
 | 
			
		||||
   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
 | 
			
		||||
   dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
 | 
			
		||||
   dnl Try to locate is.
 | 
			
		||||
   MKINSTALLDIRS=
 | 
			
		||||
   if test -n "$ac_aux_dir"; then
 | 
			
		||||
     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
 | 
			
		||||
   fi
 | 
			
		||||
   if test -z "$MKINSTALLDIRS"; then
 | 
			
		||||
     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
 | 
			
		||||
   fi
 | 
			
		||||
   AC_SUBST(MKINSTALLDIRS)
 | 
			
		||||
 | 
			
		||||
   dnl *** For now the libtool support in intl/Makefile is not for real.
 | 
			
		||||
   l=
 | 
			
		||||
   AC_SUBST(l)
 | 
			
		||||
 | 
			
		||||
   dnl Generate list of files to be processed by xgettext which will
 | 
			
		||||
   dnl be included in po/Makefile.
 | 
			
		||||
   test -d po || mkdir po
 | 
			
		||||
   if test "x$srcdir" != "x."; then
 | 
			
		||||
     if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
 | 
			
		||||
       posrcprefix="$srcdir/"
 | 
			
		||||
     else
 | 
			
		||||
       posrcprefix="../$srcdir/"
 | 
			
		||||
     fi
 | 
			
		||||
   else
 | 
			
		||||
     posrcprefix="../"
 | 
			
		||||
   fi
 | 
			
		||||
   rm -f po/POTFILES
 | 
			
		||||
   sed -e "/^#/d" -e "/^\$/d" -e "s,.*,	$posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
 | 
			
		||||
	< $srcdir/po/POTFILES.in > po/POTFILES
 | 
			
		||||
  ])
 | 
			
		||||
							
								
								
									
										883
									
								
								config.guess
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										883
									
								
								config.guess
									
									
									
									
										vendored
									
									
								
							@@ -1,883 +0,0 @@
 | 
			
		||||
#! /bin/sh
 | 
			
		||||
# Attempt to guess a canonical system name.
 | 
			
		||||
#   Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
 | 
			
		||||
#
 | 
			
		||||
# This file is free software; you can redistribute it and/or modify it
 | 
			
		||||
# under the terms of the GNU General Public License as published by
 | 
			
		||||
# the Free Software Foundation; either version 2 of the License, or
 | 
			
		||||
# (at your option) any later version.
 | 
			
		||||
#
 | 
			
		||||
# This program is distributed in the hope that it will be useful, but
 | 
			
		||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
# General Public License for more details.
 | 
			
		||||
#
 | 
			
		||||
# You should have received a copy of the GNU General Public License
 | 
			
		||||
# along with this program; if not, write to the Free Software
 | 
			
		||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 | 
			
		||||
#
 | 
			
		||||
# As a special exception to the GNU General Public License, if you
 | 
			
		||||
# distribute this file as part of a program that contains a
 | 
			
		||||
# configuration script generated by Autoconf, you may include it under
 | 
			
		||||
# the same distribution terms that you use for the rest of that program.
 | 
			
		||||
 | 
			
		||||
# Written by Per Bothner <bothner@cygnus.com>.
 | 
			
		||||
# The master version of this file is at the FSF in /home/gd/gnu/lib.
 | 
			
		||||
#
 | 
			
		||||
# This script attempts to guess a canonical system name similar to
 | 
			
		||||
# config.sub.  If it succeeds, it prints the system name on stdout, and
 | 
			
		||||
# exits with 0.  Otherwise, it exits with 1.
 | 
			
		||||
#
 | 
			
		||||
# The plan is that this can be called by configure scripts if you
 | 
			
		||||
# don't specify an explicit system type (host/target name).
 | 
			
		||||
#
 | 
			
		||||
# Only a few systems have been added to this list; please add others
 | 
			
		||||
# (but try to keep the structure clean).
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
 | 
			
		||||
# (ghazi@noc.rutgers.edu 8/24/94.)
 | 
			
		||||
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
 | 
			
		||||
	PATH=$PATH:/.attbin ; export PATH
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
 | 
			
		||||
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
 | 
			
		||||
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
 | 
			
		||||
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 | 
			
		||||
 | 
			
		||||
trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
 | 
			
		||||
 | 
			
		||||
# Note: order is significant - the case branches are not exclusive.
 | 
			
		||||
 | 
			
		||||
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 | 
			
		||||
    alpha:OSF1:*:*)
 | 
			
		||||
	if test $UNAME_RELEASE = "V4.0"; then
 | 
			
		||||
		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
 | 
			
		||||
	fi
 | 
			
		||||
	# A Vn.n version is a released version.
 | 
			
		||||
	# A Tn.n version is a released field test version.
 | 
			
		||||
	# A Xn.n version is an unreleased experimental baselevel.
 | 
			
		||||
	# 1.2 uses "1.2" for uname -r.
 | 
			
		||||
	cat <<EOF >dummy.s
 | 
			
		||||
	.globl main
 | 
			
		||||
	.ent main
 | 
			
		||||
main:
 | 
			
		||||
	.frame \$30,0,\$26,0
 | 
			
		||||
	.prologue 0
 | 
			
		||||
	.long 0x47e03d80 # implver $0
 | 
			
		||||
	lda \$2,259
 | 
			
		||||
	.long 0x47e20c21 # amask $2,$1
 | 
			
		||||
	srl \$1,8,\$2
 | 
			
		||||
	sll \$2,2,\$2
 | 
			
		||||
	sll \$0,3,\$0
 | 
			
		||||
	addl \$1,\$0,\$0
 | 
			
		||||
	addl \$2,\$0,\$0
 | 
			
		||||
	ret \$31,(\$26),1
 | 
			
		||||
	.end main
 | 
			
		||||
EOF
 | 
			
		||||
	${CC-cc} dummy.s -o dummy 2>/dev/null
 | 
			
		||||
	if test "$?" = 0 ; then
 | 
			
		||||
		./dummy
 | 
			
		||||
		case "$?" in
 | 
			
		||||
			7)
 | 
			
		||||
				UNAME_MACHINE="alpha"
 | 
			
		||||
				;;
 | 
			
		||||
			15)
 | 
			
		||||
				UNAME_MACHINE="alphaev5"
 | 
			
		||||
				;;
 | 
			
		||||
			14)
 | 
			
		||||
				UNAME_MACHINE="alphaev56"
 | 
			
		||||
				;;
 | 
			
		||||
			10)
 | 
			
		||||
				UNAME_MACHINE="alphapca56"
 | 
			
		||||
				;;
 | 
			
		||||
			16)
 | 
			
		||||
				UNAME_MACHINE="alphaev6"
 | 
			
		||||
				;;
 | 
			
		||||
		esac
 | 
			
		||||
	fi
 | 
			
		||||
	rm -f dummy.s dummy
 | 
			
		||||
	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    21064:Windows_NT:50:3)
 | 
			
		||||
	echo alpha-dec-winnt3.5
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    Amiga*:UNIX_System_V:4.0:*)
 | 
			
		||||
	echo m68k-cbm-sysv4
 | 
			
		||||
	exit 0;;
 | 
			
		||||
    amiga:NetBSD:*:*)
 | 
			
		||||
      echo m68k-cbm-netbsd${UNAME_RELEASE}
 | 
			
		||||
      exit 0 ;;
 | 
			
		||||
    amiga:OpenBSD:*:*)
 | 
			
		||||
	echo m68k-unknown-openbsd${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    arc64:OpenBSD:*:*)
 | 
			
		||||
	echo mips64el-unknown-openbsd${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    arc:OpenBSD:*:*)
 | 
			
		||||
	echo mipsel-unknown-openbsd${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    hkmips:OpenBSD:*:*)
 | 
			
		||||
	echo mips-unknown-openbsd${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    pmax:OpenBSD:*:*)
 | 
			
		||||
	echo mipsel-unknown-openbsd${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    sgi:OpenBSD:*:*)
 | 
			
		||||
	echo mips-unknown-openbsd${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    wgrisc:OpenBSD:*:*)
 | 
			
		||||
	echo mipsel-unknown-openbsd${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
 | 
			
		||||
	echo arm-acorn-riscix${UNAME_RELEASE}
 | 
			
		||||
	exit 0;;
 | 
			
		||||
    arm32:NetBSD:*:*)
 | 
			
		||||
	echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    SR2?01:HI-UX/MPP:*:*)
 | 
			
		||||
	echo hppa1.1-hitachi-hiuxmpp
 | 
			
		||||
	exit 0;;
 | 
			
		||||
    Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)
 | 
			
		||||
	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
 | 
			
		||||
	if test "`(/bin/universe) 2>/dev/null`" = att ; then
 | 
			
		||||
		echo pyramid-pyramid-sysv3
 | 
			
		||||
	else
 | 
			
		||||
		echo pyramid-pyramid-bsd
 | 
			
		||||
	fi
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    NILE:*:*:dcosx)
 | 
			
		||||
	echo pyramid-pyramid-svr4
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
 | 
			
		||||
	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    i86pc:SunOS:5.*:*)
 | 
			
		||||
	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    sun4*:SunOS:6*:*)
 | 
			
		||||
	# According to config.sub, this is the proper way to canonicalize
 | 
			
		||||
	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
 | 
			
		||||
	# it's likely to be more like Solaris than SunOS4.
 | 
			
		||||
	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    sun4*:SunOS:*:*)
 | 
			
		||||
	case "`/usr/bin/arch -k`" in
 | 
			
		||||
	    Series*|S4*)
 | 
			
		||||
		UNAME_RELEASE=`uname -v`
 | 
			
		||||
		;;
 | 
			
		||||
	esac
 | 
			
		||||
	# Japanese Language versions have a version number like `4.1.3-JL'.
 | 
			
		||||
	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    sun3*:SunOS:*:*)
 | 
			
		||||
	echo m68k-sun-sunos${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    sun*:*:4.2BSD:*)
 | 
			
		||||
	UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
 | 
			
		||||
	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
 | 
			
		||||
	case "`/bin/arch`" in
 | 
			
		||||
	    sun3)
 | 
			
		||||
		echo m68k-sun-sunos${UNAME_RELEASE}
 | 
			
		||||
		;;
 | 
			
		||||
	    sun4)
 | 
			
		||||
		echo sparc-sun-sunos${UNAME_RELEASE}
 | 
			
		||||
		;;
 | 
			
		||||
	esac
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    aushp:SunOS:*:*)
 | 
			
		||||
	echo sparc-auspex-sunos${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    atari*:NetBSD:*:*)
 | 
			
		||||
	echo m68k-atari-netbsd${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    atari*:OpenBSD:*:*)
 | 
			
		||||
	echo m68k-unknown-openbsd${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    sun3*:NetBSD:*:*)
 | 
			
		||||
	echo m68k-sun-netbsd${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    sun3*:OpenBSD:*:*)
 | 
			
		||||
	echo m68k-unknown-openbsd${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    mac68k:NetBSD:*:*)
 | 
			
		||||
	echo m68k-apple-netbsd${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    mac68k:OpenBSD:*:*)
 | 
			
		||||
	echo m68k-unknown-openbsd${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    mvme68k:OpenBSD:*:*)
 | 
			
		||||
	echo m68k-unknown-openbsd${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    mvme88k:OpenBSD:*:*)
 | 
			
		||||
	echo m88k-unknown-openbsd${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    powerpc:machten:*:*)
 | 
			
		||||
	echo powerpc-apple-machten${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    RISC*:Mach:*:*)
 | 
			
		||||
	echo mips-dec-mach_bsd4.3
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    RISC*:ULTRIX:*:*)
 | 
			
		||||
	echo mips-dec-ultrix${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    VAX*:ULTRIX*:*:*)
 | 
			
		||||
	echo vax-dec-ultrix${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    2020:CLIX:*:*)
 | 
			
		||||
	echo clipper-intergraph-clix${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    mips:*:*:UMIPS | mips:*:*:RISCos)
 | 
			
		||||
	sed 's/^	//' << EOF >dummy.c
 | 
			
		||||
	int main (argc, argv) int argc; char **argv; {
 | 
			
		||||
	#if defined (host_mips) && defined (MIPSEB)
 | 
			
		||||
	#if defined (SYSTYPE_SYSV)
 | 
			
		||||
	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
 | 
			
		||||
	#endif
 | 
			
		||||
	#if defined (SYSTYPE_SVR4)
 | 
			
		||||
	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
 | 
			
		||||
	#endif
 | 
			
		||||
	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
 | 
			
		||||
	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
 | 
			
		||||
	#endif
 | 
			
		||||
	#endif
 | 
			
		||||
	  exit (-1);
 | 
			
		||||
	}
 | 
			
		||||
EOF
 | 
			
		||||
	${CC-cc} dummy.c -o dummy \
 | 
			
		||||
	  && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
 | 
			
		||||
	  && rm dummy.c dummy && exit 0
 | 
			
		||||
	rm -f dummy.c dummy
 | 
			
		||||
	echo mips-mips-riscos${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    Night_Hawk:Power_UNIX:*:*)
 | 
			
		||||
	echo powerpc-harris-powerunix
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    m88k:CX/UX:7*:*)
 | 
			
		||||
	echo m88k-harris-cxux7
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    m88k:*:4*:R4*)
 | 
			
		||||
	echo m88k-motorola-sysv4
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    m88k:*:3*:R3*)
 | 
			
		||||
	echo m88k-motorola-sysv3
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    AViiON:dgux:*:*)
 | 
			
		||||
        # DG/UX returns AViiON for all architectures
 | 
			
		||||
        UNAME_PROCESSOR=`/usr/bin/uname -p`
 | 
			
		||||
        if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
 | 
			
		||||
	if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
 | 
			
		||||
	     -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
 | 
			
		||||
		echo m88k-dg-dgux${UNAME_RELEASE}
 | 
			
		||||
	else
 | 
			
		||||
		echo m88k-dg-dguxbcs${UNAME_RELEASE}
 | 
			
		||||
	fi
 | 
			
		||||
        else echo i586-dg-dgux${UNAME_RELEASE}
 | 
			
		||||
        fi
 | 
			
		||||
 	exit 0 ;;
 | 
			
		||||
    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
 | 
			
		||||
	echo m88k-dolphin-sysv3
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    M88*:*:R3*:*)
 | 
			
		||||
	# Delta 88k system running SVR3
 | 
			
		||||
	echo m88k-motorola-sysv3
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
 | 
			
		||||
	echo m88k-tektronix-sysv3
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
 | 
			
		||||
	echo m68k-tektronix-bsd
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    *:IRIX*:*:*)
 | 
			
		||||
	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
 | 
			
		||||
	echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
 | 
			
		||||
	exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
 | 
			
		||||
    i?86:AIX:*:*)
 | 
			
		||||
	echo i386-ibm-aix
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    *:AIX:2:3)
 | 
			
		||||
	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
 | 
			
		||||
		sed 's/^		//' << EOF >dummy.c
 | 
			
		||||
		#include <sys/systemcfg.h>
 | 
			
		||||
 | 
			
		||||
		main()
 | 
			
		||||
			{
 | 
			
		||||
			if (!__power_pc())
 | 
			
		||||
				exit(1);
 | 
			
		||||
			puts("powerpc-ibm-aix3.2.5");
 | 
			
		||||
			exit(0);
 | 
			
		||||
			}
 | 
			
		||||
EOF
 | 
			
		||||
		${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
 | 
			
		||||
		rm -f dummy.c dummy
 | 
			
		||||
		echo rs6000-ibm-aix3.2.5
 | 
			
		||||
	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
 | 
			
		||||
		echo rs6000-ibm-aix3.2.4
 | 
			
		||||
	else
 | 
			
		||||
		echo rs6000-ibm-aix3.2
 | 
			
		||||
	fi
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    *:AIX:*:4)
 | 
			
		||||
	if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
 | 
			
		||||
		IBM_ARCH=rs6000
 | 
			
		||||
	else
 | 
			
		||||
		IBM_ARCH=powerpc
 | 
			
		||||
	fi
 | 
			
		||||
	if [ -x /usr/bin/oslevel ] ; then
 | 
			
		||||
		IBM_REV=`/usr/bin/oslevel`
 | 
			
		||||
	else
 | 
			
		||||
		IBM_REV=4.${UNAME_RELEASE}
 | 
			
		||||
	fi
 | 
			
		||||
	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    *:AIX:*:*)
 | 
			
		||||
	echo rs6000-ibm-aix
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
 | 
			
		||||
	echo romp-ibm-bsd4.4
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC NetBSD and
 | 
			
		||||
	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
 | 
			
		||||
	exit 0 ;;                           # report: romp-ibm BSD 4.3
 | 
			
		||||
    *:BOSX:*:*)
 | 
			
		||||
	echo rs6000-bull-bosx
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    DPX/2?00:B.O.S.:*:*)
 | 
			
		||||
	echo m68k-bull-sysv3
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    9000/[34]??:4.3bsd:1.*:*)
 | 
			
		||||
	echo m68k-hp-bsd
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
 | 
			
		||||
	echo m68k-hp-bsd4.4
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    9000/[3478]??:HP-UX:*:*)
 | 
			
		||||
	case "${UNAME_MACHINE}" in
 | 
			
		||||
	    9000/31? )            HP_ARCH=m68000 ;;
 | 
			
		||||
	    9000/[34]?? )         HP_ARCH=m68k ;;
 | 
			
		||||
	    9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;;
 | 
			
		||||
	    9000/8?? )            HP_ARCH=hppa1.0 ;;
 | 
			
		||||
	esac
 | 
			
		||||
	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
 | 
			
		||||
	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    3050*:HI-UX:*:*)
 | 
			
		||||
	sed 's/^	//' << EOF >dummy.c
 | 
			
		||||
	#include <unistd.h>
 | 
			
		||||
	int
 | 
			
		||||
	main ()
 | 
			
		||||
	{
 | 
			
		||||
	  long cpu = sysconf (_SC_CPU_VERSION);
 | 
			
		||||
	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
 | 
			
		||||
	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
 | 
			
		||||
	     results, however.  */
 | 
			
		||||
	  if (CPU_IS_PA_RISC (cpu))
 | 
			
		||||
	    {
 | 
			
		||||
	      switch (cpu)
 | 
			
		||||
		{
 | 
			
		||||
		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
 | 
			
		||||
		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
 | 
			
		||||
		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
 | 
			
		||||
		  default: puts ("hppa-hitachi-hiuxwe2"); break;
 | 
			
		||||
		}
 | 
			
		||||
	    }
 | 
			
		||||
	  else if (CPU_IS_HP_MC68K (cpu))
 | 
			
		||||
	    puts ("m68k-hitachi-hiuxwe2");
 | 
			
		||||
	  else puts ("unknown-hitachi-hiuxwe2");
 | 
			
		||||
	  exit (0);
 | 
			
		||||
	}
 | 
			
		||||
EOF
 | 
			
		||||
	${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
 | 
			
		||||
	rm -f dummy.c dummy
 | 
			
		||||
	echo unknown-hitachi-hiuxwe2
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
 | 
			
		||||
	echo hppa1.1-hp-bsd
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    9000/8??:4.3bsd:*:*)
 | 
			
		||||
	echo hppa1.0-hp-bsd
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
 | 
			
		||||
	echo hppa1.1-hp-osf
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    hp8??:OSF1:*:*)
 | 
			
		||||
	echo hppa1.0-hp-osf
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    i?86:OSF1:*:*)
 | 
			
		||||
	if [ -x /usr/sbin/sysversion ] ; then
 | 
			
		||||
	    echo ${UNAME_MACHINE}-unknown-osf1mk
 | 
			
		||||
	else
 | 
			
		||||
	    echo ${UNAME_MACHINE}-unknown-osf1
 | 
			
		||||
	fi
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    parisc*:Lites*:*:*)
 | 
			
		||||
	echo hppa1.1-hp-lites
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
 | 
			
		||||
	echo c1-convex-bsd
 | 
			
		||||
        exit 0 ;;
 | 
			
		||||
    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
 | 
			
		||||
	if getsysinfo -f scalar_acc
 | 
			
		||||
	then echo c32-convex-bsd
 | 
			
		||||
	else echo c2-convex-bsd
 | 
			
		||||
	fi
 | 
			
		||||
        exit 0 ;;
 | 
			
		||||
    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
 | 
			
		||||
	echo c34-convex-bsd
 | 
			
		||||
        exit 0 ;;
 | 
			
		||||
    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
 | 
			
		||||
	echo c38-convex-bsd
 | 
			
		||||
        exit 0 ;;
 | 
			
		||||
    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
 | 
			
		||||
	echo c4-convex-bsd
 | 
			
		||||
        exit 0 ;;
 | 
			
		||||
    CRAY*X-MP:*:*:*)
 | 
			
		||||
	echo xmp-cray-unicos
 | 
			
		||||
        exit 0 ;;
 | 
			
		||||
    CRAY*Y-MP:*:*:*)
 | 
			
		||||
	echo ymp-cray-unicos${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    CRAY*[A-Z]90:*:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
 | 
			
		||||
	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
 | 
			
		||||
	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    CRAY*TS:*:*:*)
 | 
			
		||||
	echo t90-cray-unicos${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    CRAY-2:*:*:*)
 | 
			
		||||
	echo cray2-cray-unicos
 | 
			
		||||
        exit 0 ;;
 | 
			
		||||
    F300:UNIX_System_V:*:*)
 | 
			
		||||
        FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
 | 
			
		||||
        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
 | 
			
		||||
        echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
 | 
			
		||||
        exit 0 ;;
 | 
			
		||||
    F301:UNIX_System_V:*:*)
 | 
			
		||||
       echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
 | 
			
		||||
       exit 0 ;;
 | 
			
		||||
    hp3[0-9][05]:NetBSD:*:*)
 | 
			
		||||
	echo m68k-hp-netbsd${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    hp300:OpenBSD:*:*)
 | 
			
		||||
	echo m68k-unknown-openbsd${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    i?86:BSD/386:*:* | *:BSD/OS:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    *:FreeBSD:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    *:NetBSD:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    *:OpenBSD:*:*)
 | 
			
		||||
	echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    i*:CYGWIN*:*)
 | 
			
		||||
	echo i386-pc-cygwin32
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    i*:MINGW*:*)
 | 
			
		||||
	echo i386-pc-mingw32
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    p*:CYGWIN*:*)
 | 
			
		||||
	echo powerpcle-unknown-cygwin32
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    prep*:SunOS:5.*:*)
 | 
			
		||||
	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    *:GNU:*:*)
 | 
			
		||||
	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    *:Linux:*:*)
 | 
			
		||||
	# The BFD linker knows what the default object file format is, so
 | 
			
		||||
	# first see if it will tell us.
 | 
			
		||||
	ld_help_string=`ld --help 2>&1`
 | 
			
		||||
	ld_supported_emulations=`echo $ld_help_string \
 | 
			
		||||
			 | sed -ne '/supported emulations:/!d
 | 
			
		||||
				    s/[ 	][ 	]*/ /g
 | 
			
		||||
				    s/.*supported emulations: *//
 | 
			
		||||
				    s/ .*//
 | 
			
		||||
				    p'`
 | 
			
		||||
        case "$ld_supported_emulations" in
 | 
			
		||||
	  i?86linux)  echo "${UNAME_MACHINE}-pc-linux-gnuaout"      ; exit 0 ;;
 | 
			
		||||
	  i?86coff)   echo "${UNAME_MACHINE}-pc-linux-gnucoff"      ; exit 0 ;;
 | 
			
		||||
	  sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
 | 
			
		||||
	  m68klinux)  echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
 | 
			
		||||
	  elf32ppc)   echo "powerpc-unknown-linux-gnu"              ; exit 0 ;;
 | 
			
		||||
	esac
 | 
			
		||||
 | 
			
		||||
	if test "${UNAME_MACHINE}" = "alpha" ; then
 | 
			
		||||
		sed 's/^	//'  <<EOF >dummy.s
 | 
			
		||||
		.globl main
 | 
			
		||||
		.ent main
 | 
			
		||||
	main:
 | 
			
		||||
		.frame \$30,0,\$26,0
 | 
			
		||||
		.prologue 0
 | 
			
		||||
		.long 0x47e03d80 # implver $0
 | 
			
		||||
		lda \$2,259
 | 
			
		||||
		.long 0x47e20c21 # amask $2,$1
 | 
			
		||||
		srl \$1,8,\$2
 | 
			
		||||
		sll \$2,2,\$2
 | 
			
		||||
		sll \$0,3,\$0
 | 
			
		||||
		addl \$1,\$0,\$0
 | 
			
		||||
		addl \$2,\$0,\$0
 | 
			
		||||
		ret \$31,(\$26),1
 | 
			
		||||
		.end main
 | 
			
		||||
EOF
 | 
			
		||||
		LIBC=""
 | 
			
		||||
		${CC-cc} dummy.s -o dummy 2>/dev/null
 | 
			
		||||
		if test "$?" = 0 ; then
 | 
			
		||||
			./dummy
 | 
			
		||||
			case "$?" in
 | 
			
		||||
			7)
 | 
			
		||||
				UNAME_MACHINE="alpha"
 | 
			
		||||
				;;
 | 
			
		||||
			15)
 | 
			
		||||
				UNAME_MACHINE="alphaev5"
 | 
			
		||||
				;;
 | 
			
		||||
			14)
 | 
			
		||||
				UNAME_MACHINE="alphaev56"
 | 
			
		||||
				;;
 | 
			
		||||
			10)
 | 
			
		||||
				UNAME_MACHINE="alphapca56"
 | 
			
		||||
				;;
 | 
			
		||||
			16)
 | 
			
		||||
				UNAME_MACHINE="alphaev6"
 | 
			
		||||
				;;
 | 
			
		||||
			esac	
 | 
			
		||||
 | 
			
		||||
			objdump --private-headers dummy | \
 | 
			
		||||
			  grep ld.so.1 > /dev/null
 | 
			
		||||
			if test "$?" = 0 ; then
 | 
			
		||||
				LIBC="libc1"
 | 
			
		||||
			fi
 | 
			
		||||
		fi	
 | 
			
		||||
		rm -f dummy.s dummy
 | 
			
		||||
		echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
 | 
			
		||||
	elif test "${UNAME_MACHINE}" = "mips" ; then
 | 
			
		||||
	  cat >dummy.c <<EOF
 | 
			
		||||
main(argc, argv)
 | 
			
		||||
     int argc;
 | 
			
		||||
     char *argv[];
 | 
			
		||||
{
 | 
			
		||||
#ifdef __MIPSEB__
 | 
			
		||||
  printf ("%s-unknown-linux-gnu\n", argv[1]);
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef __MIPSEL__
 | 
			
		||||
  printf ("%sel-unknown-linux-gnu\n", argv[1]);
 | 
			
		||||
#endif
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
EOF
 | 
			
		||||
	  ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
 | 
			
		||||
	  rm -f dummy.c dummy
 | 
			
		||||
	else
 | 
			
		||||
	  # Either a pre-BFD a.out linker (linux-gnuoldld)
 | 
			
		||||
	  # or one that does not give us useful --help.
 | 
			
		||||
	  # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
 | 
			
		||||
	  # If ld does not provide *any* "supported emulations:"
 | 
			
		||||
	  # that means it is gnuoldld.
 | 
			
		||||
	  echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
 | 
			
		||||
	  test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
 | 
			
		||||
 | 
			
		||||
	  case "${UNAME_MACHINE}" in
 | 
			
		||||
	  i?86)
 | 
			
		||||
	    VENDOR=pc;
 | 
			
		||||
	    ;;
 | 
			
		||||
	  *)
 | 
			
		||||
	    VENDOR=unknown;
 | 
			
		||||
	    ;;
 | 
			
		||||
	  esac
 | 
			
		||||
	  # Determine whether the default compiler is a.out or elf
 | 
			
		||||
	  cat >dummy.c <<EOF
 | 
			
		||||
#include <features.h>
 | 
			
		||||
main(argc, argv)
 | 
			
		||||
     int argc;
 | 
			
		||||
     char *argv[];
 | 
			
		||||
{
 | 
			
		||||
#ifdef __ELF__
 | 
			
		||||
# ifdef __GLIBC__
 | 
			
		||||
#  if __GLIBC__ >= 2
 | 
			
		||||
    printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
 | 
			
		||||
#  else
 | 
			
		||||
    printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
 | 
			
		||||
#  endif
 | 
			
		||||
# else
 | 
			
		||||
   printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
 | 
			
		||||
# endif
 | 
			
		||||
#else
 | 
			
		||||
  printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
 | 
			
		||||
#endif
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
EOF
 | 
			
		||||
	  ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
 | 
			
		||||
	  rm -f dummy.c dummy
 | 
			
		||||
	fi ;;
 | 
			
		||||
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
 | 
			
		||||
# are messed up and put the nodename in both sysname and nodename.
 | 
			
		||||
    i?86:DYNIX/ptx:4*:*)
 | 
			
		||||
	echo i386-sequent-sysv4
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    i?86:UNIX_SV:4.2MP:2.*)
 | 
			
		||||
        # Unixware is an offshoot of SVR4, but it has its own version
 | 
			
		||||
        # number series starting with 2...
 | 
			
		||||
        # I am not positive that other SVR4 systems won't match this,
 | 
			
		||||
	# I just have to hope.  -- rms.
 | 
			
		||||
        # Use sysv4.2uw... so that sysv4* matches it.
 | 
			
		||||
	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
 | 
			
		||||
	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
 | 
			
		||||
		echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
 | 
			
		||||
	else
 | 
			
		||||
		echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
 | 
			
		||||
	fi
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    i?86:*:3.2:*)
 | 
			
		||||
	if test -f /usr/options/cb.name; then
 | 
			
		||||
		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
 | 
			
		||||
		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
 | 
			
		||||
	elif /bin/uname -X 2>/dev/null >/dev/null ; then
 | 
			
		||||
		UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
 | 
			
		||||
		(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
 | 
			
		||||
		(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
 | 
			
		||||
			&& UNAME_MACHINE=i586
 | 
			
		||||
		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
 | 
			
		||||
	else
 | 
			
		||||
		echo ${UNAME_MACHINE}-pc-sysv32
 | 
			
		||||
	fi
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    pc:*:*:*)
 | 
			
		||||
        # uname -m prints for DJGPP always 'pc', but it prints nothing about
 | 
			
		||||
        # the processor, so we play safe by assuming i386.
 | 
			
		||||
	echo i386-pc-msdosdjgpp
 | 
			
		||||
        exit 0 ;;
 | 
			
		||||
    Intel:Mach:3*:*)
 | 
			
		||||
	echo i386-pc-mach3
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    paragon:*:*:*)
 | 
			
		||||
	echo i860-intel-osf1
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    i860:*:4.*:*) # i860-SVR4
 | 
			
		||||
	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
 | 
			
		||||
	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
 | 
			
		||||
	else # Add other i860-SVR4 vendors below as they are discovered.
 | 
			
		||||
	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
 | 
			
		||||
	fi
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    mini*:CTIX:SYS*5:*)
 | 
			
		||||
	# "miniframe"
 | 
			
		||||
	echo m68010-convergent-sysv
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    M68*:*:R3V[567]*:*)
 | 
			
		||||
	test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
 | 
			
		||||
    3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
 | 
			
		||||
	OS_REL=''
 | 
			
		||||
	test -r /etc/.relid \
 | 
			
		||||
	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
 | 
			
		||||
	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
 | 
			
		||||
	  && echo i486-ncr-sysv4.3${OS_REL} && exit 0
 | 
			
		||||
	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
 | 
			
		||||
	  && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
 | 
			
		||||
    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
 | 
			
		||||
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
 | 
			
		||||
          && echo i486-ncr-sysv4 && exit 0 ;;
 | 
			
		||||
    m68*:LynxOS:2.*:*)
 | 
			
		||||
	echo m68k-unknown-lynxos${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    mc68030:UNIX_System_V:4.*:*)
 | 
			
		||||
	echo m68k-atari-sysv4
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    i?86:LynxOS:2.*:*)
 | 
			
		||||
	echo i386-unknown-lynxos${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    TSUNAMI:LynxOS:2.*:*)
 | 
			
		||||
	echo sparc-unknown-lynxos${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
 | 
			
		||||
	echo rs6000-unknown-lynxos${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    SM[BE]S:UNIX_SV:*:*)
 | 
			
		||||
	echo mips-dde-sysv${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    RM*:SINIX-*:*:*)
 | 
			
		||||
	echo mips-sni-sysv4
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    *:SINIX-*:*:*)
 | 
			
		||||
	if uname -p 2>/dev/null >/dev/null ; then
 | 
			
		||||
		UNAME_MACHINE=`(uname -p) 2>/dev/null`
 | 
			
		||||
		echo ${UNAME_MACHINE}-sni-sysv4
 | 
			
		||||
	else
 | 
			
		||||
		echo ns32k-sni-sysv
 | 
			
		||||
	fi
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
 | 
			
		||||
                           # says <Richard.M.Bartel@ccMail.Census.GOV>
 | 
			
		||||
        echo i586-unisys-sysv4
 | 
			
		||||
        exit 0 ;;
 | 
			
		||||
    *:UNIX_System_V:4*:FTX*)
 | 
			
		||||
	# From Gerald Hewes <hewes@openmarket.com>.
 | 
			
		||||
	# How about differentiating between stratus architectures? -djm
 | 
			
		||||
	echo hppa1.1-stratus-sysv4
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    *:*:*:FTX*)
 | 
			
		||||
	# From seanf@swdc.stratus.com.
 | 
			
		||||
	echo i860-stratus-sysv4
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    mc68*:A/UX:*:*)
 | 
			
		||||
	echo m68k-apple-aux${UNAME_RELEASE}
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    news*:NEWS-OS:*:6*)
 | 
			
		||||
	echo mips-sony-newsos6
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*)
 | 
			
		||||
	if [ -d /usr/nec ]; then
 | 
			
		||||
	        echo mips-nec-sysv${UNAME_RELEASE}
 | 
			
		||||
	else
 | 
			
		||||
	        echo mips-unknown-sysv${UNAME_RELEASE}
 | 
			
		||||
	fi
 | 
			
		||||
        exit 0 ;;
 | 
			
		||||
esac
 | 
			
		||||
 | 
			
		||||
#echo '(No uname command or uname output not recognized.)' 1>&2
 | 
			
		||||
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
 | 
			
		||||
 | 
			
		||||
cat >dummy.c <<EOF
 | 
			
		||||
#ifdef _SEQUENT_
 | 
			
		||||
# include <sys/types.h>
 | 
			
		||||
# include <sys/utsname.h>
 | 
			
		||||
#endif
 | 
			
		||||
main ()
 | 
			
		||||
{
 | 
			
		||||
#if defined (sony)
 | 
			
		||||
#if defined (MIPSEB)
 | 
			
		||||
  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
 | 
			
		||||
     I don't know....  */
 | 
			
		||||
  printf ("mips-sony-bsd\n"); exit (0);
 | 
			
		||||
#else
 | 
			
		||||
#include <sys/param.h>
 | 
			
		||||
  printf ("m68k-sony-newsos%s\n",
 | 
			
		||||
#ifdef NEWSOS4
 | 
			
		||||
          "4"
 | 
			
		||||
#else
 | 
			
		||||
	  ""
 | 
			
		||||
#endif
 | 
			
		||||
         ); exit (0);
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined (__arm) && defined (__acorn) && defined (__unix)
 | 
			
		||||
  printf ("arm-acorn-riscix"); exit (0);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined (hp300) && !defined (hpux)
 | 
			
		||||
  printf ("m68k-hp-bsd\n"); exit (0);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined (NeXT)
 | 
			
		||||
#if !defined (__ARCHITECTURE__)
 | 
			
		||||
#define __ARCHITECTURE__ "m68k"
 | 
			
		||||
#endif
 | 
			
		||||
  int version;
 | 
			
		||||
  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
 | 
			
		||||
  printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
 | 
			
		||||
  exit (0);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined (MULTIMAX) || defined (n16)
 | 
			
		||||
#if defined (UMAXV)
 | 
			
		||||
  printf ("ns32k-encore-sysv\n"); exit (0);
 | 
			
		||||
#else
 | 
			
		||||
#if defined (CMU)
 | 
			
		||||
  printf ("ns32k-encore-mach\n"); exit (0);
 | 
			
		||||
#else
 | 
			
		||||
  printf ("ns32k-encore-bsd\n"); exit (0);
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined (__386BSD__)
 | 
			
		||||
  printf ("i386-pc-bsd\n"); exit (0);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined (sequent)
 | 
			
		||||
#if defined (i386)
 | 
			
		||||
  printf ("i386-sequent-dynix\n"); exit (0);
 | 
			
		||||
#endif
 | 
			
		||||
#if defined (ns32000)
 | 
			
		||||
  printf ("ns32k-sequent-dynix\n"); exit (0);
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined (_SEQUENT_)
 | 
			
		||||
    struct utsname un;
 | 
			
		||||
 | 
			
		||||
    uname(&un);
 | 
			
		||||
 | 
			
		||||
    if (strncmp(un.version, "V2", 2) == 0) {
 | 
			
		||||
	printf ("i386-sequent-ptx2\n"); exit (0);
 | 
			
		||||
    }
 | 
			
		||||
    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
 | 
			
		||||
	printf ("i386-sequent-ptx1\n"); exit (0);
 | 
			
		||||
    }
 | 
			
		||||
    printf ("i386-sequent-ptx\n"); exit (0);
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined (vax)
 | 
			
		||||
#if !defined (ultrix)
 | 
			
		||||
  printf ("vax-dec-bsd\n"); exit (0);
 | 
			
		||||
#else
 | 
			
		||||
  printf ("vax-dec-ultrix\n"); exit (0);
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined (alliant) && defined (i860)
 | 
			
		||||
  printf ("i860-alliant-bsd\n"); exit (0);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  exit (1);
 | 
			
		||||
}
 | 
			
		||||
EOF
 | 
			
		||||
 | 
			
		||||
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
 | 
			
		||||
rm -f dummy.c dummy
 | 
			
		||||
 | 
			
		||||
# Apollos put the system type in the environment.
 | 
			
		||||
 | 
			
		||||
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
 | 
			
		||||
 | 
			
		||||
# Convex versions that predate uname can use getsysinfo(1)
 | 
			
		||||
 | 
			
		||||
if [ -x /usr/convex/getsysinfo ]
 | 
			
		||||
then
 | 
			
		||||
    case `getsysinfo -f cpu_type` in
 | 
			
		||||
    c1*)
 | 
			
		||||
	echo c1-convex-bsd
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    c2*)
 | 
			
		||||
	if getsysinfo -f scalar_acc
 | 
			
		||||
	then echo c32-convex-bsd
 | 
			
		||||
	else echo c2-convex-bsd
 | 
			
		||||
	fi
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    c34*)
 | 
			
		||||
	echo c34-convex-bsd
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    c38*)
 | 
			
		||||
	echo c38-convex-bsd
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    c4*)
 | 
			
		||||
	echo c4-convex-bsd
 | 
			
		||||
	exit 0 ;;
 | 
			
		||||
    esac
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
#echo '(Unable to guess system type)' 1>&2
 | 
			
		||||
 | 
			
		||||
exit 1
 | 
			
		||||
							
								
								
									
										954
									
								
								config.sub
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										954
									
								
								config.sub
									
									
									
									
										vendored
									
									
								
							@@ -1,954 +0,0 @@
 | 
			
		||||
#! /bin/sh
 | 
			
		||||
# Configuration validation subroutine script, version 1.1.
 | 
			
		||||
#   Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
 | 
			
		||||
# This file is (in principle) common to ALL GNU software.
 | 
			
		||||
# The presence of a machine in this file suggests that SOME GNU software
 | 
			
		||||
# can handle that machine.  It does not imply ALL GNU software can.
 | 
			
		||||
#
 | 
			
		||||
# This file is free software; you can redistribute it and/or modify
 | 
			
		||||
# it under the terms of the GNU General Public License as published by
 | 
			
		||||
# the Free Software Foundation; either version 2 of the License, or
 | 
			
		||||
# (at your option) any later version.
 | 
			
		||||
#
 | 
			
		||||
# This program is distributed in the hope that it will be useful,
 | 
			
		||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
# GNU General Public License for more details.
 | 
			
		||||
#
 | 
			
		||||
# You should have received a copy of the GNU General Public License
 | 
			
		||||
# along with this program; if not, write to the Free Software
 | 
			
		||||
# Foundation, Inc., 59 Temple Place - Suite 330,
 | 
			
		||||
# Boston, MA 02111-1307, USA.
 | 
			
		||||
 | 
			
		||||
# As a special exception to the GNU General Public License, if you
 | 
			
		||||
# distribute this file as part of a program that contains a
 | 
			
		||||
# configuration script generated by Autoconf, you may include it under
 | 
			
		||||
# the same distribution terms that you use for the rest of that program.
 | 
			
		||||
 | 
			
		||||
# Configuration subroutine to validate and canonicalize a configuration type.
 | 
			
		||||
# Supply the specified configuration type as an argument.
 | 
			
		||||
# If it is invalid, we print an error message on stderr and exit with code 1.
 | 
			
		||||
# Otherwise, we print the canonical config type on stdout and succeed.
 | 
			
		||||
 | 
			
		||||
# This file is supposed to be the same for all GNU packages
 | 
			
		||||
# and recognize all the CPU types, system types and aliases
 | 
			
		||||
# that are meaningful with *any* GNU software.
 | 
			
		||||
# Each package is responsible for reporting which valid configurations
 | 
			
		||||
# it does not support.  The user should be able to distinguish
 | 
			
		||||
# a failure to support a valid configuration from a meaningless
 | 
			
		||||
# configuration.
 | 
			
		||||
 | 
			
		||||
# The goal of this file is to map all the various variations of a given
 | 
			
		||||
# machine specification into a single specification in the form:
 | 
			
		||||
#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
 | 
			
		||||
# or in some cases, the newer four-part form:
 | 
			
		||||
#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
 | 
			
		||||
# It is wrong to echo any other type of specification.
 | 
			
		||||
 | 
			
		||||
if [ x$1 = x ]
 | 
			
		||||
then
 | 
			
		||||
	echo Configuration name missing. 1>&2
 | 
			
		||||
	echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
 | 
			
		||||
	echo "or     $0 ALIAS" 1>&2
 | 
			
		||||
	echo where ALIAS is a recognized configuration type. 1>&2
 | 
			
		||||
	exit 1
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# First pass through any local machine types.
 | 
			
		||||
case $1 in
 | 
			
		||||
	*local*)
 | 
			
		||||
		echo $1
 | 
			
		||||
		exit 0
 | 
			
		||||
		;;
 | 
			
		||||
	*)
 | 
			
		||||
	;;
 | 
			
		||||
esac
 | 
			
		||||
 | 
			
		||||
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
 | 
			
		||||
# Here we must recognize all the valid KERNEL-OS combinations.
 | 
			
		||||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 | 
			
		||||
case $maybe_os in
 | 
			
		||||
  linux-gnu*)
 | 
			
		||||
    os=-$maybe_os
 | 
			
		||||
    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
 | 
			
		||||
    ;;
 | 
			
		||||
  *)
 | 
			
		||||
    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
 | 
			
		||||
    if [ $basic_machine != $1 ]
 | 
			
		||||
    then os=`echo $1 | sed 's/.*-/-/'`
 | 
			
		||||
    else os=; fi
 | 
			
		||||
    ;;
 | 
			
		||||
esac
 | 
			
		||||
 | 
			
		||||
### Let's recognize common machines as not being operating systems so
 | 
			
		||||
### that things like config.sub decstation-3100 work.  We also
 | 
			
		||||
### recognize some manufacturers as not being operating systems, so we
 | 
			
		||||
### can provide default operating systems below.
 | 
			
		||||
case $os in
 | 
			
		||||
	-sun*os*)
 | 
			
		||||
		# Prevent following clause from handling this invalid input.
 | 
			
		||||
		;;
 | 
			
		||||
	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
 | 
			
		||||
	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
 | 
			
		||||
	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
 | 
			
		||||
	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
 | 
			
		||||
	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
 | 
			
		||||
	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
 | 
			
		||||
	-apple)
 | 
			
		||||
		os=
 | 
			
		||||
		basic_machine=$1
 | 
			
		||||
		;;
 | 
			
		||||
	-hiux*)
 | 
			
		||||
		os=-hiuxwe2
 | 
			
		||||
		;;
 | 
			
		||||
	-sco5)
 | 
			
		||||
		os=sco3.2v5
 | 
			
		||||
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 | 
			
		||||
		;;
 | 
			
		||||
	-sco4)
 | 
			
		||||
		os=-sco3.2v4
 | 
			
		||||
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 | 
			
		||||
		;;
 | 
			
		||||
	-sco3.2.[4-9]*)
 | 
			
		||||
		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
 | 
			
		||||
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 | 
			
		||||
		;;
 | 
			
		||||
	-sco3.2v[4-9]*)
 | 
			
		||||
		# Don't forget version if it is 3.2v4 or newer.
 | 
			
		||||
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 | 
			
		||||
		;;
 | 
			
		||||
	-sco*)
 | 
			
		||||
		os=-sco3.2v2
 | 
			
		||||
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 | 
			
		||||
		;;
 | 
			
		||||
	-isc)
 | 
			
		||||
		os=-isc2.2
 | 
			
		||||
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 | 
			
		||||
		;;
 | 
			
		||||
	-clix*)
 | 
			
		||||
		basic_machine=clipper-intergraph
 | 
			
		||||
		;;
 | 
			
		||||
	-isc*)
 | 
			
		||||
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
 | 
			
		||||
		;;
 | 
			
		||||
	-lynx*)
 | 
			
		||||
		os=-lynxos
 | 
			
		||||
		;;
 | 
			
		||||
	-ptx*)
 | 
			
		||||
		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
 | 
			
		||||
		;;
 | 
			
		||||
	-windowsnt*)
 | 
			
		||||
		os=`echo $os | sed -e 's/windowsnt/winnt/'`
 | 
			
		||||
		;;
 | 
			
		||||
	-psos*)
 | 
			
		||||
		os=-psos
 | 
			
		||||
		;;
 | 
			
		||||
esac
 | 
			
		||||
 | 
			
		||||
# Decode aliases for certain CPU-COMPANY combinations.
 | 
			
		||||
case $basic_machine in
 | 
			
		||||
	# Recognize the basic CPU types without company name.
 | 
			
		||||
	# Some are omitted here because they have special meanings below.
 | 
			
		||||
	tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
 | 
			
		||||
		| arme[lb] | pyramid | mn10200 | mn10300 \
 | 
			
		||||
		| tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
 | 
			
		||||
		| alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
 | 
			
		||||
		| i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
 | 
			
		||||
		| mips64 | mipsel | mips64el | mips64orion | mips64orionel \
 | 
			
		||||
		| mipstx39 | mipstx39el \
 | 
			
		||||
		| sparc | sparclet | sparclite | sparc64 | v850)
 | 
			
		||||
		basic_machine=$basic_machine-unknown
 | 
			
		||||
		;;
 | 
			
		||||
	# We use `pc' rather than `unknown'
 | 
			
		||||
	# because (1) that's what they normally are, and
 | 
			
		||||
	# (2) the word "unknown" tends to confuse beginning users.
 | 
			
		||||
	i[3456]86)
 | 
			
		||||
	  basic_machine=$basic_machine-pc
 | 
			
		||||
	  ;;
 | 
			
		||||
	# Object if more than one company name word.
 | 
			
		||||
	*-*-*)
 | 
			
		||||
		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
 | 
			
		||||
		exit 1
 | 
			
		||||
		;;
 | 
			
		||||
	# Recognize the basic CPU types with company name.
 | 
			
		||||
	vax-* | tahoe-* | i[3456]86-* | i860-* | m32r-* | m68k-* | m68000-* \
 | 
			
		||||
	      | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
 | 
			
		||||
	      | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
 | 
			
		||||
	      | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
 | 
			
		||||
	      | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* \
 | 
			
		||||
	      | alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \
 | 
			
		||||
	      | ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \
 | 
			
		||||
	      | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
 | 
			
		||||
	      | sparc64-* | mips64-* | mipsel-* \
 | 
			
		||||
	      | mips64el-* | mips64orion-* | mips64orionel-*  \
 | 
			
		||||
	      | mipstx39-* | mipstx39el-* \
 | 
			
		||||
	      | f301-*)
 | 
			
		||||
		;;
 | 
			
		||||
	# Recognize the various machine names and aliases which stand
 | 
			
		||||
	# for a CPU type and a company and sometimes even an OS.
 | 
			
		||||
	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
 | 
			
		||||
		basic_machine=m68000-att
 | 
			
		||||
		;;
 | 
			
		||||
	3b*)
 | 
			
		||||
		basic_machine=we32k-att
 | 
			
		||||
		;;
 | 
			
		||||
	alliant | fx80)
 | 
			
		||||
		basic_machine=fx80-alliant
 | 
			
		||||
		;;
 | 
			
		||||
	altos | altos3068)
 | 
			
		||||
		basic_machine=m68k-altos
 | 
			
		||||
		;;
 | 
			
		||||
	am29k)
 | 
			
		||||
		basic_machine=a29k-none
 | 
			
		||||
		os=-bsd
 | 
			
		||||
		;;
 | 
			
		||||
	amdahl)
 | 
			
		||||
		basic_machine=580-amdahl
 | 
			
		||||
		os=-sysv
 | 
			
		||||
		;;
 | 
			
		||||
	amiga | amiga-*)
 | 
			
		||||
		basic_machine=m68k-cbm
 | 
			
		||||
		;;
 | 
			
		||||
	amigaos | amigados)
 | 
			
		||||
		basic_machine=m68k-cbm
 | 
			
		||||
		os=-amigaos
 | 
			
		||||
		;;
 | 
			
		||||
	amigaunix | amix)
 | 
			
		||||
		basic_machine=m68k-cbm
 | 
			
		||||
		os=-sysv4
 | 
			
		||||
		;;
 | 
			
		||||
	apollo68)
 | 
			
		||||
		basic_machine=m68k-apollo
 | 
			
		||||
		os=-sysv
 | 
			
		||||
		;;
 | 
			
		||||
	aux)
 | 
			
		||||
		basic_machine=m68k-apple
 | 
			
		||||
		os=-aux
 | 
			
		||||
		;;
 | 
			
		||||
	balance)
 | 
			
		||||
		basic_machine=ns32k-sequent
 | 
			
		||||
		os=-dynix
 | 
			
		||||
		;;
 | 
			
		||||
	convex-c1)
 | 
			
		||||
		basic_machine=c1-convex
 | 
			
		||||
		os=-bsd
 | 
			
		||||
		;;
 | 
			
		||||
	convex-c2)
 | 
			
		||||
		basic_machine=c2-convex
 | 
			
		||||
		os=-bsd
 | 
			
		||||
		;;
 | 
			
		||||
	convex-c32)
 | 
			
		||||
		basic_machine=c32-convex
 | 
			
		||||
		os=-bsd
 | 
			
		||||
		;;
 | 
			
		||||
	convex-c34)
 | 
			
		||||
		basic_machine=c34-convex
 | 
			
		||||
		os=-bsd
 | 
			
		||||
		;;
 | 
			
		||||
	convex-c38)
 | 
			
		||||
		basic_machine=c38-convex
 | 
			
		||||
		os=-bsd
 | 
			
		||||
		;;
 | 
			
		||||
	cray | ymp)
 | 
			
		||||
		basic_machine=ymp-cray
 | 
			
		||||
		os=-unicos
 | 
			
		||||
		;;
 | 
			
		||||
	cray2)
 | 
			
		||||
		basic_machine=cray2-cray
 | 
			
		||||
		os=-unicos
 | 
			
		||||
		;;
 | 
			
		||||
	[ctj]90-cray)
 | 
			
		||||
		basic_machine=c90-cray
 | 
			
		||||
		os=-unicos
 | 
			
		||||
		;;
 | 
			
		||||
	crds | unos)
 | 
			
		||||
		basic_machine=m68k-crds
 | 
			
		||||
		;;
 | 
			
		||||
	da30 | da30-*)
 | 
			
		||||
		basic_machine=m68k-da30
 | 
			
		||||
		;;
 | 
			
		||||
	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
 | 
			
		||||
		basic_machine=mips-dec
 | 
			
		||||
		;;
 | 
			
		||||
	delta | 3300 | motorola-3300 | motorola-delta \
 | 
			
		||||
	      | 3300-motorola | delta-motorola)
 | 
			
		||||
		basic_machine=m68k-motorola
 | 
			
		||||
		;;
 | 
			
		||||
	delta88)
 | 
			
		||||
		basic_machine=m88k-motorola
 | 
			
		||||
		os=-sysv3
 | 
			
		||||
		;;
 | 
			
		||||
	dpx20 | dpx20-*)
 | 
			
		||||
		basic_machine=rs6000-bull
 | 
			
		||||
		os=-bosx
 | 
			
		||||
		;;
 | 
			
		||||
	dpx2* | dpx2*-bull)
 | 
			
		||||
		basic_machine=m68k-bull
 | 
			
		||||
		os=-sysv3
 | 
			
		||||
		;;
 | 
			
		||||
	ebmon29k)
 | 
			
		||||
		basic_machine=a29k-amd
 | 
			
		||||
		os=-ebmon
 | 
			
		||||
		;;
 | 
			
		||||
	elxsi)
 | 
			
		||||
		basic_machine=elxsi-elxsi
 | 
			
		||||
		os=-bsd
 | 
			
		||||
		;;
 | 
			
		||||
	encore | umax | mmax)
 | 
			
		||||
		basic_machine=ns32k-encore
 | 
			
		||||
		;;
 | 
			
		||||
	fx2800)
 | 
			
		||||
		basic_machine=i860-alliant
 | 
			
		||||
		;;
 | 
			
		||||
	genix)
 | 
			
		||||
		basic_machine=ns32k-ns
 | 
			
		||||
		;;
 | 
			
		||||
	gmicro)
 | 
			
		||||
		basic_machine=tron-gmicro
 | 
			
		||||
		os=-sysv
 | 
			
		||||
		;;
 | 
			
		||||
	h3050r* | hiux*)
 | 
			
		||||
		basic_machine=hppa1.1-hitachi
 | 
			
		||||
		os=-hiuxwe2
 | 
			
		||||
		;;
 | 
			
		||||
	h8300hms)
 | 
			
		||||
		basic_machine=h8300-hitachi
 | 
			
		||||
		os=-hms
 | 
			
		||||
		;;
 | 
			
		||||
	harris)
 | 
			
		||||
		basic_machine=m88k-harris
 | 
			
		||||
		os=-sysv3
 | 
			
		||||
		;;
 | 
			
		||||
	hp300-*)
 | 
			
		||||
		basic_machine=m68k-hp
 | 
			
		||||
		;;
 | 
			
		||||
	hp300bsd)
 | 
			
		||||
		basic_machine=m68k-hp
 | 
			
		||||
		os=-bsd
 | 
			
		||||
		;;
 | 
			
		||||
	hp300hpux)
 | 
			
		||||
		basic_machine=m68k-hp
 | 
			
		||||
		os=-hpux
 | 
			
		||||
		;;
 | 
			
		||||
	hp9k2[0-9][0-9] | hp9k31[0-9])
 | 
			
		||||
		basic_machine=m68000-hp
 | 
			
		||||
		;;
 | 
			
		||||
	hp9k3[2-9][0-9])
 | 
			
		||||
		basic_machine=m68k-hp
 | 
			
		||||
		;;
 | 
			
		||||
	hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
 | 
			
		||||
		basic_machine=hppa1.1-hp
 | 
			
		||||
		;;
 | 
			
		||||
	hp9k8[0-9][0-9] | hp8[0-9][0-9])
 | 
			
		||||
		basic_machine=hppa1.0-hp
 | 
			
		||||
		;;
 | 
			
		||||
	hppa-next)
 | 
			
		||||
		os=-nextstep3
 | 
			
		||||
		;;
 | 
			
		||||
	i370-ibm* | ibm*)
 | 
			
		||||
		basic_machine=i370-ibm
 | 
			
		||||
		os=-mvs
 | 
			
		||||
		;;
 | 
			
		||||
# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
 | 
			
		||||
	i[3456]86v32)
 | 
			
		||||
		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 | 
			
		||||
		os=-sysv32
 | 
			
		||||
		;;
 | 
			
		||||
	i[3456]86v4*)
 | 
			
		||||
		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 | 
			
		||||
		os=-sysv4
 | 
			
		||||
		;;
 | 
			
		||||
	i[3456]86v)
 | 
			
		||||
		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 | 
			
		||||
		os=-sysv
 | 
			
		||||
		;;
 | 
			
		||||
	i[3456]86sol2)
 | 
			
		||||
		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
 | 
			
		||||
		os=-solaris2
 | 
			
		||||
		;;
 | 
			
		||||
	iris | iris4d)
 | 
			
		||||
		basic_machine=mips-sgi
 | 
			
		||||
		case $os in
 | 
			
		||||
		    -irix*)
 | 
			
		||||
			;;
 | 
			
		||||
		    *)
 | 
			
		||||
			os=-irix4
 | 
			
		||||
			;;
 | 
			
		||||
		esac
 | 
			
		||||
		;;
 | 
			
		||||
	isi68 | isi)
 | 
			
		||||
		basic_machine=m68k-isi
 | 
			
		||||
		os=-sysv
 | 
			
		||||
		;;
 | 
			
		||||
	m88k-omron*)
 | 
			
		||||
		basic_machine=m88k-omron
 | 
			
		||||
		;;
 | 
			
		||||
	magnum | m3230)
 | 
			
		||||
		basic_machine=mips-mips
 | 
			
		||||
		os=-sysv
 | 
			
		||||
		;;
 | 
			
		||||
	merlin)
 | 
			
		||||
		basic_machine=ns32k-utek
 | 
			
		||||
		os=-sysv
 | 
			
		||||
		;;
 | 
			
		||||
	miniframe)
 | 
			
		||||
		basic_machine=m68000-convergent
 | 
			
		||||
		;;
 | 
			
		||||
	mipsel*-linux*)
 | 
			
		||||
		basic_machine=mipsel-unknown
 | 
			
		||||
		os=-linux-gnu
 | 
			
		||||
		;;
 | 
			
		||||
	mips*-linux*)
 | 
			
		||||
		basic_machine=mips-unknown
 | 
			
		||||
		os=-linux-gnu
 | 
			
		||||
		;;
 | 
			
		||||
	mips3*-*)
 | 
			
		||||
		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
 | 
			
		||||
		;;
 | 
			
		||||
	mips3*)
 | 
			
		||||
		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
 | 
			
		||||
		;;
 | 
			
		||||
	ncr3000)
 | 
			
		||||
		basic_machine=i486-ncr
 | 
			
		||||
		os=-sysv4
 | 
			
		||||
		;;
 | 
			
		||||
	news | news700 | news800 | news900)
 | 
			
		||||
		basic_machine=m68k-sony
 | 
			
		||||
		os=-newsos
 | 
			
		||||
		;;
 | 
			
		||||
	news1000)
 | 
			
		||||
		basic_machine=m68030-sony
 | 
			
		||||
		os=-newsos
 | 
			
		||||
		;;
 | 
			
		||||
	news-3600 | risc-news)
 | 
			
		||||
		basic_machine=mips-sony
 | 
			
		||||
		os=-newsos
 | 
			
		||||
		;;
 | 
			
		||||
	next | m*-next )
 | 
			
		||||
		basic_machine=m68k-next
 | 
			
		||||
		case $os in
 | 
			
		||||
		    -nextstep* )
 | 
			
		||||
			;;
 | 
			
		||||
		    -ns2*)
 | 
			
		||||
		      os=-nextstep2
 | 
			
		||||
			;;
 | 
			
		||||
		    *)
 | 
			
		||||
		      os=-nextstep3
 | 
			
		||||
			;;
 | 
			
		||||
		esac
 | 
			
		||||
		;;
 | 
			
		||||
	nh3000)
 | 
			
		||||
		basic_machine=m68k-harris
 | 
			
		||||
		os=-cxux
 | 
			
		||||
		;;
 | 
			
		||||
	nh[45]000)
 | 
			
		||||
		basic_machine=m88k-harris
 | 
			
		||||
		os=-cxux
 | 
			
		||||
		;;
 | 
			
		||||
	nindy960)
 | 
			
		||||
		basic_machine=i960-intel
 | 
			
		||||
		os=-nindy
 | 
			
		||||
		;;
 | 
			
		||||
	np1)
 | 
			
		||||
		basic_machine=np1-gould
 | 
			
		||||
		;;
 | 
			
		||||
	pa-hitachi)
 | 
			
		||||
		basic_machine=hppa1.1-hitachi
 | 
			
		||||
		os=-hiuxwe2
 | 
			
		||||
		;;
 | 
			
		||||
	paragon)
 | 
			
		||||
		basic_machine=i860-intel
 | 
			
		||||
		os=-osf
 | 
			
		||||
		;;
 | 
			
		||||
	pbd)
 | 
			
		||||
		basic_machine=sparc-tti
 | 
			
		||||
		;;
 | 
			
		||||
	pbb)
 | 
			
		||||
		basic_machine=m68k-tti
 | 
			
		||||
		;;
 | 
			
		||||
        pc532 | pc532-*)
 | 
			
		||||
		basic_machine=ns32k-pc532
 | 
			
		||||
		;;
 | 
			
		||||
	pentium | p5)
 | 
			
		||||
		basic_machine=i586-intel
 | 
			
		||||
		;;
 | 
			
		||||
	pentiumpro | p6)
 | 
			
		||||
		basic_machine=i686-intel
 | 
			
		||||
		;;
 | 
			
		||||
	pentium-* | p5-*)
 | 
			
		||||
		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
 | 
			
		||||
		;;
 | 
			
		||||
	pentiumpro-* | p6-*)
 | 
			
		||||
		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
 | 
			
		||||
		;;
 | 
			
		||||
	k5)
 | 
			
		||||
		# We don't have specific support for AMD's K5 yet, so just call it a Pentium
 | 
			
		||||
		basic_machine=i586-amd
 | 
			
		||||
		;;
 | 
			
		||||
	nexen)
 | 
			
		||||
		# We don't have specific support for Nexgen yet, so just call it a Pentium
 | 
			
		||||
		basic_machine=i586-nexgen
 | 
			
		||||
		;;
 | 
			
		||||
	pn)
 | 
			
		||||
		basic_machine=pn-gould
 | 
			
		||||
		;;
 | 
			
		||||
	power)	basic_machine=rs6000-ibm
 | 
			
		||||
		;;
 | 
			
		||||
	ppc)	basic_machine=powerpc-unknown
 | 
			
		||||
	        ;;
 | 
			
		||||
	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
 | 
			
		||||
		;;
 | 
			
		||||
	ppcle | powerpclittle | ppc-le | powerpc-little)
 | 
			
		||||
		basic_machine=powerpcle-unknown
 | 
			
		||||
	        ;;
 | 
			
		||||
	ppcle-* | powerpclittle-*)
 | 
			
		||||
		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
 | 
			
		||||
		;;
 | 
			
		||||
	ps2)
 | 
			
		||||
		basic_machine=i386-ibm
 | 
			
		||||
		;;
 | 
			
		||||
	rm[46]00)
 | 
			
		||||
		basic_machine=mips-siemens
 | 
			
		||||
		;;
 | 
			
		||||
	rtpc | rtpc-*)
 | 
			
		||||
		basic_machine=romp-ibm
 | 
			
		||||
		;;
 | 
			
		||||
	sequent)
 | 
			
		||||
		basic_machine=i386-sequent
 | 
			
		||||
		;;
 | 
			
		||||
	sh)
 | 
			
		||||
		basic_machine=sh-hitachi
 | 
			
		||||
		os=-hms
 | 
			
		||||
		;;
 | 
			
		||||
	sps7)
 | 
			
		||||
		basic_machine=m68k-bull
 | 
			
		||||
		os=-sysv2
 | 
			
		||||
		;;
 | 
			
		||||
	spur)
 | 
			
		||||
		basic_machine=spur-unknown
 | 
			
		||||
		;;
 | 
			
		||||
	sun2)
 | 
			
		||||
		basic_machine=m68000-sun
 | 
			
		||||
		;;
 | 
			
		||||
	sun2os3)
 | 
			
		||||
		basic_machine=m68000-sun
 | 
			
		||||
		os=-sunos3
 | 
			
		||||
		;;
 | 
			
		||||
	sun2os4)
 | 
			
		||||
		basic_machine=m68000-sun
 | 
			
		||||
		os=-sunos4
 | 
			
		||||
		;;
 | 
			
		||||
	sun3os3)
 | 
			
		||||
		basic_machine=m68k-sun
 | 
			
		||||
		os=-sunos3
 | 
			
		||||
		;;
 | 
			
		||||
	sun3os4)
 | 
			
		||||
		basic_machine=m68k-sun
 | 
			
		||||
		os=-sunos4
 | 
			
		||||
		;;
 | 
			
		||||
	sun4os3)
 | 
			
		||||
		basic_machine=sparc-sun
 | 
			
		||||
		os=-sunos3
 | 
			
		||||
		;;
 | 
			
		||||
	sun4os4)
 | 
			
		||||
		basic_machine=sparc-sun
 | 
			
		||||
		os=-sunos4
 | 
			
		||||
		;;
 | 
			
		||||
	sun4sol2)
 | 
			
		||||
		basic_machine=sparc-sun
 | 
			
		||||
		os=-solaris2
 | 
			
		||||
		;;
 | 
			
		||||
	sun3 | sun3-*)
 | 
			
		||||
		basic_machine=m68k-sun
 | 
			
		||||
		;;
 | 
			
		||||
	sun4)
 | 
			
		||||
		basic_machine=sparc-sun
 | 
			
		||||
		;;
 | 
			
		||||
	sun386 | sun386i | roadrunner)
 | 
			
		||||
		basic_machine=i386-sun
 | 
			
		||||
		;;
 | 
			
		||||
	symmetry)
 | 
			
		||||
		basic_machine=i386-sequent
 | 
			
		||||
		os=-dynix
 | 
			
		||||
		;;
 | 
			
		||||
	tx39)
 | 
			
		||||
		basic_machine=mipstx39-unknown
 | 
			
		||||
		;;
 | 
			
		||||
	tx39el)
 | 
			
		||||
		basic_machine=mipstx39el-unknown
 | 
			
		||||
		;;
 | 
			
		||||
	tower | tower-32)
 | 
			
		||||
		basic_machine=m68k-ncr
 | 
			
		||||
		;;
 | 
			
		||||
	udi29k)
 | 
			
		||||
		basic_machine=a29k-amd
 | 
			
		||||
		os=-udi
 | 
			
		||||
		;;
 | 
			
		||||
	ultra3)
 | 
			
		||||
		basic_machine=a29k-nyu
 | 
			
		||||
		os=-sym1
 | 
			
		||||
		;;
 | 
			
		||||
	vaxv)
 | 
			
		||||
		basic_machine=vax-dec
 | 
			
		||||
		os=-sysv
 | 
			
		||||
		;;
 | 
			
		||||
	vms)
 | 
			
		||||
		basic_machine=vax-dec
 | 
			
		||||
		os=-vms
 | 
			
		||||
		;;
 | 
			
		||||
	vpp*|vx|vx-*)
 | 
			
		||||
               basic_machine=f301-fujitsu
 | 
			
		||||
               ;;
 | 
			
		||||
	vxworks960)
 | 
			
		||||
		basic_machine=i960-wrs
 | 
			
		||||
		os=-vxworks
 | 
			
		||||
		;;
 | 
			
		||||
	vxworks68)
 | 
			
		||||
		basic_machine=m68k-wrs
 | 
			
		||||
		os=-vxworks
 | 
			
		||||
		;;
 | 
			
		||||
	vxworks29k)
 | 
			
		||||
		basic_machine=a29k-wrs
 | 
			
		||||
		os=-vxworks
 | 
			
		||||
		;;
 | 
			
		||||
	xmp)
 | 
			
		||||
		basic_machine=xmp-cray
 | 
			
		||||
		os=-unicos
 | 
			
		||||
		;;
 | 
			
		||||
        xps | xps100)
 | 
			
		||||
		basic_machine=xps100-honeywell
 | 
			
		||||
		;;
 | 
			
		||||
	none)
 | 
			
		||||
		basic_machine=none-none
 | 
			
		||||
		os=-none
 | 
			
		||||
		;;
 | 
			
		||||
 | 
			
		||||
# Here we handle the default manufacturer of certain CPU types.  It is in
 | 
			
		||||
# some cases the only manufacturer, in others, it is the most popular.
 | 
			
		||||
	mips)
 | 
			
		||||
		if [ x$os = x-linux-gnu ]; then
 | 
			
		||||
			basic_machine=mips-unknown
 | 
			
		||||
		else
 | 
			
		||||
			basic_machine=mips-mips
 | 
			
		||||
		fi
 | 
			
		||||
		;;
 | 
			
		||||
	romp)
 | 
			
		||||
		basic_machine=romp-ibm
 | 
			
		||||
		;;
 | 
			
		||||
	rs6000)
 | 
			
		||||
		basic_machine=rs6000-ibm
 | 
			
		||||
		;;
 | 
			
		||||
	vax)
 | 
			
		||||
		basic_machine=vax-dec
 | 
			
		||||
		;;
 | 
			
		||||
	pdp11)
 | 
			
		||||
		basic_machine=pdp11-dec
 | 
			
		||||
		;;
 | 
			
		||||
	we32k)
 | 
			
		||||
		basic_machine=we32k-att
 | 
			
		||||
		;;
 | 
			
		||||
	sparc)
 | 
			
		||||
		basic_machine=sparc-sun
 | 
			
		||||
		;;
 | 
			
		||||
        cydra)
 | 
			
		||||
		basic_machine=cydra-cydrome
 | 
			
		||||
		;;
 | 
			
		||||
	orion)
 | 
			
		||||
		basic_machine=orion-highlevel
 | 
			
		||||
		;;
 | 
			
		||||
	orion105)
 | 
			
		||||
		basic_machine=clipper-highlevel
 | 
			
		||||
		;;
 | 
			
		||||
	*)
 | 
			
		||||
		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
 | 
			
		||||
		exit 1
 | 
			
		||||
		;;
 | 
			
		||||
esac
 | 
			
		||||
 | 
			
		||||
# Here we canonicalize certain aliases for manufacturers.
 | 
			
		||||
case $basic_machine in
 | 
			
		||||
	*-digital*)
 | 
			
		||||
		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
 | 
			
		||||
		;;
 | 
			
		||||
	*-commodore*)
 | 
			
		||||
		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
 | 
			
		||||
		;;
 | 
			
		||||
	*)
 | 
			
		||||
		;;
 | 
			
		||||
esac
 | 
			
		||||
 | 
			
		||||
# Decode manufacturer-specific aliases for certain operating systems.
 | 
			
		||||
 | 
			
		||||
if [ x"$os" != x"" ]
 | 
			
		||||
then
 | 
			
		||||
case $os in
 | 
			
		||||
        # First match some system type aliases
 | 
			
		||||
        # that might get confused with valid system types.
 | 
			
		||||
	# -solaris* is a basic system type, with this one exception.
 | 
			
		||||
	-solaris1 | -solaris1.*)
 | 
			
		||||
		os=`echo $os | sed -e 's|solaris1|sunos4|'`
 | 
			
		||||
		;;
 | 
			
		||||
	-solaris)
 | 
			
		||||
		os=-solaris2
 | 
			
		||||
		;;
 | 
			
		||||
	-svr4*)
 | 
			
		||||
		os=-sysv4
 | 
			
		||||
		;;
 | 
			
		||||
	-unixware*)
 | 
			
		||||
		os=-sysv4.2uw
 | 
			
		||||
		;;
 | 
			
		||||
	-gnu/linux*)
 | 
			
		||||
		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
 | 
			
		||||
		;;
 | 
			
		||||
	# First accept the basic system types.
 | 
			
		||||
	# The portable systems comes first.
 | 
			
		||||
	# Each alternative MUST END IN A *, to match a version number.
 | 
			
		||||
	# -sysv* is not here because it comes later, after sysvr4.
 | 
			
		||||
	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
 | 
			
		||||
	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
 | 
			
		||||
	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
 | 
			
		||||
	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
 | 
			
		||||
	      | -aos* \
 | 
			
		||||
	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
 | 
			
		||||
	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
 | 
			
		||||
	      | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
 | 
			
		||||
	      | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
 | 
			
		||||
	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 | 
			
		||||
	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 | 
			
		||||
	      | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
 | 
			
		||||
	      | -mingw32* | -linux-gnu* | -uxpv*)
 | 
			
		||||
	# Remember, each alternative MUST END IN *, to match a version number.
 | 
			
		||||
		;;
 | 
			
		||||
	-linux*)
 | 
			
		||||
		os=`echo $os | sed -e 's|linux|linux-gnu|'`
 | 
			
		||||
		;;
 | 
			
		||||
	-sunos5*)
 | 
			
		||||
		os=`echo $os | sed -e 's|sunos5|solaris2|'`
 | 
			
		||||
		;;
 | 
			
		||||
	-sunos6*)
 | 
			
		||||
		os=`echo $os | sed -e 's|sunos6|solaris3|'`
 | 
			
		||||
		;;
 | 
			
		||||
	-osfrose*)
 | 
			
		||||
		os=-osfrose
 | 
			
		||||
		;;
 | 
			
		||||
	-osf*)
 | 
			
		||||
		os=-osf
 | 
			
		||||
		;;
 | 
			
		||||
	-utek*)
 | 
			
		||||
		os=-bsd
 | 
			
		||||
		;;
 | 
			
		||||
	-dynix*)
 | 
			
		||||
		os=-bsd
 | 
			
		||||
		;;
 | 
			
		||||
	-acis*)
 | 
			
		||||
		os=-aos
 | 
			
		||||
		;;
 | 
			
		||||
	-ctix* | -uts*)
 | 
			
		||||
		os=-sysv
 | 
			
		||||
		;;
 | 
			
		||||
	-ns2 )
 | 
			
		||||
	        os=-nextstep2
 | 
			
		||||
		;;
 | 
			
		||||
	# Preserve the version number of sinix5.
 | 
			
		||||
	-sinix5.*)
 | 
			
		||||
		os=`echo $os | sed -e 's|sinix|sysv|'`
 | 
			
		||||
		;;
 | 
			
		||||
	-sinix*)
 | 
			
		||||
		os=-sysv4
 | 
			
		||||
		;;
 | 
			
		||||
	-triton*)
 | 
			
		||||
		os=-sysv3
 | 
			
		||||
		;;
 | 
			
		||||
	-oss*)
 | 
			
		||||
		os=-sysv3
 | 
			
		||||
		;;
 | 
			
		||||
	-svr4)
 | 
			
		||||
		os=-sysv4
 | 
			
		||||
		;;
 | 
			
		||||
	-svr3)
 | 
			
		||||
		os=-sysv3
 | 
			
		||||
		;;
 | 
			
		||||
	-sysvr4)
 | 
			
		||||
		os=-sysv4
 | 
			
		||||
		;;
 | 
			
		||||
	# This must come after -sysvr4.
 | 
			
		||||
	-sysv*)
 | 
			
		||||
		;;
 | 
			
		||||
	-xenix)
 | 
			
		||||
		os=-xenix
 | 
			
		||||
		;;
 | 
			
		||||
	-none)
 | 
			
		||||
		;;
 | 
			
		||||
	*)
 | 
			
		||||
		# Get rid of the `-' at the beginning of $os.
 | 
			
		||||
		os=`echo $os | sed 's/[^-]*-//'`
 | 
			
		||||
		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
 | 
			
		||||
		exit 1
 | 
			
		||||
		;;
 | 
			
		||||
esac
 | 
			
		||||
else
 | 
			
		||||
 | 
			
		||||
# Here we handle the default operating systems that come with various machines.
 | 
			
		||||
# The value should be what the vendor currently ships out the door with their
 | 
			
		||||
# machine or put another way, the most popular os provided with the machine.
 | 
			
		||||
 | 
			
		||||
# Note that if you're going to try to match "-MANUFACTURER" here (say,
 | 
			
		||||
# "-sun"), then you have to tell the case statement up towards the top
 | 
			
		||||
# that MANUFACTURER isn't an operating system.  Otherwise, code above
 | 
			
		||||
# will signal an error saying that MANUFACTURER isn't an operating
 | 
			
		||||
# system, and we'll never get to this point.
 | 
			
		||||
 | 
			
		||||
case $basic_machine in
 | 
			
		||||
	*-acorn)
 | 
			
		||||
		os=-riscix1.2
 | 
			
		||||
		;;
 | 
			
		||||
	arm*-semi)
 | 
			
		||||
		os=-aout
 | 
			
		||||
		;;
 | 
			
		||||
        pdp11-*)
 | 
			
		||||
		os=-none
 | 
			
		||||
		;;
 | 
			
		||||
	*-dec | vax-*)
 | 
			
		||||
		os=-ultrix4.2
 | 
			
		||||
		;;
 | 
			
		||||
	m68*-apollo)
 | 
			
		||||
		os=-domain
 | 
			
		||||
		;;
 | 
			
		||||
	i386-sun)
 | 
			
		||||
		os=-sunos4.0.2
 | 
			
		||||
		;;
 | 
			
		||||
	m68000-sun)
 | 
			
		||||
		os=-sunos3
 | 
			
		||||
		# This also exists in the configure program, but was not the
 | 
			
		||||
		# default.
 | 
			
		||||
		# os=-sunos4
 | 
			
		||||
		;;
 | 
			
		||||
	*-tti)	# must be before sparc entry or we get the wrong os.
 | 
			
		||||
		os=-sysv3
 | 
			
		||||
		;;
 | 
			
		||||
	sparc-* | *-sun)
 | 
			
		||||
		os=-sunos4.1.1
 | 
			
		||||
		;;
 | 
			
		||||
	*-ibm)
 | 
			
		||||
		os=-aix
 | 
			
		||||
		;;
 | 
			
		||||
	*-hp)
 | 
			
		||||
		os=-hpux
 | 
			
		||||
		;;
 | 
			
		||||
	*-hitachi)
 | 
			
		||||
		os=-hiux
 | 
			
		||||
		;;
 | 
			
		||||
	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
 | 
			
		||||
		os=-sysv
 | 
			
		||||
		;;
 | 
			
		||||
	*-cbm)
 | 
			
		||||
		os=-amigaos
 | 
			
		||||
		;;
 | 
			
		||||
	*-dg)
 | 
			
		||||
		os=-dgux
 | 
			
		||||
		;;
 | 
			
		||||
	*-dolphin)
 | 
			
		||||
		os=-sysv3
 | 
			
		||||
		;;
 | 
			
		||||
	m68k-ccur)
 | 
			
		||||
		os=-rtu
 | 
			
		||||
		;;
 | 
			
		||||
	m88k-omron*)
 | 
			
		||||
		os=-luna
 | 
			
		||||
		;;
 | 
			
		||||
	*-next )
 | 
			
		||||
		os=-nextstep
 | 
			
		||||
		;;
 | 
			
		||||
	*-sequent)
 | 
			
		||||
		os=-ptx
 | 
			
		||||
		;;
 | 
			
		||||
	*-crds)
 | 
			
		||||
		os=-unos
 | 
			
		||||
		;;
 | 
			
		||||
	*-ns)
 | 
			
		||||
		os=-genix
 | 
			
		||||
		;;
 | 
			
		||||
	i370-*)
 | 
			
		||||
		os=-mvs
 | 
			
		||||
		;;
 | 
			
		||||
	*-next)
 | 
			
		||||
		os=-nextstep3
 | 
			
		||||
		;;
 | 
			
		||||
        *-gould)
 | 
			
		||||
		os=-sysv
 | 
			
		||||
		;;
 | 
			
		||||
        *-highlevel)
 | 
			
		||||
		os=-bsd
 | 
			
		||||
		;;
 | 
			
		||||
	*-encore)
 | 
			
		||||
		os=-bsd
 | 
			
		||||
		;;
 | 
			
		||||
        *-sgi)
 | 
			
		||||
		os=-irix
 | 
			
		||||
		;;
 | 
			
		||||
        *-siemens)
 | 
			
		||||
		os=-sysv4
 | 
			
		||||
		;;
 | 
			
		||||
	*-masscomp)
 | 
			
		||||
		os=-rtu
 | 
			
		||||
		;;
 | 
			
		||||
	f301-fujitsu)
 | 
			
		||||
		os=-uxpv
 | 
			
		||||
		;;
 | 
			
		||||
	*)
 | 
			
		||||
		os=-none
 | 
			
		||||
		;;
 | 
			
		||||
esac
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# Here we handle the case where we know the os, and the CPU type, but not the
 | 
			
		||||
# manufacturer.  We pick the logical manufacturer.
 | 
			
		||||
vendor=unknown
 | 
			
		||||
case $basic_machine in
 | 
			
		||||
	*-unknown)
 | 
			
		||||
		case $os in
 | 
			
		||||
			-riscix*)
 | 
			
		||||
				vendor=acorn
 | 
			
		||||
				;;
 | 
			
		||||
			-sunos*)
 | 
			
		||||
				vendor=sun
 | 
			
		||||
				;;
 | 
			
		||||
			-aix*)
 | 
			
		||||
				vendor=ibm
 | 
			
		||||
				;;
 | 
			
		||||
			-hpux*)
 | 
			
		||||
				vendor=hp
 | 
			
		||||
				;;
 | 
			
		||||
			-hiux*)
 | 
			
		||||
				vendor=hitachi
 | 
			
		||||
				;;
 | 
			
		||||
			-unos*)
 | 
			
		||||
				vendor=crds
 | 
			
		||||
				;;
 | 
			
		||||
			-dgux*)
 | 
			
		||||
				vendor=dg
 | 
			
		||||
				;;
 | 
			
		||||
			-luna*)
 | 
			
		||||
				vendor=omron
 | 
			
		||||
				;;
 | 
			
		||||
			-genix*)
 | 
			
		||||
				vendor=ns
 | 
			
		||||
				;;
 | 
			
		||||
			-mvs*)
 | 
			
		||||
				vendor=ibm
 | 
			
		||||
				;;
 | 
			
		||||
			-ptx*)
 | 
			
		||||
				vendor=sequent
 | 
			
		||||
				;;
 | 
			
		||||
			-vxsim* | -vxworks*)
 | 
			
		||||
				vendor=wrs
 | 
			
		||||
				;;
 | 
			
		||||
			-aux*)
 | 
			
		||||
				vendor=apple
 | 
			
		||||
				;;
 | 
			
		||||
		esac
 | 
			
		||||
		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
 | 
			
		||||
		;;
 | 
			
		||||
esac
 | 
			
		||||
 | 
			
		||||
echo $basic_machine$os
 | 
			
		||||
							
								
								
									
										285
									
								
								configure.in
									
									
									
									
									
								
							
							
						
						
									
										285
									
								
								configure.in
									
									
									
									
									
								
							@@ -1,14 +1,36 @@
 | 
			
		||||
dnl
 | 
			
		||||
Mnl Configure script for the Gnome library
 | 
			
		||||
dnl Configure script for the Gnome library
 | 
			
		||||
dnl
 | 
			
		||||
 | 
			
		||||
AC_INIT(copyright.txt)
 | 
			
		||||
AM_CONFIG_HEADER(config.h)
 | 
			
		||||
AC_CANONICAL_SYSTEM
 | 
			
		||||
 | 
			
		||||
AM_INIT_AUTOMAKE(libgtop, 0.01)
 | 
			
		||||
. $srcdir/LIBGTOP-VERSION
 | 
			
		||||
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
 | 
			
		||||
 | 
			
		||||
AM_ACLOCAL_INCLUDE(macros)
 | 
			
		||||
AC_SUBST(LIBGTOP_MAJOR_VERSION)
 | 
			
		||||
AC_SUBST(LIBGTOP_MINOR_VERSION)
 | 
			
		||||
AC_SUBST(LIBGTOP_MICRO_VERSION)
 | 
			
		||||
AC_SUBST(LIBGTOP_INTERFACE_AGE)
 | 
			
		||||
AC_SUBST(LIBGTOP_BINARY_AGE)
 | 
			
		||||
AC_SUBST(LIBGTOP_SERVER_VERSION)
 | 
			
		||||
AC_SUBST(LIBGTOP_VERSION)
 | 
			
		||||
AC_SUBST(LIBGTOP_VERSION_CODE)
 | 
			
		||||
 | 
			
		||||
# libtool versioning
 | 
			
		||||
LT_RELEASE=$LIBGTOP_MAJOR_VERSION.$LIBGTOP_MINOR_VERSION
 | 
			
		||||
LT_CURRENT=`expr $LIBGTOP_MICRO_VERSION - $LIBGTOP_INTERFACE_AGE`
 | 
			
		||||
LT_REVISION=$LIBGTOP_INTERFACE_AGE
 | 
			
		||||
LT_AGE=`expr $LIBGTOP_BINARY_AGE - $LIBGTOP_INTERFACE_AGE`
 | 
			
		||||
LT_VERSION_INFO='-version-info ${LT_CURRENT}:${LT_REVISION}:${LT_AGE}'
 | 
			
		||||
AC_SUBST(LT_VERSION_INFO)
 | 
			
		||||
AC_SUBST(LT_RELEASE)
 | 
			
		||||
AC_SUBST(LT_CURRENT)
 | 
			
		||||
AC_SUBST(LT_REVISION)
 | 
			
		||||
AC_SUBST(LT_AGE)
 | 
			
		||||
 | 
			
		||||
AM_ACLOCAL_INCLUDE(. macros)
 | 
			
		||||
 | 
			
		||||
AC_ISC_POSIX
 | 
			
		||||
AC_PROG_CC
 | 
			
		||||
@@ -37,41 +59,94 @@ export cross_compiling
 | 
			
		||||
 | 
			
		||||
AM_PROG_LIBTOOL
 | 
			
		||||
 | 
			
		||||
dnl If you want to use libgtop without gnome, comment the following line out.
 | 
			
		||||
dnl Let the user enable compiler warnings
 | 
			
		||||
GNOME_COMPILE_WARNINGS
 | 
			
		||||
 | 
			
		||||
GNOME_INIT_HOOK(gnome_found=yes)
 | 
			
		||||
 | 
			
		||||
if test "x$gnome_found" != xyes; then
 | 
			
		||||
  if test "x$want_gnome" != xno ; then
 | 
			
		||||
    AC_MSG_ERROR([
 | 
			
		||||
*** GNOME was not found on this system. ***
 | 
			
		||||
 | 
			
		||||
*** If you want to use LibGTop without GNOME, you need
 | 
			
		||||
*** to give configure the --without-gnome parameter.
 | 
			
		||||
])
 | 
			
		||||
  fi
 | 
			
		||||
  GNOME_SUPPORT_CHECKS
 | 
			
		||||
else
 | 
			
		||||
  AM_CONDITIONAL(BUILD_GNOME_SUPPORT, false)
 | 
			
		||||
  AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = xyes)
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
AC_LC_SYSDEPS
 | 
			
		||||
GNOME_LIBGTOP_SYSDEPS
 | 
			
		||||
GNOME_LIBGTOP_TYPES
 | 
			
		||||
 | 
			
		||||
if test x$libgtop_want_guile = xyes ; then
 | 
			
		||||
AC_ARG_WITH(libgtop-guile,
 | 
			
		||||
[  --with-libgtop-guile    Build the libgtop guile interface (default=no)],
 | 
			
		||||
[build_guile="$withval"], [build_guile=yes])
 | 
			
		||||
 | 
			
		||||
if test x$build_guile != xno ; then
 | 
			
		||||
  GNOME_CHECK_GUILE
 | 
			
		||||
  if test x$ac_cv_guile_found = xyes ; then
 | 
			
		||||
    if test x$libgtop_want_names = xyes ; then
 | 
			
		||||
      AC_DEFINE(GLIBTOP_GUILE_NAMES)
 | 
			
		||||
    fi
 | 
			
		||||
    guile_examples='third third_static'
 | 
			
		||||
    guile_subdirs='guile'
 | 
			
		||||
  else
 | 
			
		||||
    guile_examples=
 | 
			
		||||
    guile_subdirs=
 | 
			
		||||
  fi
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
AC_ARG_WITH(libgtop-inodedb,
 | 
			
		||||
[  --with-libgtop-inodedb  Build the inodedb stuff (default=no)],
 | 
			
		||||
[build_inodedb="$withval"], [build_inodedb=no])
 | 
			
		||||
 | 
			
		||||
LIBGTOP_EXTRA_LIBS=
 | 
			
		||||
 | 
			
		||||
if test x$build_inodedb = xyes ; then
 | 
			
		||||
  AC_CHECK_LIB(gdbm, gdbm_open, LIBGTOP_EXTRA_LIBS='-lgdbm', build_inodedb=no)
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
AM_CONDITIONAL(INODEDB, test x$build_inodedb = xyes)
 | 
			
		||||
 | 
			
		||||
if test x$build_inodedb = xyes ; then
 | 
			
		||||
  AC_DEFINE(GLIBTOP_INODEDB)
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
AC_DEFINE(GLIBTOP_NAMES)
 | 
			
		||||
 | 
			
		||||
if test x$ac_cv_guile_found = xyes ; then
 | 
			
		||||
  AC_DEFINE(GLIBTOP_GUILE)
 | 
			
		||||
  AC_DEFINE(GLIBTOP_GUILE_NAMES)
 | 
			
		||||
  libgtop_guile_found=yes
 | 
			
		||||
  guile_examples='third'
 | 
			
		||||
  guile_static_examples='third_static'
 | 
			
		||||
  guile_subdirs='guile'
 | 
			
		||||
else
 | 
			
		||||
  libgtop_guile_found=no
 | 
			
		||||
  guile_examples=
 | 
			
		||||
  guile_static_examples=
 | 
			
		||||
  guile_subdirs=
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
if test x$libgtop_smp = xyes ; then
 | 
			
		||||
  smp_examples='smp'
 | 
			
		||||
  smp_static_examples='smp_static'
 | 
			
		||||
else
 | 
			
		||||
  smp_examples=
 | 
			
		||||
  smp_static_examples=
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
if test "x$enable_static" != xno; then
 | 
			
		||||
  static_targets="first_static second_static mountlist_static procmap_static netload_static sysdeps_static $guile_static_examples $smp_static_examples"
 | 
			
		||||
else
 | 
			
		||||
  static_targets=""
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
AC_SUBST(static_targets)
 | 
			
		||||
AC_SUBST(smp_examples)
 | 
			
		||||
AC_SUBST(guile_examples)
 | 
			
		||||
AC_SUBST(guile_subdirs)
 | 
			
		||||
 | 
			
		||||
AM_PROG_LIBTOOL
 | 
			
		||||
 | 
			
		||||
dnl You need to uncomment the following line if you want to use libgtop without Gnome.
 | 
			
		||||
AM_PATH_GLIB(1.1.3,,AC_MSG_ERROR(GLIB >= 1.1.3 is required for LibGTop))
 | 
			
		||||
 | 
			
		||||
dnl You need to uncomment the following line if you want to use
 | 
			
		||||
dnl libGTop without Gnome.
 | 
			
		||||
dnl GNOME_SUPPORT_CHECKS
 | 
			
		||||
 | 
			
		||||
dnl Checks for typedefs, structures, and compiler characteristics.
 | 
			
		||||
@@ -95,6 +170,21 @@ AC_CHECK_LIB(kvm, kvm_open)
 | 
			
		||||
dnl For DEC OSF1
 | 
			
		||||
AC_CHECK_LIB(mach, vm_statistics)
 | 
			
		||||
 | 
			
		||||
dnl Check for Internet sockets.
 | 
			
		||||
AC_CHECK_FUNC(socket,
 | 
			
		||||
 [AC_CHECK_HEADER(netinet/in.h,
 | 
			
		||||
   [AC_CHECK_HEADER(arpa/inet.h, [
 | 
			
		||||
  AC_DEFINE(HAVE_SOCKETS)
 | 
			
		||||
      AC_MSG_CHECKING("for sun_len member in struct sockaddr_un")
 | 
			
		||||
      AC_TRY_LINK([
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#include <sys/socket.h>
 | 
			
		||||
#include <sys/un.h>
 | 
			
		||||
      ],
 | 
			
		||||
      [static struct sockaddr_un x; x.sun_len = 1;],
 | 
			
		||||
      [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SOCKADDR_SUN_LEN)],
 | 
			
		||||
      [AC_MSG_RESULT(no)])])])])
 | 
			
		||||
 | 
			
		||||
dnl Checks for library functions.
 | 
			
		||||
AC_FUNC_ALLOCA
 | 
			
		||||
AC_FUNC_MMAP
 | 
			
		||||
@@ -102,11 +192,18 @@ AC_TYPE_SIGNAL
 | 
			
		||||
AC_FUNC_STRFTIME
 | 
			
		||||
AC_CHECK_FUNCS(getcwd gettimeofday getwd putenv strdup strtoul uname)
 | 
			
		||||
 | 
			
		||||
ALL_LINGUAS="fr"
 | 
			
		||||
AM_GNU_GETTEXT
 | 
			
		||||
dnl ## all 'es_??' are only needed for format numbers different of 'es'
 | 
			
		||||
ALL_LINGUAS="de es es_DO es_GT es_HN es_MX es_PA es_PE es_SV fr ko no ja"
 | 
			
		||||
AM_GNOME_GETTEXT
 | 
			
		||||
 | 
			
		||||
AC_PATH_XTRA
 | 
			
		||||
 | 
			
		||||
dnl For Solaris
 | 
			
		||||
dnl Please don't move this before AC_PATH_XTRA
 | 
			
		||||
AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
 | 
			
		||||
AC_CHECK_FUNC(connect,,[AC_CHECK_LIB(socket,connect)])
 | 
			
		||||
AC_CHECK_FUNC(inet_aton,,[AC_CHECK_LIB(resolv,inet_aton)])
 | 
			
		||||
 | 
			
		||||
dnl The construct foo=`echo $w1 $w2 $w3` fails on some systems if $w1 = -e or -n
 | 
			
		||||
dnl So we use the following instead.
 | 
			
		||||
dnl XE_SPACE(var, words)
 | 
			
		||||
@@ -118,7 +215,8 @@ $1="$T"
 | 
			
		||||
 | 
			
		||||
dnl Autodetect Xauth
 | 
			
		||||
dnl -lXau is only used by gnuclient, so use a special variable for Xauth X libs
 | 
			
		||||
test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no
 | 
			
		||||
saved_CPPFLAGS="$CPPFLAGS"
 | 
			
		||||
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
 | 
			
		||||
test -z "$with_xauth" && { AC_CHECK_HEADER(X11/Xauth.h,          ,with_xauth=no) }
 | 
			
		||||
test -z "$with_xauth" && { AC_CHECK_LIB(Xau, XauGetAuthByAddr,[:],with_xauth=no, $X_LIBS) }
 | 
			
		||||
test -z "$with_xauth" && with_xauth=yes
 | 
			
		||||
@@ -126,45 +224,56 @@ if test "$with_xauth" = "yes"; then
 | 
			
		||||
  AC_DEFINE(HAVE_XAUTH)
 | 
			
		||||
  XE_SPACE(libs_xauth, $X_LIBS -lXau)
 | 
			
		||||
fi
 | 
			
		||||
CPPFLAGS="$saved_CPPFLAGS"
 | 
			
		||||
AC_SUBST(libs_xauth)
 | 
			
		||||
 | 
			
		||||
dnl For diskusage stuff
 | 
			
		||||
GNOME_FILEUTILS_CHECKS
 | 
			
		||||
 | 
			
		||||
CFLAGS="$CFLAGS -D_IN_LIBGTOP"
 | 
			
		||||
dnl Debugging
 | 
			
		||||
AC_ARG_ENABLE(debug, [  --enable-debug          turn on debugging [default=no]],AC_DEFINE(LIBGTOP_ENABLE_DEBUG),)
 | 
			
		||||
AC_ARG_ENABLE(fatal-warnings, [  --enable-fatal-warnings make all warnings fatal [debug=no]],AC_DEFINE(LIBGTOP_FATAL_WARNINGS),)
 | 
			
		||||
 | 
			
		||||
AC_SUBST(CFLAGS)
 | 
			
		||||
AC_SUBST(CPPFLAGS)
 | 
			
		||||
AC_SUBST(LDFLAGS)
 | 
			
		||||
 | 
			
		||||
AC_ARG_ENABLE(debug, [  --enable-debug          turn on debugging [default=no]],AC_DEFINE(GNOME_ENABLE_DEBUG),)
 | 
			
		||||
 | 
			
		||||
dnl If you want to use libgtop without gnome, uncomment the following paragraph:
 | 
			
		||||
dnl LIBSUPPORT=
 | 
			
		||||
dnl SUPPORTINCS=
 | 
			
		||||
dnl if test "$need_gnome_support" = yes; then
 | 
			
		||||
dnl    LIBSUPPORT='$(top_builddir)/support/libgnomesupport.la'
 | 
			
		||||
dnl    SUPPORTINCS='-I$(top_srcdir)/support'
 | 
			
		||||
dnl fi
 | 
			
		||||
dnl AC_SUBST(LIBSUPPORT)
 | 
			
		||||
dnl AC_SUBST(SUPPORTINCS)
 | 
			
		||||
 | 
			
		||||
dnl Some ugly hack; if '-lgnomesupport' is part of $GNOME_LIBS, we include it here.
 | 
			
		||||
echo "$GNOME_LIBS" | grep -q -e '-lgnomesupport'
 | 
			
		||||
if test $? = 0 ; then
 | 
			
		||||
if test "x$gnome_found" = xyes ; then
 | 
			
		||||
  LIBSUPPORT="$GNOME_LIBDIR -lgnomesupport"
 | 
			
		||||
  SUPPORTINCS="$GNOME_INCLUDEDIR"
 | 
			
		||||
else
 | 
			
		||||
  LIBSUPPORT='$(top_builddir)/support/libgnomesupport.la'
 | 
			
		||||
  SUPPORTINCS='-DNEED_GNOMESUPPORT_H -I$(top_builddir)/support -I$(top_srcdir)/support'
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
dnl Some ugly hack; if '-lgnomesupport' is part of $GNOME_LIBS,
 | 
			
		||||
dnl we include it here.
 | 
			
		||||
case "$GNOME_LIBS" in
 | 
			
		||||
	'*-lgnomesupport*' ) 
 | 
			
		||||
	  LIBSUPPORT="$GNOME_LIBDIR -lgnomesupport"
 | 
			
		||||
          SUPPORTINCS="$GNOME_INCLUDEDIR" ;;
 | 
			
		||||
esac
 | 
			
		||||
AC_SUBST(LIBSUPPORT)
 | 
			
		||||
AC_SUBST(SUPPORTINCS)
 | 
			
		||||
 | 
			
		||||
dnl These definitions are expanded in make.
 | 
			
		||||
LIBGTOP_LIBS='-L$(libdir) -lgtop'
 | 
			
		||||
LIBGTOP_LIBS='-L$(libdir)'
 | 
			
		||||
LIBGTOP_INCS='-I$(includedir)'
 | 
			
		||||
 | 
			
		||||
if test x$build_inodedb = xyes ; then
 | 
			
		||||
  LIBGTOP_INCS="$LIBGTOP_INCS -DGLIBTOP_INODEDB"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
if test x$libgtop_smp = xyes ; then
 | 
			
		||||
  LIBGTOP_INCS="$LIBGTOP_INCS -DHAVE_LIBGTOP_SMP"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
if test x$libgtop_have_sysinfo = xyes ; then
 | 
			
		||||
  LIBGTOP_INCS="$LIBGTOP_INCS -DHAVE_LIBGTOP_SYSINFO"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
LIBGTOP_INCS="$LIBGTOP_INCS $SUPPORTINCS $GLIB_CFLAGS"
 | 
			
		||||
 | 
			
		||||
LIBGTOP_GUILE_LIBS="$LIBGTOP_LIBS"
 | 
			
		||||
LIBGTOP_GUILE_INCS="$LIBGTOP_INCS"
 | 
			
		||||
LIBGTOP_BINDIR='$(bindir)'
 | 
			
		||||
LIBGTOP_SERVER='$(bindir)/gtop_server'
 | 
			
		||||
LIBGTOP_SERVER='$(bindir)/libgtop_server'
 | 
			
		||||
 | 
			
		||||
sysdeps_dir="$libgtop_sysdeps_dir"
 | 
			
		||||
AC_SUBST(sysdeps_dir)
 | 
			
		||||
@@ -178,63 +287,74 @@ fi
 | 
			
		||||
 | 
			
		||||
AC_SUBST(libgtop_guile_found)
 | 
			
		||||
 | 
			
		||||
if test x$libgtop_want_names = xyes ; then
 | 
			
		||||
  if test x$ac_cv_guile_found = xyes ; then
 | 
			
		||||
    LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS -lgtop_guile_names"
 | 
			
		||||
    libgtop_want_guile_names=yes
 | 
			
		||||
  else
 | 
			
		||||
    libgtop_want_guile_names=no
 | 
			
		||||
  fi
 | 
			
		||||
  LIBGTOP_LIBS="$LIBGTOP_LIBS -lgtop_names"
 | 
			
		||||
  LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS -lgtop_names"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
AC_SUBST(libgtop_want_guile_names)
 | 
			
		||||
 | 
			
		||||
LIBGTOP_LIBS="$LIBGTOP_LIBS -lgtop_common $libs_xauth" 
 | 
			
		||||
LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS -lgtop_common $libs_xauth"
 | 
			
		||||
 | 
			
		||||
if test "x$need_server" = "xyes" ; then
 | 
			
		||||
  LIBGTOP_LIBS="$LIBGTOP_LIBS -lgtop"
 | 
			
		||||
  LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS -lgtop"
 | 
			
		||||
if test -z "$LIBGTOP_EXTRA_LIBS" ; then
 | 
			
		||||
  LIBGTOP_EXTRA_LIBS="$libs_xauth"
 | 
			
		||||
else
 | 
			
		||||
  LIBGTOP_LIBS="$LIBGTOP_LIBS -lgtop_sysdeps"
 | 
			
		||||
  LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS -lgtop_sysdeps"
 | 
			
		||||
  LIBGTOP_EXTRA_LIBS="$LIBGTOP_EXTRA_LIBS $libs_xauth"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
if test "x$ac_cv_guile_found" = "xyes" ; then
 | 
			
		||||
  LIBGTOP_INCS="$LIBGTOP_INCS $GUILE_INCS"
 | 
			
		||||
  LIBGTOP_GUILE_INCS="$LIBGTOP_INCS $GUILE_INCS"
 | 
			
		||||
  LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS $GUILE_LIBS"
 | 
			
		||||
fi
 | 
			
		||||
LIBGTOP_EXTRA_LIBS="$LIBGTOP_EXTRA_LIBS $GLIB_LIBS"
 | 
			
		||||
 | 
			
		||||
machine_incs='-I$(top_srcdir)/sysdeps/@sysdeps_dir@'
 | 
			
		||||
LIBGTOP_LIBS="$LIBGTOP_LIBS -lgtop_common -lgtop -lgtop_sysdeps"
 | 
			
		||||
LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS -lgtop_common -lgtop -lgtop_sysdeps"
 | 
			
		||||
 | 
			
		||||
LIBGTOP_NAMES_LIBS="$LIBGTOP_LIBS -lgtop_names"
 | 
			
		||||
LIBGTOP_GUILE_NAMES_LIBS="$LIBGTOP_GUILE_LIBS -lgtop_guile_names -lgtop_names"
 | 
			
		||||
 | 
			
		||||
LIBGTOP_LIBS="$LIBGTOP_LIBS" 
 | 
			
		||||
LIBGTOP_NAMES_LIBS="$LIBGTOP_NAMES_LIBS"
 | 
			
		||||
LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS"
 | 
			
		||||
LIBGTOP_GUILE_NAMES_LIBS="$LIBGTOP_GUILE_NAMES_LIBS"
 | 
			
		||||
 | 
			
		||||
LIBGTOP_GUILE_LIBS="$LIBGTOP_GUILE_LIBS $GUILE_LIBS"
 | 
			
		||||
LIBGTOP_GUILE_INCS="$LIBGTOP_GUILE_INCS $GUILE_INCS -DGLIBTOP_GUILE"
 | 
			
		||||
 | 
			
		||||
LIBGTOP_NAMES_INCS="$LIBGTOP_INCS -DGLIBTOP_NAMES"
 | 
			
		||||
LIBGTOP_GUILE_NAMES_INCS="$LIBGTOP_GUILE_INCS -DGLIBTOP_GUILE_NAMES"
 | 
			
		||||
LIBGTOP_GUILE_NAMES_INCS="$LIBGTOP_GUILE_INCS -DGLIBTOP_NAMES"
 | 
			
		||||
 | 
			
		||||
machine_incs="-I\$(top_srcdir)/sysdeps/$sysdeps_dir"
 | 
			
		||||
 | 
			
		||||
AC_SUBST(machine_incs)
 | 
			
		||||
 | 
			
		||||
if test x$libgtop_guile_found = xyes ; then
 | 
			
		||||
  guile_def="-DGLIBTOP_GUILE -DGLIBTOP_GUILE_NAMES $GUILE_INCS "
 | 
			
		||||
else
 | 
			
		||||
  guile_def=""
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
INCLUDES="-D_IN_LIBGTOP -D_GNU_SOURCE -DGLIBTOP_NAMES -I\$(top_builddir) -I\$(top_srcdir) -I\$(top_srcdir)/sysdeps/$sysdeps_dir -I\$(top_srcdir)/include -I\$(top_srcdir)/intl $SUPPORTINCS $GLIB_CFLAGS $CFLAGS $X_CFLAGS $guile_def "'-DGTOPLOCALEDIR=\"$(datadir)/locale\" -DLIBGTOP_VERSION=\"'"$LIBGTOP_VERSION"'\" -DLIBGTOP_SERVER_VERSION=\"'"$LIBGTOP_SERVER_VERSION"'\" -DLIBGTOP_SERVER=\"'"$LIBGTOP_SERVER"'\"'
 | 
			
		||||
 | 
			
		||||
AC_SUBST(INCLUDES)
 | 
			
		||||
 | 
			
		||||
AC_SUBST(LIBGTOP_EXTRA_LIBS)
 | 
			
		||||
 | 
			
		||||
AC_SUBST(LIBGTOP_LIBS)
 | 
			
		||||
AC_SUBST(LIBGTOP_INCS)
 | 
			
		||||
AC_SUBST(LIBGTOP_NAMES_LIBS)
 | 
			
		||||
AC_SUBST(LIBGTOP_NAMES_INCS)
 | 
			
		||||
AC_SUBST(LIBGTOP_GUILE_LIBS)
 | 
			
		||||
AC_SUBST(LIBGTOP_GUILE_INCS)
 | 
			
		||||
AC_SUBST(LIBGTOP_GUILE_NAMES_LIBS)
 | 
			
		||||
AC_SUBST(LIBGTOP_GUILE_NAMES_INCS)
 | 
			
		||||
AC_SUBST(LIBGTOP_BINDIR)
 | 
			
		||||
AC_SUBST(LIBGTOP_SERVER)
 | 
			
		||||
 | 
			
		||||
LIBSUPPORT=
 | 
			
		||||
SUPPORTINCS=
 | 
			
		||||
if test "$need_gnome_support" = yes; then
 | 
			
		||||
   if test "x$gnome_found" = xyes ; then
 | 
			
		||||
     LIBSUPPORT="$GNOME_LIBDIR -lgnomesupport"
 | 
			
		||||
     SUPPORTINCS="$GNOME_INCLUDEDIR"
 | 
			
		||||
   else
 | 
			
		||||
     LIBSUPPORT='$(top_builddir)/support/libgnomesupport.la'
 | 
			
		||||
     SUPPORTINCS='-DNEED_GNOMESUPPORT_H -I$(top_builddir)/support -I$(top_srcdir)/support'
 | 
			
		||||
   fi
 | 
			
		||||
if test x$libgtop_need_server = xyes ; then
 | 
			
		||||
   sysdeps_suid_lib="\$(top_builddir)/sysdeps/\$(sysdeps_dir)/libgtop_sysdeps_suid.la"
 | 
			
		||||
   server_programs='libgtop_server'
 | 
			
		||||
else
 | 
			
		||||
   sysdeps_suid_lib=
 | 
			
		||||
   server_programs=
 | 
			
		||||
fi
 | 
			
		||||
AC_SUBST(sysdeps_suid_lib)
 | 
			
		||||
AC_SUBST(server_programs)
 | 
			
		||||
 | 
			
		||||
AC_OUTPUT([
 | 
			
		||||
Makefile
 | 
			
		||||
po/Makefile.in
 | 
			
		||||
intl/Makefile
 | 
			
		||||
misc/Makefile
 | 
			
		||||
include/Makefile
 | 
			
		||||
include/glibtop/Makefile
 | 
			
		||||
sysdeps/Makefile
 | 
			
		||||
@@ -243,15 +363,16 @@ sysdeps/names/Makefile
 | 
			
		||||
sysdeps/guile/Makefile
 | 
			
		||||
sysdeps/guile/names/Makefile
 | 
			
		||||
sysdeps/stub/Makefile
 | 
			
		||||
sysdeps/stub_suid/Makefile
 | 
			
		||||
sysdeps/sun4/Makefile
 | 
			
		||||
sysdeps/osf1/Makefile
 | 
			
		||||
sysdeps/linux/Makefile
 | 
			
		||||
sysdeps/kernel/Makefile
 | 
			
		||||
sysdeps/freebsd/Makefile
 | 
			
		||||
src/Makefile
 | 
			
		||||
src/server/Makefile
 | 
			
		||||
src/proxy/Makefile
 | 
			
		||||
src/daemon/Makefile
 | 
			
		||||
src/inodedb/Makefile
 | 
			
		||||
lib/Makefile
 | 
			
		||||
examples/Makefile
 | 
			
		||||
support/Makefile
 | 
			
		||||
macros/Makefile],[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])
 | 
			
		||||
macros/Makefile])
 | 
			
		||||
 
 | 
			
		||||
@@ -1,22 +0,0 @@
 | 
			
		||||
*.shml
 | 
			
		||||
.timestamp
 | 
			
		||||
.timestamp2
 | 
			
		||||
.timestamp3
 | 
			
		||||
dbtohtml-1.shtml
 | 
			
		||||
dbtohtml-2.shtml
 | 
			
		||||
dbtohtml-3.shtml
 | 
			
		||||
dbtohtml.shtml
 | 
			
		||||
gnome-hackers
 | 
			
		||||
gnome-hackers.ced
 | 
			
		||||
libgtop
 | 
			
		||||
libgtop-1.shtml
 | 
			
		||||
libgtop-2.shtml
 | 
			
		||||
libgtop-3.shtml
 | 
			
		||||
libgtop-4.shtml
 | 
			
		||||
libgtop-5.shtml
 | 
			
		||||
libgtop-INDEX.shtml
 | 
			
		||||
libgtop-ref
 | 
			
		||||
libgtop-ref.ced
 | 
			
		||||
libgtop.ced
 | 
			
		||||
libgtop.fot
 | 
			
		||||
libgtop.shtml
 | 
			
		||||
							
								
								
									
										22
									
								
								doc/Makefile
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								doc/Makefile
									
									
									
									
									
								
							@@ -1,22 +0,0 @@
 | 
			
		||||
all:	.timestamp .timestamp2 .timestamp3
 | 
			
		||||
 | 
			
		||||
.timestamp:	libgtop.sgml
 | 
			
		||||
	rm -rf libgtop
 | 
			
		||||
	mkdir libgtop
 | 
			
		||||
	jade -D /usr/lib/sgml/jade_dsl -d libgtop.dsl -t sgml \
 | 
			
		||||
		-V %no-make-index% libgtop.sgml > /dev/null && \
 | 
			
		||||
		touch .timestamp
 | 
			
		||||
 | 
			
		||||
.timestamp2:	gnome-hackers.sgml
 | 
			
		||||
	rm -rf gnome-hackers
 | 
			
		||||
	mkdir gnome-hackers
 | 
			
		||||
	jade -D /usr/lib/sgml/jade_dsl -d gnome-hackers.dsl -t sgml \
 | 
			
		||||
		-V %no-make-index% gnome-hackers.sgml > /dev/null && \
 | 
			
		||||
		touch .timestamp2
 | 
			
		||||
 | 
			
		||||
.timestamp3:	libgtop-ref.sgml ../guile/reference.sgml
 | 
			
		||||
	rm -rf libgtop-ref
 | 
			
		||||
	mkdir libgtop-ref
 | 
			
		||||
	jade -D /usr/lib/sgml/jade_dsl -d libgtop-ref.dsl -t sgml \
 | 
			
		||||
		-V %no-make-index% libgtop-ref.sgml > /dev/null && \
 | 
			
		||||
		touch .timestamp3
 | 
			
		||||
@@ -1,3 +0,0 @@
 | 
			
		||||
PUBLIC "-//James Clark//DTD DSSSL Flow Object Tree//EN" "fot.dtd"
 | 
			
		||||
PUBLIC "ISO/IEC 10179:1996//DTD DSSSL Architecture//EN" "dsssl.dtd"
 | 
			
		||||
PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" "style-sheet.dtd"
 | 
			
		||||
							
								
								
									
										1627
									
								
								doc/dbtohtml.dsl
									
									
									
									
									
								
							
							
						
						
									
										1627
									
								
								doc/dbtohtml.dsl
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -1,12 +0,0 @@
 | 
			
		||||
<!doctype style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
 | 
			
		||||
<!ENTITY dbtohtml.dsl SYSTEM "dbtohtml.dsl" CDATA DSSSL >
 | 
			
		||||
]>
 | 
			
		||||
 | 
			
		||||
<style-specification id="gnomehackersdbotohtml" use="dbtohtml">
 | 
			
		||||
 | 
			
		||||
(define %output-basename% "gnome-hackers")
 | 
			
		||||
(define %output-directory% "gnome-hackers")
 | 
			
		||||
 | 
			
		||||
</style-specification>
 | 
			
		||||
 | 
			
		||||
<external-specification id="dbtohtml" document="dbtohtml.dsl">
 | 
			
		||||
@@ -1,393 +0,0 @@
 | 
			
		||||
<!-- $Id$ -->
 | 
			
		||||
 | 
			
		||||
<!doctype book PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
 | 
			
		||||
<!entity libgtopConf.sh SYSTEM "../libgtopConf.sh" >
 | 
			
		||||
]>
 | 
			
		||||
<book>
 | 
			
		||||
  <bookinfo>
 | 
			
		||||
    <title>Using LibGTop in the Gnome Project</title>
 | 
			
		||||
    <authorgroup>
 | 
			
		||||
      <author>
 | 
			
		||||
	<firstname>Martin</firstname>
 | 
			
		||||
	<surname>Baulig</surname>
 | 
			
		||||
	<affiliation>
 | 
			
		||||
	  <address>
 | 
			
		||||
	    <email>martin@home-of-linux.org</email>
 | 
			
		||||
	  </address>
 | 
			
		||||
	</affiliation>
 | 
			
		||||
      </author>
 | 
			
		||||
    </authorgroup>
 | 
			
		||||
    <copyright>
 | 
			
		||||
      <year>1998</year>
 | 
			
		||||
      <holder>Martin Baulig</holder>
 | 
			
		||||
    </copyright>
 | 
			
		||||
 | 
			
		||||
    <legalnotice>
 | 
			
		||||
 | 
			
		||||
      <para>
 | 
			
		||||
	This documentation is free software; you can redistribute
 | 
			
		||||
	it and/or modify it under the terms of the GNU General Public
 | 
			
		||||
	License as published by the Free Software Foundation; either
 | 
			
		||||
	version 2 of the License, or (at your option) any later
 | 
			
		||||
	version.
 | 
			
		||||
	
 | 
			
		||||
      <para>
 | 
			
		||||
	This library is distributed in the hope that it will be
 | 
			
		||||
	useful, but WITHOUT ANY WARRANTY; without even the implied
 | 
			
		||||
	warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 | 
			
		||||
	PURPOSE.  See the GNU General Public License for more
 | 
			
		||||
	details.
 | 
			
		||||
 | 
			
		||||
      <para>
 | 
			
		||||
	You should have received a copy of the GNU General Public
 | 
			
		||||
	License along with this program; if not, write to the Free
 | 
			
		||||
	Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 | 
			
		||||
	MA 02111-1307 USA
 | 
			
		||||
 | 
			
		||||
      <para>
 | 
			
		||||
	For more details see the file COPYING in the source
 | 
			
		||||
	distribution of LibGTop.</para>
 | 
			
		||||
 | 
			
		||||
    </legalnotice>
 | 
			
		||||
 | 
			
		||||
    <abstract>
 | 
			
		||||
 | 
			
		||||
      <para>
 | 
			
		||||
	This is a short introduction in how to use
 | 
			
		||||
	<productname>libgtop</productname> in the GNOME project.
 | 
			
		||||
	It describes the additional options <filename>configure</filename>
 | 
			
		||||
	takes and the information stored in the automatically generated
 | 
			
		||||
	<filename>libgtopConf.sh</filename> configuration script.
 | 
			
		||||
 | 
			
		||||
    </abstract>
 | 
			
		||||
 | 
			
		||||
  </bookinfo>
 | 
			
		||||
 | 
			
		||||
  <toc></toc>
 | 
			
		||||
 | 
			
		||||
  <chapter id="macros">
 | 
			
		||||
    <title>Autoconf macros</title>
 | 
			
		||||
 | 
			
		||||
    <sect1 id="gnome-libgtop-check">
 | 
			
		||||
      <title><filename>macros/gnome-libgtop-check.m4</filename></title>
 | 
			
		||||
 | 
			
		||||
      <para>
 | 
			
		||||
	Contains all that you need to include libgtop in any Gnome application. It defines
 | 
			
		||||
	<function>GNOME_INIT_LIBGTOP</function> which you can use in the same way like
 | 
			
		||||
	<function>GNOME_INIT</function> to check whether libgtop is installed and to read
 | 
			
		||||
	its <filename>libgtopConf.sh</filename> script. It automatically invokes
 | 
			
		||||
	<function>GNOME_LIBGTOP_SYSDEPS</function>.
 | 
			
		||||
 | 
			
		||||
      <para>
 | 
			
		||||
	When libgtop can be found, it defines <parameter>HAVE_LIBGTOP</parameter>. There's
 | 
			
		||||
	also an automake conditional <parameter>HAVE_LIBGTOP</parameter> which you can use.
 | 
			
		||||
 | 
			
		||||
    <sect1 id="gnome-libgtop-sysdeps">
 | 
			
		||||
      <title><filename>macros/gnome-libgtop-sysdeps.m4</filename></title>
 | 
			
		||||
 | 
			
		||||
      <para>
 | 
			
		||||
	This file defines <function>GNOME_LIBGTOP_SYSDEPS</function> which you can
 | 
			
		||||
	use to check which sysdeps directory <productname>libgtop</productname> should
 | 
			
		||||
	use and whether the <filename>gtop_server</filename> is needed.
 | 
			
		||||
 | 
			
		||||
      <para>
 | 
			
		||||
	It defines the following variables:
 | 
			
		||||
	
 | 
			
		||||
	<variablelist>
 | 
			
		||||
	      
 | 
			
		||||
	  <varlistentry>
 | 
			
		||||
	    <term><parameter>libgtop_sysdeps_dir</parameter>
 | 
			
		||||
		  
 | 
			
		||||
	    <listitem>
 | 
			
		||||
	      <para>
 | 
			
		||||
		The sysdeps dir <productname>libgtop</productname> uses.
 | 
			
		||||
		    
 | 
			
		||||
	  <varlistentry>
 | 
			
		||||
	    <term><parameter>libgtop_use_machine_h</parameter></term>
 | 
			
		||||
 | 
			
		||||
	    <listitem>
 | 
			
		||||
	      <para>
 | 
			
		||||
		Some of the system dependent parts of <productname>libgtop</productname>
 | 
			
		||||
		provide a structure <structname>_glibtop_machine</structname> defined in
 | 
			
		||||
		a header file <filename>glibtop_machine.h</filename> they provide. This
 | 
			
		||||
		structure gets inserted into the <structfield>machine</structfield> member
 | 
			
		||||
		of <structname>_glibtop</structname> when <filename>config.h</filename>
 | 
			
		||||
		defines <parameter>HAVE_GLIBTOP_MACHINE_H</parameter>.
 | 
			
		||||
 | 
			
		||||
	      <para>
 | 
			
		||||
		This variable is either <literal>yes</literal> or <literal>no</literal> and
 | 
			
		||||
		tells you whether this is the case. If it is true, this macro wil automatically
 | 
			
		||||
		define <parameter>HAVE_GLIBTOP_MACHINE_H</parameter>.
 | 
			
		||||
 | 
			
		||||
	  <varlistentry>
 | 
			
		||||
	    <term><parameter>libgtop_need_server</parameter></term>
 | 
			
		||||
 | 
			
		||||
	    <listitem>
 | 
			
		||||
	      <para>
 | 
			
		||||
		Is either <literal>yes</literal> or <literal>no</literal> and tells you
 | 
			
		||||
		whether the server is needed. If it is needed, it will automatically
 | 
			
		||||
		define <parameter>NEED_LIBGTOP</parameter>.
 | 
			
		||||
 | 
			
		||||
	      <para>
 | 
			
		||||
		This macro also provides a conditional <parameter>NEED_LIBGTOP</parameter>
 | 
			
		||||
		which you can use in you <filename>Makefile.am</filename>.
 | 
			
		||||
 | 
			
		||||
	</variablelist>
 | 
			
		||||
 | 
			
		||||
    </sect1>
 | 
			
		||||
    
 | 
			
		||||
  <chapter id="configure">
 | 
			
		||||
    <title>Configuration</title>
 | 
			
		||||
 | 
			
		||||
    <para>
 | 
			
		||||
      The <filename>configure</filename> script of <productname>libgtop</productname>
 | 
			
		||||
      takes some non-standard options to let you decide which parts of the library
 | 
			
		||||
      should be build.
 | 
			
		||||
 | 
			
		||||
      <itemizedlist>
 | 
			
		||||
	<listitem>
 | 
			
		||||
 | 
			
		||||
	  <para>
 | 
			
		||||
	    Normally, <filename>configure</filename> decides whether or not using the
 | 
			
		||||
	    server is required. Depending upon this decision, it adds either
 | 
			
		||||
	    <literal>-lgtop</literal> (when it's needed) or
 | 
			
		||||
	    <literal>-lgtop_systems</literal> (when it's not needed) to
 | 
			
		||||
	    <parameter>LIBGTOP_LIBS</parameter> and <parameter>LIBGTOP_GUILE_LIBS</parameter>.
 | 
			
		||||
 | 
			
		||||
	  <para>
 | 
			
		||||
	    You can change this behaviour with the following options:
 | 
			
		||||
 | 
			
		||||
	    <variablelist>
 | 
			
		||||
	      
 | 
			
		||||
	      <varlistentry>
 | 
			
		||||
		<term><parameter>--enable-libgtop-server</parameter>
 | 
			
		||||
		  
 | 
			
		||||
		<listitem>
 | 
			
		||||
		  <para>
 | 
			
		||||
		    Use the server regardless whether or not it is required.
 | 
			
		||||
		    
 | 
			
		||||
	      <varlistentry>
 | 
			
		||||
		<term><parameter>--disable-libgtop-server</parameter></term>
 | 
			
		||||
		
 | 
			
		||||
		<listitem>
 | 
			
		||||
		  <para>
 | 
			
		||||
		    Do not use the server regardless wheter or not it is required.
 | 
			
		||||
		    
 | 
			
		||||
	    </variablelist>
 | 
			
		||||
 | 
			
		||||
	<listitem>
 | 
			
		||||
 | 
			
		||||
	  <para>
 | 
			
		||||
	    Normally, the guile interface of <productname>libgtop</productname> is build
 | 
			
		||||
	    when <productname>guile</productname> can be found on the system.
 | 
			
		||||
 | 
			
		||||
	    <variablelist>
 | 
			
		||||
	      
 | 
			
		||||
	      <varlistentry>
 | 
			
		||||
		<term><parameter>--disable-libgtop-guile</parameter>
 | 
			
		||||
		  
 | 
			
		||||
		<listitem>
 | 
			
		||||
		  <para>
 | 
			
		||||
		    Disables building the guile interface even if you have
 | 
			
		||||
		    <productname>guile</productname> installed.
 | 
			
		||||
		    
 | 
			
		||||
	      <varlistentry>
 | 
			
		||||
		<term><parameter>--enable-libgtop-guile</parameter></term>
 | 
			
		||||
		
 | 
			
		||||
		<listitem>
 | 
			
		||||
		  <para>
 | 
			
		||||
		    Has no effect at all since you cannot build the guile interface without
 | 
			
		||||
		    having <productname>guile</productname> installed on your system.
 | 
			
		||||
		    
 | 
			
		||||
	    </variablelist>
 | 
			
		||||
 | 
			
		||||
	<listitem>
 | 
			
		||||
 | 
			
		||||
	  <para>
 | 
			
		||||
	    If you do not need the <filename>names</filename> subdirs, you can disable
 | 
			
		||||
	    their building with the following option:
 | 
			
		||||
 | 
			
		||||
	    <variablelist>
 | 
			
		||||
	      
 | 
			
		||||
	      <varlistentry>
 | 
			
		||||
		<term><parameter>--disable-libgtop-names</parameter>
 | 
			
		||||
		  
 | 
			
		||||
		<listitem>
 | 
			
		||||
		  <para>
 | 
			
		||||
		    Disables building of the <filename>names</filename> subdirs.
 | 
			
		||||
		    
 | 
			
		||||
	      <varlistentry>
 | 
			
		||||
		<term><parameter>--enable-libgtop-names</parameter></term>
 | 
			
		||||
		
 | 
			
		||||
		<listitem>
 | 
			
		||||
		  <para>
 | 
			
		||||
		    Is the default.
 | 
			
		||||
		    
 | 
			
		||||
	    </variablelist>
 | 
			
		||||
 | 
			
		||||
	  <para>
 | 
			
		||||
	    If it is enables, <parameter>GLIBTOP_NAMES</parameter> will be defined.
 | 
			
		||||
 | 
			
		||||
	<listitem>
 | 
			
		||||
 | 
			
		||||
	  <para>
 | 
			
		||||
	    To disable building of the examples, you can say:
 | 
			
		||||
 | 
			
		||||
	    <variablelist>
 | 
			
		||||
	      
 | 
			
		||||
	      <varlistentry>
 | 
			
		||||
		<term><parameter>--without-examples</parameter>
 | 
			
		||||
		  
 | 
			
		||||
		<listitem>
 | 
			
		||||
		  <para>
 | 
			
		||||
		    Disables building of the examples.
 | 
			
		||||
		    
 | 
			
		||||
	    </variablelist>
 | 
			
		||||
 | 
			
		||||
      </itemizedlist>
 | 
			
		||||
    
 | 
			
		||||
  <chapter id="libgtopConf">
 | 
			
		||||
    <title>The <filename>libgtopConf.sh</filename> script</title>
 | 
			
		||||
 | 
			
		||||
    <para>
 | 
			
		||||
      After a successful build of <productname>libgtop</productname>, a
 | 
			
		||||
      <filename>libgtopConf.sh</filename> script is generated which will later
 | 
			
		||||
      be used to decide how to link a program with <filename>libgtop</filename>.
 | 
			
		||||
 | 
			
		||||
    <para>
 | 
			
		||||
      It defines the following variables:
 | 
			
		||||
 | 
			
		||||
      <variablelist>
 | 
			
		||||
	      
 | 
			
		||||
	<varlistentry>
 | 
			
		||||
	  <term><parameter>LIBGTOP_LIBDIR</parameter>
 | 
			
		||||
		  
 | 
			
		||||
	  <listitem>
 | 
			
		||||
	    <para>
 | 
			
		||||
	      Defaults to <literal>$(prefix)/lib</literal>. It is the directory
 | 
			
		||||
	      where the <productname>libgtop</productname> libraries get installed.
 | 
			
		||||
 | 
			
		||||
	<varlistentry>
 | 
			
		||||
	  <term><parameter>LIBGTOP_INCLUDEDIR</parameter></term>
 | 
			
		||||
		
 | 
			
		||||
	  <listitem>
 | 
			
		||||
	    <para>
 | 
			
		||||
	      Defaults to <literal>$(prefix)/include</literal>. It is the directory
 | 
			
		||||
	      where the <productname>libgtop</productname> header files get installed.
 | 
			
		||||
 | 
			
		||||
	<varlistentry>
 | 
			
		||||
	  <term><parameter>LIBGTOP_LIBS</parameter></term>
 | 
			
		||||
	  
 | 
			
		||||
	  <listitem>
 | 
			
		||||
	    <para>
 | 
			
		||||
	      Contains everything that you need to add to the <parameter>_LDADD</parameter>
 | 
			
		||||
	      variable of <productname>automake</productname> to link a program with
 | 
			
		||||
	      <productname>libgtop</productname>.
 | 
			
		||||
 | 
			
		||||
	<varlistentry>
 | 
			
		||||
	  <term><parameter>LIBGTOP_INCS</parameter></term>
 | 
			
		||||
	  
 | 
			
		||||
	  <listitem>
 | 
			
		||||
	    <para>
 | 
			
		||||
	      Contains everything that you need to add to the <parameter>_INCLUDES</parameter>
 | 
			
		||||
	      variable of <productname>automake</productname> to compile a program that uses
 | 
			
		||||
	      <productname>libgtop</productname>.
 | 
			
		||||
 | 
			
		||||
	<varlistentry>
 | 
			
		||||
	  <term><parameter>LIBGTOP_GUILE_INCS</parameter></term>
 | 
			
		||||
	  
 | 
			
		||||
	  <listitem>
 | 
			
		||||
	    <para>
 | 
			
		||||
	      Contains everything that you need to add to the <parameter>_INCLUDES</parameter>
 | 
			
		||||
	      variable of <productname>automake</productname> to compile a program that uses both
 | 
			
		||||
	      <productname>libgtop</productname> and its guile interface.
 | 
			
		||||
 | 
			
		||||
	<varlistentry>
 | 
			
		||||
	  <term><parameter>LIBGTOP_BINDIR</parameter></term>
 | 
			
		||||
	  
 | 
			
		||||
	  <listitem>
 | 
			
		||||
	    <para>
 | 
			
		||||
	      Defaults to <literal>$(bindir)</literal>. It is the directory where the
 | 
			
		||||
	      <productname>libgtop</productname> binaries get installed.
 | 
			
		||||
 | 
			
		||||
	<varlistentry>
 | 
			
		||||
	  <term><parameter>LIBGTOP_SERVER</parameter></term>
 | 
			
		||||
	  
 | 
			
		||||
	  <listitem>
 | 
			
		||||
	    <para>
 | 
			
		||||
	      Defaults to <literal>$(bindir)/gtop_server</literal>. It is the full pathname
 | 
			
		||||
	      where the server gets installed.
 | 
			
		||||
 | 
			
		||||
	<varlistentry>
 | 
			
		||||
	  <term><parameter>libgtop_sysdeps_dir</parameter></term>
 | 
			
		||||
	  
 | 
			
		||||
	  <listitem>
 | 
			
		||||
	    <para>
 | 
			
		||||
	      The sysdeps directory that is used on your system.
 | 
			
		||||
 | 
			
		||||
	<varlistentry>
 | 
			
		||||
	  <term><parameter>libgtop_need_server</parameter></term>
 | 
			
		||||
	  
 | 
			
		||||
	  <listitem>
 | 
			
		||||
	    <para>
 | 
			
		||||
	      Is either <literal>yes</literal> or <literal>no</literal> and tells you
 | 
			
		||||
	      whether using the server is needed or not.
 | 
			
		||||
 | 
			
		||||
	<varlistentry>
 | 
			
		||||
	  <term><parameter>libgtop_use_machine_h</parameter></term>
 | 
			
		||||
	  
 | 
			
		||||
	  <listitem>
 | 
			
		||||
	    <para>
 | 
			
		||||
	      Is either <literal>yes</literal> or <literal>no</literal> and tells you
 | 
			
		||||
	      whether <filename>glibtop_machine_h</filename> should be included in
 | 
			
		||||
	      <filename>glibtop.h</filename>.
 | 
			
		||||
 | 
			
		||||
	      The system dependent part of the library may provide an additional header
 | 
			
		||||
	      file, <filename>glibtop_machine_h</filename>. In this case, they define
 | 
			
		||||
	      a structure <structname>_glibtop_machine</structname> in this header file.
 | 
			
		||||
	      This structure represents the <structfield>machine</structfield> member of
 | 
			
		||||
	      <structname>_glibtop</structname>.
 | 
			
		||||
 | 
			
		||||
	<varlistentry>
 | 
			
		||||
	  <term><parameter>libgtop_guile_found</parameter></term>
 | 
			
		||||
	  
 | 
			
		||||
	  <listitem>
 | 
			
		||||
	    <para>
 | 
			
		||||
	      Is either <literal>yes</literal> or <literal>no</literal> and tells you
 | 
			
		||||
	      whether <productname>guile</productname> has been found on your system
 | 
			
		||||
	      (or if building the guile interface was disabled).
 | 
			
		||||
 | 
			
		||||
	<varlistentry>
 | 
			
		||||
	  <term><parameter>libgtop_want_names</parameter></term>
 | 
			
		||||
	  
 | 
			
		||||
	  <listitem>
 | 
			
		||||
	    <para>
 | 
			
		||||
	      Is either <literal>yes</literal> or <literal>no</literal> and tells you
 | 
			
		||||
	      whether the <filename>sysdeps/names</filename> subdirectory was build.
 | 
			
		||||
 | 
			
		||||
	<varlistentry>
 | 
			
		||||
	  <term><parameter>libgtop_want_guile_names</parameter></term>
 | 
			
		||||
	  
 | 
			
		||||
	  <listitem>
 | 
			
		||||
	    <para>
 | 
			
		||||
	      Is either <literal>yes</literal> or <literal>no</literal> and tells you
 | 
			
		||||
	      whether the <filename>sysdeps/guile/names</filename> subdirectory was build.
 | 
			
		||||
 | 
			
		||||
	<varlistentry>
 | 
			
		||||
	  <term><parameter>libgtop_want_examples</parameter></term>
 | 
			
		||||
	  
 | 
			
		||||
	  <listitem>
 | 
			
		||||
	    <para>
 | 
			
		||||
	      Is either <literal>yes</literal> or <literal>no</literal> and tells you
 | 
			
		||||
	      whether the examples were build.
 | 
			
		||||
 | 
			
		||||
      </variablelist>
 | 
			
		||||
 | 
			
		||||
      <example>
 | 
			
		||||
	<title>Sample <filename>libgtopConf.sh</filename></title>
 | 
			
		||||
 | 
			
		||||
	<programlisting>&libgtopConf.sh;</programlisting>
 | 
			
		||||
      </example>
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
</book>
 | 
			
		||||
@@ -1,12 +0,0 @@
 | 
			
		||||
<!doctype style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
 | 
			
		||||
<!ENTITY dbtohtml.dsl SYSTEM "dbtohtml.dsl" CDATA DSSSL >
 | 
			
		||||
]>
 | 
			
		||||
 | 
			
		||||
<style-specification id="libgtoprefdbtohtml" use="dbtohtml">
 | 
			
		||||
 | 
			
		||||
(define %output-basename% "libgtop-ref")
 | 
			
		||||
(define %output-directory% "libgtop-ref")
 | 
			
		||||
 | 
			
		||||
</style-specification>
 | 
			
		||||
 | 
			
		||||
<external-specification id="dbtohtml" document="dbtohtml.dsl">
 | 
			
		||||
@@ -1,67 +0,0 @@
 | 
			
		||||
<!-- $Id$ -->
 | 
			
		||||
 | 
			
		||||
<!doctype book PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
 | 
			
		||||
<!entity reference.sgml SYSTEM "../guile/reference.sgml" >
 | 
			
		||||
]>
 | 
			
		||||
<book>
 | 
			
		||||
  <bookinfo>
 | 
			
		||||
    <title>LibGTop Reference Manual</title>
 | 
			
		||||
    <authorgroup>
 | 
			
		||||
      <author>
 | 
			
		||||
	<firstname>Martin</firstname>
 | 
			
		||||
	<surname>Baulig</surname>
 | 
			
		||||
	<affiliation>
 | 
			
		||||
	  <address>
 | 
			
		||||
	    <email>martin@home-of-linux.org</email>
 | 
			
		||||
	  </address>
 | 
			
		||||
	</affiliation>
 | 
			
		||||
      </author>
 | 
			
		||||
    </authorgroup>
 | 
			
		||||
    <abstract>
 | 
			
		||||
      <para>
 | 
			
		||||
	<literal>$Id$</literal>
 | 
			
		||||
 | 
			
		||||
      <para>
 | 
			
		||||
	This reference manual is automatically generated from <filename>doc/make-docbook.scm</filename>.
 | 
			
		||||
	It uses the guile interface of <productname>libgtop</productname> to get the names of all
 | 
			
		||||
	features the library defines and a description of the structures.
 | 
			
		||||
    </abstract>
 | 
			
		||||
 | 
			
		||||
    <copyright>
 | 
			
		||||
      <year>1998</year>
 | 
			
		||||
      <holder>Martin Baulig</holder>
 | 
			
		||||
    </copyright>
 | 
			
		||||
    <legalnotice>
 | 
			
		||||
 | 
			
		||||
      <para>
 | 
			
		||||
	This documentation is free software; you can redistribute
 | 
			
		||||
	it and/or modify it under the terms of the GNU General Public
 | 
			
		||||
	License as published by the Free Software Foundation; either
 | 
			
		||||
	version 2 of the License, or (at your option) any later
 | 
			
		||||
	version.
 | 
			
		||||
	
 | 
			
		||||
      <para>
 | 
			
		||||
	This library is distributed in the hope that it will be
 | 
			
		||||
	useful, but WITHOUT ANY WARRANTY; without even the implied
 | 
			
		||||
	warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 | 
			
		||||
	PURPOSE.  See the GNU General Public License for more
 | 
			
		||||
	details.
 | 
			
		||||
 | 
			
		||||
      <para>
 | 
			
		||||
	You should have received a copy of the GNU General Public
 | 
			
		||||
	License along with this program; if not, write to the Free
 | 
			
		||||
	Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 | 
			
		||||
	MA 02111-1307 USA
 | 
			
		||||
 | 
			
		||||
      <para>
 | 
			
		||||
	For more details see the file COPYING in the source
 | 
			
		||||
	distribution of LibGTop.</para>
 | 
			
		||||
 | 
			
		||||
    </legalnotice>
 | 
			
		||||
  </bookinfo>
 | 
			
		||||
  
 | 
			
		||||
  <toc></toc>
 | 
			
		||||
  
 | 
			
		||||
    &reference.sgml;
 | 
			
		||||
 | 
			
		||||
</book>
 | 
			
		||||
@@ -1,12 +0,0 @@
 | 
			
		||||
<!doctype style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
 | 
			
		||||
<!ENTITY dbtohtml.dsl SYSTEM "dbtohtml.dsl" CDATA DSSSL >
 | 
			
		||||
]>
 | 
			
		||||
 | 
			
		||||
<style-specification id="libgtopdbtohtml" use="dbtohtml">
 | 
			
		||||
 | 
			
		||||
(define %output-basename% "libgtop")
 | 
			
		||||
(define %output-directory% "libgtop")
 | 
			
		||||
 | 
			
		||||
</style-specification>
 | 
			
		||||
 | 
			
		||||
<external-specification id="dbtohtml" document="dbtohtml.dsl">
 | 
			
		||||
							
								
								
									
										1332
									
								
								doc/libgtop.sgml
									
									
									
									
									
								
							
							
						
						
									
										1332
									
								
								doc/libgtop.sgml
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -1,3 +1,54 @@
 | 
			
		||||
1998-11-22  Martin Baulig  <baulig@taurus.uni-trier.de>
 | 
			
		||||
 | 
			
		||||
	* netload.c: Call inet_ntoa () to get address and subnet
 | 
			
		||||
	in quatted dot notation (like 136.199.14.201) and not just
 | 
			
		||||
	as a number (like 0xc90ec788).
 | 
			
		||||
 | 
			
		||||
1998-11-02  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* sysdeps.c: New example.
 | 
			
		||||
 | 
			
		||||
1998-10-26  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* netload.c: New file. Gets network load for the interface
 | 
			
		||||
	given as command line argument.
 | 
			
		||||
 | 
			
		||||
1998-10-26  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* first.c (glibtop_get_proc_args): Get command line arguments.
 | 
			
		||||
	* second.c: Likewise.
 | 
			
		||||
 | 
			
		||||
1998-10-25  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* first.c (glibtop_get_ppp): Get PPP/ISDN statistics.
 | 
			
		||||
 | 
			
		||||
1998-09-28  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* Makefile.am: Install everything in $(libexecdir)/libgtop.
 | 
			
		||||
 | 
			
		||||
1998-09-09  Martin Baulig <baulig@Stud.Informatik.uni-trier.de>
 | 
			
		||||
 | 
			
		||||
	* smp.c: New file. Nice tool to show CPU statistics on SMP systems.
 | 
			
		||||
 | 
			
		||||
1998-08-25  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* first.c, second.c, procmap.c: Fixed some compiler warnings.
 | 
			
		||||
 | 
			
		||||
1998-08-18  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* procmap.c: We now display filenames when compiled
 | 
			
		||||
	`--with-libgtop-inodedb'.
 | 
			
		||||
 | 
			
		||||
1998-08-12  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* second.c: Works a little bit more like `ps' - you can
 | 
			
		||||
	give an optional command line argument to get information
 | 
			
		||||
	about a single process.
 | 
			
		||||
 | 
			
		||||
1998-07-22  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* mountlist.c: New file.
 | 
			
		||||
 | 
			
		||||
1998-06-12  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* test.scm: New file.
 | 
			
		||||
 
 | 
			
		||||
@@ -2,24 +2,29 @@
 | 
			
		||||
 | 
			
		||||
LINK			= $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
 | 
			
		||||
 | 
			
		||||
INCLUDES		= -I$(top_builddir) -I$(top_srcdir) @machine_incs@ \
 | 
			
		||||
			  -I$(top_srcdir)/include -I$(top_srcdir)/intl @GUILE_INCS@ \
 | 
			
		||||
			  -DGTOPLOCALEDIR=\"$(datadir)/locale\" -D_GNU_SOURCE
 | 
			
		||||
 | 
			
		||||
CFLAGS			= -Wall -W @CFLAGS@ -O0
 | 
			
		||||
 | 
			
		||||
DEFS			= @DEFS@
 | 
			
		||||
 | 
			
		||||
bin_PROGRAMS		= first first_static second second_static \
 | 
			
		||||
			  @guile_examples@
 | 
			
		||||
# We install it in `libexec' since this will make it more easy
 | 
			
		||||
# to put the examples into an extra RPM package.
 | 
			
		||||
 | 
			
		||||
EXTRA_PROGRAMS		= third third_static
 | 
			
		||||
libgtopdir		= $(libexecdir)/libgtop
 | 
			
		||||
 | 
			
		||||
libgtop_PROGRAMS	= first second\
 | 
			
		||||
			  mountlist procmap netload sysdeps\
 | 
			
		||||
			  @static_targets@ @guile_examples@ @smp_examples@
 | 
			
		||||
 | 
			
		||||
EXTRA_PROGRAMS		= first_static second_static \
 | 
			
		||||
			  mountlist_static procmap_static \
 | 
			
		||||
			  third third_static smp smp_static \
 | 
			
		||||
			  netload_static sysdeps_static
 | 
			
		||||
 | 
			
		||||
first_SOURCES		= first.c
 | 
			
		||||
first_LDADD		= $(top_builddir)/lib/libgtop.la \
 | 
			
		||||
			  $(top_builddir)/sysdeps/common/libgtop_common.la \
 | 
			
		||||
			  $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \
 | 
			
		||||
			  @INTLLIBS@ @LIBSUPPORT@ @libs_xauth@
 | 
			
		||||
			  @INTLLIBS@ @LIBSUPPORT@
 | 
			
		||||
 | 
			
		||||
first_static_SOURCES	= $(first_SOURCES)
 | 
			
		||||
first_static_LDADD	= $(first_LDADD)
 | 
			
		||||
@@ -29,16 +34,46 @@ second_SOURCES		= second.c
 | 
			
		||||
second_LDADD		= $(top_builddir)/lib/libgtop.la \
 | 
			
		||||
			  $(top_builddir)/sysdeps/common/libgtop_common.la \
 | 
			
		||||
			  $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \
 | 
			
		||||
			  @INTLLIBS@ @LIBSUPPORT@ @libs_xauth@
 | 
			
		||||
			  @INTLLIBS@ @LIBSUPPORT@
 | 
			
		||||
 | 
			
		||||
second_static_SOURCES	= $(second_SOURCES)
 | 
			
		||||
second_static_LDADD	= $(second_LDADD)
 | 
			
		||||
second_static_LDFLAGS	= -static
 | 
			
		||||
 | 
			
		||||
if GLIBTOP_NAMES
 | 
			
		||||
procmap_SOURCES		= procmap.c
 | 
			
		||||
procmap_LDADD		= $(top_builddir)/lib/libgtop.la \
 | 
			
		||||
			  $(top_builddir)/sysdeps/common/libgtop_common.la \
 | 
			
		||||
			  $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \
 | 
			
		||||
			  @INTLLIBS@ @LIBSUPPORT@
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
procmap_static_SOURCES	= $(procmap_SOURCES)
 | 
			
		||||
procmap_static_LDADD	= $(procmap_LDADD)
 | 
			
		||||
procmap_static_LDFLAGS	= -static
 | 
			
		||||
 | 
			
		||||
netload_SOURCES		= netload.c
 | 
			
		||||
netload_LDADD		= $(top_builddir)/lib/libgtop.la \
 | 
			
		||||
			  $(top_builddir)/sysdeps/common/libgtop_common.la \
 | 
			
		||||
			  $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \
 | 
			
		||||
			  @INTLLIBS@ @LIBSUPPORT@
 | 
			
		||||
 | 
			
		||||
netload_static_SOURCES	= $(netload_SOURCES)
 | 
			
		||||
netload_static_LDADD	= $(netload_LDADD)
 | 
			
		||||
netload_static_LDFLAGS	= -static
 | 
			
		||||
 | 
			
		||||
sysdeps_SOURCES		= sysdeps.c
 | 
			
		||||
sysdeps_LDADD		= $(top_builddir)/lib/libgtop.la \
 | 
			
		||||
			  $(top_builddir)/sysdeps/common/libgtop_common.la \
 | 
			
		||||
			  $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \
 | 
			
		||||
			  @INTLLIBS@ @LIBSUPPORT@
 | 
			
		||||
 | 
			
		||||
sysdeps_static_SOURCES	= $(sysdeps_SOURCES)
 | 
			
		||||
sysdeps_static_LDADD	= $(sysdeps_LDADD)
 | 
			
		||||
sysdeps_static_LDFLAGS	= -static
 | 
			
		||||
 | 
			
		||||
third_guile_names_LIBS	= $(top_builddir)/sysdeps/guile/names/libgtop_guile_names.la
 | 
			
		||||
third_names_LIBS	= $(top_builddir)/sysdeps/names/libgtop_names.la
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
third_SOURCES		= third.c
 | 
			
		||||
third_LDADD		= $(top_builddir)/sysdeps/guile/libgtop_guile.la \
 | 
			
		||||
@@ -46,8 +81,30 @@ third_LDADD		= $(top_builddir)/sysdeps/guile/libgtop_guile.la \
 | 
			
		||||
			  $(top_builddir)/lib/libgtop.la \
 | 
			
		||||
			  $(top_builddir)/sysdeps/common/libgtop_common.la \
 | 
			
		||||
			  $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \
 | 
			
		||||
			  @GUILE_LIBS@ @INTLLIBS@ @LIBSUPPORT@ @libs_xauth@
 | 
			
		||||
			  @GUILE_LIBS@ @INTLLIBS@ @LIBSUPPORT@
 | 
			
		||||
 | 
			
		||||
third_static_SOURCES	= $(third_SOURCES)
 | 
			
		||||
third_static_LDADD	= $(third_LDADD)
 | 
			
		||||
third_static_LDFLAGS	= -static
 | 
			
		||||
 | 
			
		||||
mountlist_SOURCES	= mountlist.c
 | 
			
		||||
mountlist_LDADD		= $(top_builddir)/lib/libgtop.la \
 | 
			
		||||
			  $(top_builddir)/sysdeps/common/libgtop_common.la \
 | 
			
		||||
			  $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \
 | 
			
		||||
			  @INTLLIBS@ @LIBSUPPORT@
 | 
			
		||||
 | 
			
		||||
mountlist_static_SOURCES= $(mountlist_SOURCES)
 | 
			
		||||
mountlist_static_LDADD	= $(mountlist_LDADD)
 | 
			
		||||
mountlist_static_LDFLAGS= -static
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
smp_SOURCES		= smp.c
 | 
			
		||||
smp_LDADD		= $(top_builddir)/lib/libgtop.la \
 | 
			
		||||
			  $(top_builddir)/sysdeps/common/libgtop_common.la \
 | 
			
		||||
			  $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \
 | 
			
		||||
			  @INTLLIBS@ @LIBSUPPORT@
 | 
			
		||||
 | 
			
		||||
smp_static_SOURCES	= $(smp_SOURCES)
 | 
			
		||||
smp_static_LDADD	= $(smp_LDADD)
 | 
			
		||||
smp_static_LDFLAGS	= -static
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										589
									
								
								examples/first.c
									
									
									
									
									
								
							
							
						
						
									
										589
									
								
								examples/first.c
									
									
									
									
									
								
							@@ -31,8 +31,10 @@
 | 
			
		||||
#include <glibtop/union.h>
 | 
			
		||||
#include <glibtop/sysdeps.h>
 | 
			
		||||
 | 
			
		||||
#include <sys/resource.h>
 | 
			
		||||
 | 
			
		||||
#ifndef PROFILE_COUNT
 | 
			
		||||
#define PROFILE_COUNT	1000
 | 
			
		||||
#define PROFILE_COUNT	1
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
@@ -43,6 +45,7 @@ main (int argc, char *argv [])
 | 
			
		||||
	unsigned c, method, count, port, i, *ptr;
 | 
			
		||||
	char buffer [BUFSIZ];
 | 
			
		||||
	pid_t pid, ppid;
 | 
			
		||||
	char *args;
 | 
			
		||||
 | 
			
		||||
	count = PROFILE_COUNT;
 | 
			
		||||
 | 
			
		||||
@@ -68,90 +71,157 @@ main (int argc, char *argv [])
 | 
			
		||||
 | 
			
		||||
	printf ("Host = '%s' - %u\n\n", buffer, port);
 | 
			
		||||
 | 
			
		||||
	glibtop_init_r (&glibtop_global_server, 0, 0);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
	  	glibtop_get_cpu (&data.cpu);
 | 
			
		||||
 | 
			
		||||
	printf ("CPU          (0x%08lx): %lu, %lu, %lu, %lu, %lu, %lu\n",
 | 
			
		||||
		data.cpu.flags, data.cpu.total, data.cpu.user, data.cpu.nice,
 | 
			
		||||
		data.cpu.sys, data.cpu.idle, data.cpu.frequency);
 | 
			
		||||
		(unsigned long) data.cpu.flags,
 | 
			
		||||
		(unsigned long) data.cpu.total,
 | 
			
		||||
		(unsigned long) data.cpu.user,
 | 
			
		||||
		(unsigned long) data.cpu.nice,
 | 
			
		||||
		(unsigned long) data.cpu.sys,
 | 
			
		||||
		(unsigned long) data.cpu.idle,
 | 
			
		||||
		(unsigned long) data.cpu.frequency);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_mem (&data.mem);
 | 
			
		||||
 | 
			
		||||
	printf ("Memory       (0x%08lx): %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu\n",
 | 
			
		||||
		data.mem.flags, data.mem.total, data.mem.used, data.mem.free,
 | 
			
		||||
		data.mem.shared, data.mem.buffer, data.mem.cached,
 | 
			
		||||
		data.mem.user, data.mem.locked);
 | 
			
		||||
	printf ("Memory       (0x%08lx): "
 | 
			
		||||
		"%lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu\n",
 | 
			
		||||
		(unsigned long) data.mem.flags,
 | 
			
		||||
		(unsigned long) data.mem.total,
 | 
			
		||||
		(unsigned long) data.mem.used,
 | 
			
		||||
		(unsigned long) data.mem.free,
 | 
			
		||||
		(unsigned long) data.mem.shared,
 | 
			
		||||
		(unsigned long) data.mem.buffer,
 | 
			
		||||
		(unsigned long) data.mem.cached,
 | 
			
		||||
		(unsigned long) data.mem.user,
 | 
			
		||||
		(unsigned long) data.mem.locked);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_swap (&data.swap);
 | 
			
		||||
 | 
			
		||||
	printf ("Swap         (0x%08lx): %lu, %lu, %lu\n", data.swap.flags,
 | 
			
		||||
		data.swap.total, data.swap.used, data.swap.free);
 | 
			
		||||
	printf ("Swap         (0x%08lx): %lu, %lu, %lu, %lu, %lu\n",
 | 
			
		||||
		(unsigned long) data.swap.flags,
 | 
			
		||||
		(unsigned long) data.swap.total,
 | 
			
		||||
		(unsigned long) data.swap.used,
 | 
			
		||||
		(unsigned long) data.swap.free,
 | 
			
		||||
		(unsigned long) data.swap.pagein,
 | 
			
		||||
		(unsigned long) data.swap.pageout);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_uptime (&data.uptime);
 | 
			
		||||
 | 
			
		||||
	printf ("Uptime       (0x%08lx): %f, %f\n", data.uptime.flags,
 | 
			
		||||
	printf ("Uptime       (0x%08lx): %f, %f\n",
 | 
			
		||||
		(unsigned long) data.uptime.flags,
 | 
			
		||||
		data.uptime.uptime, data.uptime.idletime);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_loadavg (&data.loadavg);
 | 
			
		||||
 | 
			
		||||
	printf ("Loadavg      (0x%08lx): %f, %f, %f\n", data.loadavg.flags,
 | 
			
		||||
		data.loadavg.loadavg [0], data.loadavg.loadavg [1],
 | 
			
		||||
		data.loadavg.loadavg [2]);
 | 
			
		||||
	printf ("Loadavg      (0x%08lx): %f, %f, %f - %lu, %lu, %lu\n",
 | 
			
		||||
		(unsigned long) data.loadavg.flags,
 | 
			
		||||
		(double) data.loadavg.loadavg [0],
 | 
			
		||||
		(double) data.loadavg.loadavg [1],
 | 
			
		||||
		(double) data.loadavg.loadavg [2],
 | 
			
		||||
		(unsigned long) data.loadavg.nr_running,
 | 
			
		||||
		(unsigned long) data.loadavg.nr_tasks,
 | 
			
		||||
		(unsigned long) data.loadavg.last_pid);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_shm_limits (&data.shm_limits);
 | 
			
		||||
	
 | 
			
		||||
	printf ("Shm Limits   (0x%08lx): %ld, %ld, %ld, %ld, %ld\n",
 | 
			
		||||
		data.shm_limits.flags, data.shm_limits.shmmax,
 | 
			
		||||
		data.shm_limits.shmmin, data.shm_limits.shmmni,
 | 
			
		||||
		data.shm_limits.shmseg, data.shm_limits.shmall);
 | 
			
		||||
	printf ("Shm Limits   (0x%08lx): %lu, %lu, %lu, %lu, %lu\n",
 | 
			
		||||
		(unsigned long) data.shm_limits.flags,
 | 
			
		||||
		(unsigned long) data.shm_limits.shmmax,
 | 
			
		||||
		(unsigned long) data.shm_limits.shmmin,
 | 
			
		||||
		(unsigned long) data.shm_limits.shmmni,
 | 
			
		||||
		(unsigned long) data.shm_limits.shmseg,
 | 
			
		||||
		(unsigned long) data.shm_limits.shmall);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_msg_limits (&data.msg_limits);
 | 
			
		||||
 | 
			
		||||
	printf ("Msg Limits   (0x%08lx): %ld, %ld, %ld, %ld, %ld, %ld, %ld\n",
 | 
			
		||||
		data.msg_limits.flags, data.msg_limits.msgpool,
 | 
			
		||||
		data.msg_limits.msgmap, data.msg_limits.msgmax,
 | 
			
		||||
		data.msg_limits.msgmnb, data.msg_limits.msgmni,
 | 
			
		||||
		data.msg_limits.msgssz, data.msg_limits.msgtql);
 | 
			
		||||
	printf ("Msg Limits   (0x%08lx): %lu, %lu, %lu, %lu, %lu, %lu, %lu\n",
 | 
			
		||||
		(unsigned long) data.msg_limits.flags,
 | 
			
		||||
		(unsigned long) data.msg_limits.msgpool,
 | 
			
		||||
		(unsigned long) data.msg_limits.msgmap,
 | 
			
		||||
		(unsigned long) data.msg_limits.msgmax,
 | 
			
		||||
		(unsigned long) data.msg_limits.msgmnb,
 | 
			
		||||
		(unsigned long) data.msg_limits.msgmni,
 | 
			
		||||
		(unsigned long) data.msg_limits.msgssz,
 | 
			
		||||
		(unsigned long)  data.msg_limits.msgtql);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_sem_limits (&data.sem_limits);
 | 
			
		||||
	
 | 
			
		||||
	printf ("Sem Limits   (0x%08lx): "
 | 
			
		||||
		"%ld, %ld, %ld, %ld, %ld, %ld, %ld, %ld, %ld, %ld\n",
 | 
			
		||||
		data.sem_limits.flags, data.sem_limits.semmap,
 | 
			
		||||
		data.sem_limits.semmni, data.sem_limits.semmns,
 | 
			
		||||
		data.sem_limits.semmnu, data.sem_limits.semmsl,
 | 
			
		||||
		data.sem_limits.semopm, data.sem_limits.semume,
 | 
			
		||||
		data.sem_limits.semusz, data.sem_limits.semvmx,
 | 
			
		||||
		data.sem_limits.semaem);
 | 
			
		||||
		"%lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu\n",
 | 
			
		||||
		(unsigned long) data.sem_limits.flags,
 | 
			
		||||
		(unsigned long) data.sem_limits.semmap,
 | 
			
		||||
		(unsigned long) data.sem_limits.semmni,
 | 
			
		||||
		(unsigned long) data.sem_limits.semmns,
 | 
			
		||||
		(unsigned long) data.sem_limits.semmnu,
 | 
			
		||||
		(unsigned long) data.sem_limits.semmsl,
 | 
			
		||||
		(unsigned long) data.sem_limits.semopm,
 | 
			
		||||
		(unsigned long) data.sem_limits.semume,
 | 
			
		||||
		(unsigned long) data.sem_limits.semusz,
 | 
			
		||||
		(unsigned long) data.sem_limits.semvmx,
 | 
			
		||||
		(unsigned long) data.sem_limits.semaem);
 | 
			
		||||
 | 
			
		||||
	printf ("\n");
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_ppp (&data.ppp, 0);
 | 
			
		||||
 | 
			
		||||
	printf ("PPP          (0x%08lx): %lu, %lu, %lu\n",
 | 
			
		||||
		(unsigned long) data.ppp.flags,
 | 
			
		||||
		(unsigned long) data.ppp.state,
 | 
			
		||||
		(unsigned long) data.ppp.bytes_in,
 | 
			
		||||
		(unsigned long) data.ppp.bytes_out);
 | 
			
		||||
 | 
			
		||||
	printf ("\n");
 | 
			
		||||
 | 
			
		||||
	glibtop_get_sysdeps (&sysdeps);
 | 
			
		||||
 | 
			
		||||
	printf ("Sysdeps      (0x%08lx): %lu, %lu, %lu, %lu, %lu, "
 | 
			
		||||
		"%lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu\n",
 | 
			
		||||
		sysdeps.flags, sysdeps.cpu, sysdeps.mem, sysdeps.swap,
 | 
			
		||||
		sysdeps.uptime, sysdeps.loadavg, sysdeps.shm_limits,
 | 
			
		||||
		sysdeps.msg_limits, sysdeps.sem_limits,
 | 
			
		||||
		sysdeps.proclist, sysdeps.proc_state,
 | 
			
		||||
		sysdeps.proc_uid, sysdeps.proc_mem,
 | 
			
		||||
		sysdeps.proc_time, sysdeps.proc_signal,
 | 
			
		||||
		sysdeps.proc_kernel, sysdeps.proc_segment);
 | 
			
		||||
		"%lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, "
 | 
			
		||||
		"%lu, %lu, %lu, %lu, %lu, %lu\n",
 | 
			
		||||
		(unsigned long) sysdeps.flags,
 | 
			
		||||
		(unsigned long) sysdeps.cpu,
 | 
			
		||||
		(unsigned long) sysdeps.mem,
 | 
			
		||||
		(unsigned long) sysdeps.swap,
 | 
			
		||||
		(unsigned long) sysdeps.uptime,
 | 
			
		||||
		(unsigned long) sysdeps.loadavg,
 | 
			
		||||
		(unsigned long) sysdeps.shm_limits,
 | 
			
		||||
		(unsigned long) sysdeps.msg_limits,
 | 
			
		||||
		(unsigned long) sysdeps.sem_limits,
 | 
			
		||||
		(unsigned long) sysdeps.proclist,
 | 
			
		||||
		(unsigned long) sysdeps.proc_state,
 | 
			
		||||
		(unsigned long) sysdeps.proc_uid,
 | 
			
		||||
		(unsigned long) sysdeps.proc_mem,
 | 
			
		||||
		(unsigned long) sysdeps.proc_time,
 | 
			
		||||
		(unsigned long) sysdeps.proc_signal,
 | 
			
		||||
		(unsigned long) sysdeps.proc_kernel,
 | 
			
		||||
		(unsigned long) sysdeps.proc_segment,
 | 
			
		||||
		(unsigned long) sysdeps.proc_args,
 | 
			
		||||
		(unsigned long) sysdeps.proc_map,
 | 
			
		||||
		(unsigned long) sysdeps.mountlist,
 | 
			
		||||
		(unsigned long) sysdeps.fsusage,
 | 
			
		||||
		(unsigned long) sysdeps.netload,
 | 
			
		||||
		(unsigned long) sysdeps.ppp);
 | 
			
		||||
 | 
			
		||||
	printf ("\n");
 | 
			
		||||
	
 | 
			
		||||
	ptr = glibtop_get_proclist (&data.proclist);
 | 
			
		||||
	ptr = glibtop_get_proclist (&data.proclist, 0, 0);
 | 
			
		||||
 | 
			
		||||
	printf ("Proclist     (0x%08lx): %ld, %ld, %ld\n",
 | 
			
		||||
		data.proclist.flags, data.proclist.number,
 | 
			
		||||
		data.proclist.size, data.proclist.total);
 | 
			
		||||
	printf ("Proclist     (0x%08lx): %lu, %lu, %lu\n",
 | 
			
		||||
		(unsigned long) data.proclist.flags,
 | 
			
		||||
		(unsigned long) data.proclist.number,
 | 
			
		||||
		(unsigned long) data.proclist.size,
 | 
			
		||||
		(unsigned long) data.proclist.total);
 | 
			
		||||
 | 
			
		||||
	if (ptr) {
 | 
			
		||||
		printf ("\nProcess: ");
 | 
			
		||||
@@ -170,213 +240,332 @@ main (int argc, char *argv [])
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_state (&data.proc_state, pid);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_State   PID  %5u (0x%08lx): '%s', %c, %u, %u\n",
 | 
			
		||||
		pid, data.proc_state.flags, data.proc_state.cmd,
 | 
			
		||||
		data.proc_state.state, data.proc_state.uid,
 | 
			
		||||
		data.proc_state.gid);
 | 
			
		||||
	printf ("Proc_State   PID  %5d (0x%08lx): '%s', %c, %lu, %lu\n",
 | 
			
		||||
		(int) pid, (unsigned long) data.proc_state.flags,
 | 
			
		||||
		data.proc_state.cmd, data.proc_state.state,
 | 
			
		||||
		(unsigned long) data.proc_state.uid,
 | 
			
		||||
		(unsigned long) data.proc_state.gid);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_uid (&data.proc_uid, pid);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Uid     PID  %5u (0x%08lx): "
 | 
			
		||||
		"%d %d %d %d %d %d %d %d %d %d %d %d\n",
 | 
			
		||||
		pid, data.proc_uid.flags, data.proc_uid.uid,
 | 
			
		||||
		data.proc_uid.euid, data.proc_uid.gid,
 | 
			
		||||
		data.proc_uid.egid, data.proc_uid.pid,
 | 
			
		||||
		data.proc_uid.ppid, data.proc_uid.pgrp,
 | 
			
		||||
		data.proc_uid.session, data.proc_uid.tty,
 | 
			
		||||
		data.proc_uid.tpgid, data.proc_uid.priority,
 | 
			
		||||
		data.proc_uid.nice);
 | 
			
		||||
	printf ("Proc_Uid     PID  %5d (0x%08lx): "
 | 
			
		||||
		"%d %d %d %d %d %d %d %d %d %d %d %d\n", (int) pid,
 | 
			
		||||
		(unsigned long) data.proc_uid.flags,
 | 
			
		||||
		data.proc_uid.uid, data.proc_uid.euid,
 | 
			
		||||
		data.proc_uid.gid, data.proc_uid.egid,
 | 
			
		||||
		data.proc_uid.pid, data.proc_uid.ppid,
 | 
			
		||||
		data.proc_uid.pgrp, data.proc_uid.session,
 | 
			
		||||
		data.proc_uid.tty, data.proc_uid.tpgid,
 | 
			
		||||
		data.proc_uid.priority, data.proc_uid.nice);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_mem (&data.proc_mem, pid);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Mem     PID  %5u (0x%08lx): "
 | 
			
		||||
		"%ld %ld %ld %ld %ld %ld\n", pid, data.proc_mem.flags,
 | 
			
		||||
		data.proc_mem.size, data.proc_mem.vsize,
 | 
			
		||||
		data.proc_mem.resident, data.proc_mem.share,
 | 
			
		||||
		data.proc_mem.rss, data.proc_mem.rss_rlim);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_time (&data.proc_time, pid);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Time    PID  %5u (0x%08lx): "
 | 
			
		||||
		"%ld %ld %ld %ld %ld %ld %ld\n", pid, data.proc_time.flags,
 | 
			
		||||
		data.proc_time.start_time, data.proc_time.utime,
 | 
			
		||||
		data.proc_time.stime, data.proc_time.cutime,
 | 
			
		||||
		data.proc_time.cstime, data.proc_time.timeout,
 | 
			
		||||
		data.proc_time.it_real_value);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_signal (&data.proc_signal, pid);
 | 
			
		||||
	
 | 
			
		||||
	printf ("Proc_Signal  PID  %5u (0x%08lx): "
 | 
			
		||||
		"%d %d %d %d\n", pid, data.proc_signal.flags,
 | 
			
		||||
		data.proc_signal.signal, data.proc_signal.blocked,
 | 
			
		||||
		data.proc_signal.sigignore, data.proc_signal.sigcatch);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_kernel (&data.proc_kernel, pid);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Kernel  PID  %5u (0x%08lx): "
 | 
			
		||||
		"%lu %lu %lu %lu %lu %lu %lu %lu\n", pid,
 | 
			
		||||
		data.proc_kernel.flags, data.proc_kernel.k_flags,
 | 
			
		||||
		data.proc_kernel.min_flt, data.proc_kernel.maj_flt,
 | 
			
		||||
		data.proc_kernel.cmin_flt, data.proc_kernel.cmaj_flt,
 | 
			
		||||
		data.proc_kernel.kstk_esp, data.proc_kernel.kstk_eip,
 | 
			
		||||
		data.proc_kernel.wchan);
 | 
			
		||||
	printf ("Proc_Mem     PID  %5d (0x%08lx): "
 | 
			
		||||
		"%lu %lu %lu %lu %lu %lu\n", (int) pid,
 | 
			
		||||
		(unsigned long) data.proc_mem.flags,
 | 
			
		||||
		(unsigned long) data.proc_mem.size,
 | 
			
		||||
		(unsigned long) data.proc_mem.vsize,
 | 
			
		||||
		(unsigned long) data.proc_mem.resident,
 | 
			
		||||
		(unsigned long) data.proc_mem.share,
 | 
			
		||||
		(unsigned long) data.proc_mem.rss,
 | 
			
		||||
		(unsigned long) data.proc_mem.rss_rlim);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_segment (&data.proc_segment, pid);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Segment PID  %5u (0x%08lx): "
 | 
			
		||||
		"%ld %ld %ld %ld %lu %lu %lu\n", pid, data.proc_segment.flags,
 | 
			
		||||
		data.proc_segment.trs, data.proc_segment.lrs,
 | 
			
		||||
		data.proc_segment.drs, data.proc_segment.dt,
 | 
			
		||||
		data.proc_segment.start_code, data.proc_segment.end_code,
 | 
			
		||||
		data.proc_segment.start_stack);
 | 
			
		||||
	printf ("Proc_Segment PID  %5d (0x%08lx): "
 | 
			
		||||
		"%lu %lu %lu %lu %lu %lu %lu %lu\n", (int) pid,
 | 
			
		||||
		(unsigned long) data.proc_segment.flags,
 | 
			
		||||
		(unsigned long) data.proc_segment.text_rss,
 | 
			
		||||
		(unsigned long) data.proc_segment.shlib_rss,
 | 
			
		||||
		(unsigned long) data.proc_segment.data_rss,
 | 
			
		||||
		(unsigned long) data.proc_segment.stack_rss,
 | 
			
		||||
		(unsigned long) data.proc_segment.dirty_size,
 | 
			
		||||
		(unsigned long) data.proc_segment.start_code,
 | 
			
		||||
		(unsigned long) data.proc_segment.end_code,
 | 
			
		||||
		(unsigned long) data.proc_segment.start_stack);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_time (&data.proc_time, pid);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Time    PID  %5d (0x%08lx): "
 | 
			
		||||
		"%lu %lu %lu %lu %lu %lu %lu %lu %lu\n", (int) pid,
 | 
			
		||||
		(unsigned long) data.proc_time.flags,
 | 
			
		||||
		(unsigned long) data.proc_time.start_time,
 | 
			
		||||
		(unsigned long) data.proc_time.rtime,
 | 
			
		||||
		(unsigned long) data.proc_time.utime,
 | 
			
		||||
		(unsigned long) data.proc_time.stime,
 | 
			
		||||
		(unsigned long) data.proc_time.cutime,
 | 
			
		||||
		(unsigned long) data.proc_time.cstime,
 | 
			
		||||
		(unsigned long) data.proc_time.timeout,
 | 
			
		||||
		(unsigned long) data.proc_time.it_real_value,
 | 
			
		||||
		(unsigned long) data.proc_time.frequency);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_signal (&data.proc_signal, pid);
 | 
			
		||||
	
 | 
			
		||||
	printf ("Proc_Signal  PID  %5d (0x%08lx): "
 | 
			
		||||
		"%lu %lu %lu %lu\n", (int) pid,
 | 
			
		||||
		(unsigned long) data.proc_signal.flags,
 | 
			
		||||
		(unsigned long) data.proc_signal.signal,
 | 
			
		||||
		(unsigned long) data.proc_signal.blocked,
 | 
			
		||||
		(unsigned long) data.proc_signal.sigignore,
 | 
			
		||||
		(unsigned long) data.proc_signal.sigcatch);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_kernel (&data.proc_kernel, pid);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Kernel  PID  %5d (0x%08lx): "
 | 
			
		||||
		"%lu %lu %lu %lu %lu %lu %lu %lu (%s)\n", (int) pid,
 | 
			
		||||
		(unsigned long) data.proc_kernel.flags,
 | 
			
		||||
		(unsigned long) data.proc_kernel.k_flags,
 | 
			
		||||
		(unsigned long) data.proc_kernel.min_flt,
 | 
			
		||||
		(unsigned long) data.proc_kernel.maj_flt,
 | 
			
		||||
		(unsigned long) data.proc_kernel.cmin_flt,
 | 
			
		||||
		(unsigned long) data.proc_kernel.cmaj_flt,
 | 
			
		||||
		(unsigned long) data.proc_kernel.kstk_esp,
 | 
			
		||||
		(unsigned long) data.proc_kernel.kstk_eip,
 | 
			
		||||
		(unsigned long) data.proc_kernel.nwchan,
 | 
			
		||||
		data.proc_kernel.wchan);
 | 
			
		||||
 | 
			
		||||
	printf ("\n");
 | 
			
		||||
 | 
			
		||||
	args = glibtop_get_proc_args (&data.proc_args, pid, 0);
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < data.proc_args.size; i++) {
 | 
			
		||||
		if (args [i]) continue;
 | 
			
		||||
		args [i] = '|';
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Args    PID  %5d (0x%08lx): %lu - '%s'\n", (int) pid,
 | 
			
		||||
		(unsigned long) data.proc_args.flags,
 | 
			
		||||
		(unsigned long) data.proc_args.size,
 | 
			
		||||
		args);
 | 
			
		||||
 | 
			
		||||
	glibtop_free (args);
 | 
			
		||||
 | 
			
		||||
	printf ("\n");
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_state (&data.proc_state, ppid);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_State   PPID %5u (0x%08lx): '%s', %c, %u, %u\n",
 | 
			
		||||
		ppid, data.proc_state.flags, data.proc_state.cmd,
 | 
			
		||||
		data.proc_state.state, data.proc_state.uid,
 | 
			
		||||
		data.proc_state.gid);
 | 
			
		||||
	printf ("Proc_State   PPID %5d (0x%08lx): '%s', %c, %lu, %lu\n",
 | 
			
		||||
		(int) ppid, (unsigned long) data.proc_state.flags,
 | 
			
		||||
		data.proc_state.cmd, data.proc_state.state,
 | 
			
		||||
		(unsigned long) data.proc_state.uid,
 | 
			
		||||
		(unsigned long) data.proc_state.gid);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_uid (&data.proc_uid, ppid);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Uid     PPID %5u (0x%08lx): "
 | 
			
		||||
		"%d %d %d %d %d %d %d %d %d %d %d %d\n",
 | 
			
		||||
		ppid, data.proc_uid.flags, data.proc_uid.uid,
 | 
			
		||||
		data.proc_uid.euid, data.proc_uid.gid,
 | 
			
		||||
		data.proc_uid.egid, data.proc_uid.pid,
 | 
			
		||||
		data.proc_uid.ppid, data.proc_uid.pgrp,
 | 
			
		||||
		data.proc_uid.session, data.proc_uid.tty,
 | 
			
		||||
		data.proc_uid.tpgid, data.proc_uid.priority,
 | 
			
		||||
		data.proc_uid.nice);
 | 
			
		||||
	printf ("Proc_Uid     PPID %5d (0x%08lx): "
 | 
			
		||||
		"%d %d %d %d %d %d %d %d %d %d %d %d\n", (int) ppid,
 | 
			
		||||
		(unsigned long) data.proc_uid.flags,
 | 
			
		||||
		data.proc_uid.uid, data.proc_uid.euid,
 | 
			
		||||
		data.proc_uid.gid, data.proc_uid.egid,
 | 
			
		||||
		data.proc_uid.pid, data.proc_uid.ppid,
 | 
			
		||||
		data.proc_uid.pgrp, data.proc_uid.session,
 | 
			
		||||
		data.proc_uid.tty, data.proc_uid.tpgid,
 | 
			
		||||
		data.proc_uid.priority, data.proc_uid.nice);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_mem (&data.proc_mem, ppid);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Mem     PPID %5u (0x%08lx): "
 | 
			
		||||
		"%ld %ld %ld %ld %ld %ld\n", ppid, data.proc_mem.flags,
 | 
			
		||||
		data.proc_mem.size, data.proc_mem.vsize,
 | 
			
		||||
		data.proc_mem.resident, data.proc_mem.share,
 | 
			
		||||
		data.proc_mem.rss, data.proc_mem.rss_rlim);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_time (&data.proc_time, ppid);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Time    PPID %5u (0x%08lx): "
 | 
			
		||||
		"%ld %ld %ld %ld %ld %ld %ld\n", ppid, data.proc_time.flags,
 | 
			
		||||
		data.proc_time.start_time, data.proc_time.utime,
 | 
			
		||||
		data.proc_time.stime, data.proc_time.cutime,
 | 
			
		||||
		data.proc_time.cstime, data.proc_time.timeout,
 | 
			
		||||
		data.proc_time.it_real_value);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_signal (&data.proc_signal, ppid);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Signal  PPID %5u (0x%08lx): "
 | 
			
		||||
		"%d %d %d %d\n", ppid, data.proc_signal.flags,
 | 
			
		||||
		data.proc_signal.signal, data.proc_signal.blocked,
 | 
			
		||||
		data.proc_signal.sigignore, data.proc_signal.sigcatch);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_kernel (&data.proc_kernel, ppid);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Kernel  PPID %5u (0x%08lx): "
 | 
			
		||||
		"%lu %lu %lu %lu %lu %lu %lu %lu\n", ppid,
 | 
			
		||||
		data.proc_kernel.flags, data.proc_kernel.k_flags,
 | 
			
		||||
		data.proc_kernel.min_flt, data.proc_kernel.maj_flt,
 | 
			
		||||
		data.proc_kernel.cmin_flt, data.proc_kernel.cmaj_flt,
 | 
			
		||||
		data.proc_kernel.kstk_esp, data.proc_kernel.kstk_eip,
 | 
			
		||||
		data.proc_kernel.wchan);
 | 
			
		||||
	printf ("Proc_Mem     PPID %5d (0x%08lx): "
 | 
			
		||||
		"%lu %lu %lu %lu %lu %lu\n", (int) ppid,
 | 
			
		||||
		(unsigned long) data.proc_mem.flags,
 | 
			
		||||
		(unsigned long) data.proc_mem.size,
 | 
			
		||||
		(unsigned long) data.proc_mem.vsize,
 | 
			
		||||
		(unsigned long) data.proc_mem.resident,
 | 
			
		||||
		(unsigned long) data.proc_mem.share,
 | 
			
		||||
		(unsigned long) data.proc_mem.rss,
 | 
			
		||||
		(unsigned long) data.proc_mem.rss_rlim);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_segment (&data.proc_segment, ppid);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Segment PPID %5u (0x%08lx): "
 | 
			
		||||
		"%ld %ld %ld %ld %lu %lu %lu\n", ppid, data.proc_segment.flags,
 | 
			
		||||
		data.proc_segment.trs, data.proc_segment.lrs,
 | 
			
		||||
		data.proc_segment.drs, data.proc_segment.dt,
 | 
			
		||||
		data.proc_segment.start_code, data.proc_segment.end_code,
 | 
			
		||||
		data.proc_segment.start_stack);
 | 
			
		||||
	printf ("Proc_Segment PPID %5d (0x%08lx): "
 | 
			
		||||
		"%lu %lu %lu %lu %lu %lu %lu %lu\n", (int) ppid,
 | 
			
		||||
		(unsigned long) data.proc_segment.flags,
 | 
			
		||||
		(unsigned long) data.proc_segment.text_rss,
 | 
			
		||||
		(unsigned long) data.proc_segment.shlib_rss,
 | 
			
		||||
		(unsigned long) data.proc_segment.data_rss,
 | 
			
		||||
		(unsigned long) data.proc_segment.stack_rss,
 | 
			
		||||
		(unsigned long) data.proc_segment.dirty_size,
 | 
			
		||||
		(unsigned long) data.proc_segment.start_code,
 | 
			
		||||
		(unsigned long) data.proc_segment.end_code,
 | 
			
		||||
		(unsigned long) data.proc_segment.start_stack);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_time (&data.proc_time, ppid);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Time    PPID %5d (0x%08lx): "
 | 
			
		||||
		"%lu %lu %lu %lu %lu %lu %lu %lu %lu\n", (int) ppid,
 | 
			
		||||
		(unsigned long) data.proc_time.flags,
 | 
			
		||||
		(unsigned long) data.proc_time.start_time,
 | 
			
		||||
		(unsigned long) data.proc_time.rtime,
 | 
			
		||||
		(unsigned long) data.proc_time.utime,
 | 
			
		||||
		(unsigned long) data.proc_time.stime,
 | 
			
		||||
		(unsigned long) data.proc_time.cutime,
 | 
			
		||||
		(unsigned long) data.proc_time.cstime,
 | 
			
		||||
		(unsigned long) data.proc_time.timeout,
 | 
			
		||||
		(unsigned long) data.proc_time.it_real_value,
 | 
			
		||||
		(unsigned long) data.proc_time.frequency);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_signal (&data.proc_signal, ppid);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Signal  PPID %5d (0x%08lx): %lu %lu %lu %lu\n",
 | 
			
		||||
		(int) ppid, (unsigned long) data.proc_signal.flags,
 | 
			
		||||
		(unsigned long) data.proc_signal.signal,
 | 
			
		||||
		(unsigned long) data.proc_signal.blocked,
 | 
			
		||||
		(unsigned long) data.proc_signal.sigignore,
 | 
			
		||||
		(unsigned long) data.proc_signal.sigcatch);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_kernel (&data.proc_kernel, ppid);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Kernel  PPID %5d (0x%08lx): "
 | 
			
		||||
		"%lu %lu %lu %lu %lu %lu %lu %lu (%s)\n", (int) ppid,
 | 
			
		||||
		(unsigned long) data.proc_kernel.flags,
 | 
			
		||||
		(unsigned long) data.proc_kernel.k_flags,
 | 
			
		||||
		(unsigned long) data.proc_kernel.min_flt,
 | 
			
		||||
		(unsigned long) data.proc_kernel.maj_flt,
 | 
			
		||||
		(unsigned long) data.proc_kernel.cmin_flt,
 | 
			
		||||
		(unsigned long) data.proc_kernel.cmaj_flt,
 | 
			
		||||
		(unsigned long) data.proc_kernel.kstk_esp,
 | 
			
		||||
		(unsigned long) data.proc_kernel.kstk_eip,
 | 
			
		||||
		(unsigned long) data.proc_kernel.nwchan,
 | 
			
		||||
		data.proc_kernel.wchan);
 | 
			
		||||
 | 
			
		||||
	printf ("\n");
 | 
			
		||||
 | 
			
		||||
	args = glibtop_get_proc_args (&data.proc_args, ppid, 0);
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < data.proc_args.size; i++) {
 | 
			
		||||
		if (args [i]) continue;
 | 
			
		||||
		args [i] = '|';
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Args    PID  %5d (0x%08lx): %lu - '%s'\n", (int) ppid,
 | 
			
		||||
		(unsigned long) data.proc_args.flags,
 | 
			
		||||
		(unsigned long) data.proc_args.size,
 | 
			
		||||
		args);
 | 
			
		||||
 | 
			
		||||
	glibtop_free (args);
 | 
			
		||||
 | 
			
		||||
	printf ("\n");
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_state (&data.proc_state, 1);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_State   INIT %5u (0x%08lx): '%s', %c, %u, %u\n",
 | 
			
		||||
		1, data.proc_state.flags, data.proc_state.cmd,
 | 
			
		||||
		data.proc_state.state, data.proc_state.uid,
 | 
			
		||||
		data.proc_state.gid);
 | 
			
		||||
	printf ("Proc_State   INIT %5d (0x%08lx): '%s', %c, %lu, %lu\n", 1,
 | 
			
		||||
		(unsigned long) data.proc_state.flags,
 | 
			
		||||
		data.proc_state.cmd, data.proc_state.state,
 | 
			
		||||
		(unsigned long) data.proc_state.uid,
 | 
			
		||||
		(unsigned long) data.proc_state.gid);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_uid (&data.proc_uid, 1);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Uid     INIT %5u (0x%08lx): "
 | 
			
		||||
		"%d %d %d %d %d %d %d %d %d %d %d %d\n",
 | 
			
		||||
		1, data.proc_uid.flags, data.proc_uid.uid,
 | 
			
		||||
		data.proc_uid.euid, data.proc_uid.gid,
 | 
			
		||||
		data.proc_uid.egid, data.proc_uid.pid,
 | 
			
		||||
		data.proc_uid.ppid, data.proc_uid.pgrp,
 | 
			
		||||
		data.proc_uid.session, data.proc_uid.tty,
 | 
			
		||||
		data.proc_uid.tpgid, data.proc_uid.priority,
 | 
			
		||||
		data.proc_uid.nice);
 | 
			
		||||
	printf ("Proc_Uid     INIT %5d (0x%08lx): "
 | 
			
		||||
		"%d %d %d %d %d %d %d %d %d %d %d %d\n", 1,
 | 
			
		||||
		(unsigned long) data.proc_uid.flags,
 | 
			
		||||
		data.proc_uid.uid, data.proc_uid.euid,
 | 
			
		||||
		data.proc_uid.gid, data.proc_uid.egid,
 | 
			
		||||
		data.proc_uid.pid, data.proc_uid.ppid,
 | 
			
		||||
		data.proc_uid.pgrp, data.proc_uid.session,
 | 
			
		||||
		data.proc_uid.tty, data.proc_uid.tpgid,
 | 
			
		||||
		data.proc_uid.priority, data.proc_uid.nice);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_mem (&data.proc_mem, 1);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Mem     INIT %5u (0x%08lx): "
 | 
			
		||||
		"%ld %ld %ld %ld %ld %ld\n", 1, data.proc_mem.flags,
 | 
			
		||||
		data.proc_mem.size, data.proc_mem.vsize,
 | 
			
		||||
		data.proc_mem.resident, data.proc_mem.share,
 | 
			
		||||
		data.proc_mem.rss, data.proc_mem.rss_rlim);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_time (&data.proc_time, 1);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Time    INIT %5u (0x%08lx): "
 | 
			
		||||
		"%ld %ld %ld %ld %ld %ld %ld\n", 1, data.proc_time.flags,
 | 
			
		||||
		data.proc_time.start_time, data.proc_time.utime,
 | 
			
		||||
		data.proc_time.stime, data.proc_time.cutime,
 | 
			
		||||
		data.proc_time.cstime, data.proc_time.timeout,
 | 
			
		||||
		data.proc_time.it_real_value);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_signal (&data.proc_signal, 1);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Signal  INIT %5u (0x%08lx): "
 | 
			
		||||
		"%d %d %d %d\n", 1, data.proc_signal.flags,
 | 
			
		||||
		data.proc_signal.signal, data.proc_signal.blocked,
 | 
			
		||||
		data.proc_signal.sigignore, data.proc_signal.sigcatch);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_kernel (&data.proc_kernel, 1);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Kernel  INIT %5u (0x%08lx): "
 | 
			
		||||
		"%lu %lu %lu %lu %lu %lu %lu %lu\n", 1,
 | 
			
		||||
		data.proc_kernel.flags, data.proc_kernel.k_flags,
 | 
			
		||||
		data.proc_kernel.min_flt, data.proc_kernel.maj_flt,
 | 
			
		||||
		data.proc_kernel.cmin_flt, data.proc_kernel.cmaj_flt,
 | 
			
		||||
		data.proc_kernel.kstk_esp, data.proc_kernel.kstk_eip,
 | 
			
		||||
		data.proc_kernel.wchan);
 | 
			
		||||
	printf ("Proc_Mem     INIT %5d (0x%08lx): "
 | 
			
		||||
		"%lu %lu %lu %lu %lu %lu\n", 1,
 | 
			
		||||
		(unsigned long) data.proc_mem.flags,
 | 
			
		||||
		(unsigned long) data.proc_mem.size,
 | 
			
		||||
		(unsigned long) data.proc_mem.vsize,
 | 
			
		||||
		(unsigned long) data.proc_mem.resident,
 | 
			
		||||
		(unsigned long) data.proc_mem.share,
 | 
			
		||||
		(unsigned long) data.proc_mem.rss,
 | 
			
		||||
		(unsigned long) data.proc_mem.rss_rlim);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_segment (&data.proc_segment, 1);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Segment INIT %5u (0x%08lx): "
 | 
			
		||||
		"%ld %ld %ld %ld %lu %lu %lu\n", 1, data.proc_segment.flags,
 | 
			
		||||
		data.proc_segment.trs, data.proc_segment.lrs,
 | 
			
		||||
		data.proc_segment.drs, data.proc_segment.dt,
 | 
			
		||||
		data.proc_segment.start_code, data.proc_segment.end_code,
 | 
			
		||||
		data.proc_segment.start_stack);
 | 
			
		||||
	printf ("Proc_Segment INIT %5d (0x%08lx): "
 | 
			
		||||
		"%lu %lu %lu %lu %lu %lu %lu %lu\n", 1,
 | 
			
		||||
		(unsigned long) data.proc_segment.flags,
 | 
			
		||||
		(unsigned long) data.proc_segment.text_rss,
 | 
			
		||||
		(unsigned long) data.proc_segment.shlib_rss,
 | 
			
		||||
		(unsigned long) data.proc_segment.data_rss,
 | 
			
		||||
		(unsigned long) data.proc_segment.stack_rss,
 | 
			
		||||
		(unsigned long) data.proc_segment.dirty_size,
 | 
			
		||||
		(unsigned long) data.proc_segment.start_code,
 | 
			
		||||
		(unsigned long) data.proc_segment.end_code,
 | 
			
		||||
		(unsigned long) data.proc_segment.start_stack);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_time (&data.proc_time, 1);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Time    INIT %5d (0x%08lx): "
 | 
			
		||||
		"%lu %lu %lu %lu %lu %lu %lu %lu %lu\n", 1,
 | 
			
		||||
		(unsigned long) data.proc_time.flags,
 | 
			
		||||
		(unsigned long) data.proc_time.start_time,
 | 
			
		||||
		(unsigned long) data.proc_time.rtime,
 | 
			
		||||
		(unsigned long) data.proc_time.utime,
 | 
			
		||||
		(unsigned long) data.proc_time.stime,
 | 
			
		||||
		(unsigned long) data.proc_time.cutime,
 | 
			
		||||
		(unsigned long) data.proc_time.cstime,
 | 
			
		||||
		(unsigned long) data.proc_time.timeout,
 | 
			
		||||
		(unsigned long) data.proc_time.it_real_value,
 | 
			
		||||
		(unsigned long) data.proc_time.frequency);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_signal (&data.proc_signal, 1);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Signal  INIT %5d (0x%08lx): "
 | 
			
		||||
		"%lu %lu %lu %lu\n", 1,
 | 
			
		||||
		(unsigned long) data.proc_signal.flags,
 | 
			
		||||
		(unsigned long) data.proc_signal.signal,
 | 
			
		||||
		(unsigned long) data.proc_signal.blocked,
 | 
			
		||||
		(unsigned long) data.proc_signal.sigignore,
 | 
			
		||||
		(unsigned long) data.proc_signal.sigcatch);
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++)
 | 
			
		||||
		glibtop_get_proc_kernel (&data.proc_kernel, 1);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Kernel  INIT %5d (0x%08lx): "
 | 
			
		||||
		"%lu %lu %lu %lu %lu %lu %lu %lu (%s)\n", 1,
 | 
			
		||||
		(unsigned long) data.proc_kernel.flags,
 | 
			
		||||
		(unsigned long) data.proc_kernel.k_flags,
 | 
			
		||||
		(unsigned long) data.proc_kernel.min_flt,
 | 
			
		||||
		(unsigned long) data.proc_kernel.maj_flt,
 | 
			
		||||
		(unsigned long) data.proc_kernel.cmin_flt,
 | 
			
		||||
		(unsigned long) data.proc_kernel.cmaj_flt,
 | 
			
		||||
		(unsigned long) data.proc_kernel.kstk_esp,
 | 
			
		||||
		(unsigned long) data.proc_kernel.kstk_eip,
 | 
			
		||||
		(unsigned long) data.proc_kernel.nwchan,
 | 
			
		||||
		data.proc_kernel.wchan);
 | 
			
		||||
 | 
			
		||||
	printf ("\n");
 | 
			
		||||
 | 
			
		||||
	args = glibtop_get_proc_args (&data.proc_args, 1, 0);
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < data.proc_args.size; i++) {
 | 
			
		||||
		if (args [i]) continue;
 | 
			
		||||
		args [i] = '|';
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Args    PID  %5d (0x%08lx): %lu - '%s'\n", 1,
 | 
			
		||||
		(unsigned long) data.proc_args.flags,
 | 
			
		||||
		(unsigned long) data.proc_args.size,
 | 
			
		||||
		args);
 | 
			
		||||
 | 
			
		||||
	glibtop_free (args);
 | 
			
		||||
 | 
			
		||||
	glibtop_close ();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										111
									
								
								examples/mountlist.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										111
									
								
								examples/mountlist.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,111 @@
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
 | 
			
		||||
   This file is part of the Gnome Top Library.
 | 
			
		||||
   Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is free software; you can redistribute it and/or
 | 
			
		||||
   modify it under the terms of the GNU Library General Public License as
 | 
			
		||||
   published by the Free Software Foundation; either version 2 of the
 | 
			
		||||
   License, or (at your option) any later version.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is distributed in the hope that it will be useful,
 | 
			
		||||
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
   Library General Public License for more details.
 | 
			
		||||
 | 
			
		||||
   You should have received a copy of the GNU Library General Public
 | 
			
		||||
   License along with the GNU C Library; see the file COPYING.LIB.  If not,
 | 
			
		||||
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 | 
			
		||||
   Boston, MA 02111-1307, USA.  */
 | 
			
		||||
 | 
			
		||||
#include <locale.h>
 | 
			
		||||
 | 
			
		||||
#include <glibtop.h>
 | 
			
		||||
#include <glibtop/open.h>
 | 
			
		||||
#include <glibtop/close.h>
 | 
			
		||||
#include <glibtop/xmalloc.h>
 | 
			
		||||
 | 
			
		||||
#include <glibtop/parameter.h>
 | 
			
		||||
 | 
			
		||||
#include <glibtop/mountlist.h>
 | 
			
		||||
#include <glibtop/fsusage.h>
 | 
			
		||||
 | 
			
		||||
#ifndef PROFILE_COUNT
 | 
			
		||||
#define PROFILE_COUNT	1000
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
main (int argc, char *argv [])
 | 
			
		||||
{
 | 
			
		||||
	glibtop_fsusage fsusage;
 | 
			
		||||
	glibtop_mountlist mount_list;
 | 
			
		||||
	glibtop_mountentry *mount_entries;
 | 
			
		||||
	unsigned c, index, method, count, port;
 | 
			
		||||
	char buffer [BUFSIZ];
 | 
			
		||||
 | 
			
		||||
	setlocale (LC_ALL, "");
 | 
			
		||||
	bindtextdomain (PACKAGE, GTOPLOCALEDIR);
 | 
			
		||||
	textdomain (PACKAGE);
 | 
			
		||||
	
 | 
			
		||||
	glibtop_init_r (&glibtop_global_server, 0, GLIBTOP_INIT_NO_OPEN);
 | 
			
		||||
 | 
			
		||||
	glibtop_get_parameter (GLIBTOP_PARAM_METHOD, &method, sizeof (method));
 | 
			
		||||
	
 | 
			
		||||
	printf ("Method = %d\n", method);
 | 
			
		||||
 | 
			
		||||
	count = glibtop_get_parameter (GLIBTOP_PARAM_COMMAND, buffer, BUFSIZ);
 | 
			
		||||
	buffer [count] = 0;
 | 
			
		||||
 | 
			
		||||
	printf ("Command = '%s'\n", buffer);
 | 
			
		||||
 | 
			
		||||
	count = glibtop_get_parameter (GLIBTOP_PARAM_HOST, buffer, BUFSIZ);
 | 
			
		||||
	buffer [count] = 0;
 | 
			
		||||
 | 
			
		||||
	glibtop_get_parameter (GLIBTOP_PARAM_PORT, &port, sizeof (port));
 | 
			
		||||
 | 
			
		||||
	printf ("Host = '%s' - %u\n\n", buffer, port);
 | 
			
		||||
 | 
			
		||||
	printf ("sbrk (0) = %p\n\n", sbrk (0));
 | 
			
		||||
 | 
			
		||||
	for (c = 0; c < PROFILE_COUNT; c++) {
 | 
			
		||||
		mount_entries = glibtop_get_mountlist (&mount_list, 1);
 | 
			
		||||
 | 
			
		||||
		glibtop_free (mount_entries);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	printf ("sbrk (0) = %p\n\n", sbrk (0));
 | 
			
		||||
 | 
			
		||||
	mount_entries = glibtop_get_mountlist (&mount_list, 1);
 | 
			
		||||
 | 
			
		||||
	if (mount_entries == NULL)
 | 
			
		||||
		_exit (1);
 | 
			
		||||
 | 
			
		||||
	for (index = 0; index < mount_list.number; index++)
 | 
			
		||||
		printf ("Mount_Entry: %-30s %-10s %-20s\n",
 | 
			
		||||
			mount_entries [index].mountdir,
 | 
			
		||||
			mount_entries [index].type,
 | 
			
		||||
			mount_entries [index].devname);
 | 
			
		||||
 | 
			
		||||
	printf ("\n\n%-23s %9s %9s %9s %9s %9s\n\n",
 | 
			
		||||
		"", "Blocks", "Free", "Avail", "Files", "Free");
 | 
			
		||||
 | 
			
		||||
	for (index = 0; index < mount_list.number; index++) {
 | 
			
		||||
		glibtop_get_fsusage (&fsusage,
 | 
			
		||||
				     mount_entries [index].mountdir);
 | 
			
		||||
 | 
			
		||||
		printf ("Usage: %-16s %9Lu %9Lu %9Lu %9Lu %9Lu\n",
 | 
			
		||||
			mount_entries [index].mountdir,
 | 
			
		||||
			fsusage.blocks, fsusage.bfree,
 | 
			
		||||
			fsusage.bavail, fsusage.files,
 | 
			
		||||
			fsusage.ffree);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	glibtop_free (mount_entries);
 | 
			
		||||
 | 
			
		||||
	printf ("\nsbrk (0) = %p\n\n", sbrk (0));
 | 
			
		||||
 | 
			
		||||
	glibtop_close ();
 | 
			
		||||
 | 
			
		||||
	exit (0);
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										123
									
								
								examples/netload.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										123
									
								
								examples/netload.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,123 @@
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
 | 
			
		||||
   This file is part of the Gnome Top Library.
 | 
			
		||||
   Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is free software; you can redistribute it and/or
 | 
			
		||||
   modify it under the terms of the GNU Library General Public License as
 | 
			
		||||
   published by the Free Software Foundation; either version 2 of the
 | 
			
		||||
   License, or (at your option) any later version.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is distributed in the hope that it will be useful,
 | 
			
		||||
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
   Library General Public License for more details.
 | 
			
		||||
 | 
			
		||||
   You should have received a copy of the GNU Library General Public
 | 
			
		||||
   License along with the GNU C Library; see the file COPYING.LIB.  If not,
 | 
			
		||||
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 | 
			
		||||
   Boston, MA 02111-1307, USA.  */
 | 
			
		||||
 | 
			
		||||
#include <locale.h>
 | 
			
		||||
 | 
			
		||||
#include <glibtop.h>
 | 
			
		||||
#include <glibtop/open.h>
 | 
			
		||||
#include <glibtop/close.h>
 | 
			
		||||
#include <glibtop/xmalloc.h>
 | 
			
		||||
 | 
			
		||||
#include <glibtop/parameter.h>
 | 
			
		||||
 | 
			
		||||
#include <glibtop/netload.h>
 | 
			
		||||
 | 
			
		||||
#include <netinet/in.h>
 | 
			
		||||
#include <arpa/inet.h>
 | 
			
		||||
 | 
			
		||||
#ifndef PROFILE_COUNT
 | 
			
		||||
#define PROFILE_COUNT	1
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
main (int argc, char *argv [])
 | 
			
		||||
{
 | 
			
		||||
	glibtop_netload netload;
 | 
			
		||||
	unsigned method, count, port, i;
 | 
			
		||||
	struct in_addr addr, subnet;
 | 
			
		||||
	char *address_string, *subnet_string;
 | 
			
		||||
	char buffer [BUFSIZ];
 | 
			
		||||
 | 
			
		||||
	count = PROFILE_COUNT;
 | 
			
		||||
 | 
			
		||||
	setlocale (LC_ALL, "");
 | 
			
		||||
	bindtextdomain (PACKAGE, GTOPLOCALEDIR);
 | 
			
		||||
	textdomain (PACKAGE);
 | 
			
		||||
	
 | 
			
		||||
	glibtop_init_r (&glibtop_global_server, 0, GLIBTOP_INIT_NO_OPEN);
 | 
			
		||||
 | 
			
		||||
	glibtop_get_parameter (GLIBTOP_PARAM_METHOD, &method, sizeof (method));
 | 
			
		||||
 | 
			
		||||
	printf ("Method = %d\n", method);
 | 
			
		||||
 | 
			
		||||
	count = glibtop_get_parameter (GLIBTOP_PARAM_COMMAND, buffer, BUFSIZ);
 | 
			
		||||
	buffer [count] = 0;
 | 
			
		||||
 | 
			
		||||
	printf ("Command = '%s'\n", buffer);
 | 
			
		||||
 | 
			
		||||
	count = glibtop_get_parameter (GLIBTOP_PARAM_HOST, buffer, BUFSIZ);
 | 
			
		||||
	buffer [count] = 0;
 | 
			
		||||
 | 
			
		||||
	glibtop_get_parameter (GLIBTOP_PARAM_PORT, &port, sizeof (port));
 | 
			
		||||
 | 
			
		||||
	printf ("Host = '%s' - %u\n\n", buffer, port);
 | 
			
		||||
 | 
			
		||||
	glibtop_init_r (&glibtop_global_server, 0, 0);
 | 
			
		||||
 | 
			
		||||
	if (argc != 2)
 | 
			
		||||
		glibtop_error ("Usage: %s interface", argv [0]);
 | 
			
		||||
	
 | 
			
		||||
	glibtop_get_netload (&netload, argv [1]);
 | 
			
		||||
 | 
			
		||||
	addr.s_addr = netload.address;
 | 
			
		||||
	subnet.s_addr = netload.subnet;
 | 
			
		||||
 | 
			
		||||
	address_string = glibtop_strdup (inet_ntoa (addr));
 | 
			
		||||
	subnet_string  = glibtop_strdup (inet_ntoa (subnet));
 | 
			
		||||
 | 
			
		||||
	printf ("Network Load (0x%08lx):\n\n"
 | 
			
		||||
		"\tInterface Flags:\t0x%08lx\n"
 | 
			
		||||
		"\tAddress:\t\t0x%08lx - %s\n"
 | 
			
		||||
		"\tSubnet:\t\t\t0x%08lx - %s\n\n"
 | 
			
		||||
		"\tMTU:\t\t\t%ld\n"
 | 
			
		||||
		"\tCollisions:\t\t%ld\n\n"
 | 
			
		||||
		"\tPackets In:\t\t%ld\n"
 | 
			
		||||
		"\tPackets Out:\t\t%ld\n"
 | 
			
		||||
		"\tPackets Total:\t\t%ld\n\n"
 | 
			
		||||
		"\tBytes In:\t\t%ld\n"
 | 
			
		||||
		"\tBytes Out:\t\t%ld\n"
 | 
			
		||||
		"\tBytes Total:\t\t%ld\n\n"
 | 
			
		||||
		"\tErrors In:\t\t%ld\n"
 | 
			
		||||
		"\tErrors Out:\t\t%ld\n"
 | 
			
		||||
		"\tErrors Total:\t\t%ld\n\n",
 | 
			
		||||
		(unsigned long) netload.flags,
 | 
			
		||||
		(unsigned long) netload.if_flags,
 | 
			
		||||
		(unsigned long) netload.address, address_string,
 | 
			
		||||
		(unsigned long) netload.subnet,  subnet_string,
 | 
			
		||||
		(unsigned long) netload.mtu,
 | 
			
		||||
		(unsigned long) netload.collisions,
 | 
			
		||||
		(unsigned long) netload.packets_in,
 | 
			
		||||
		(unsigned long) netload.packets_out,
 | 
			
		||||
		(unsigned long) netload.packets_total,
 | 
			
		||||
		(unsigned long) netload.bytes_in,
 | 
			
		||||
		(unsigned long) netload.bytes_out,
 | 
			
		||||
		(unsigned long) netload.bytes_total,
 | 
			
		||||
		(unsigned long) netload.errors_in,
 | 
			
		||||
		(unsigned long) netload.errors_out,
 | 
			
		||||
		(unsigned long) netload.errors_total);
 | 
			
		||||
 | 
			
		||||
	glibtop_free (address_string);
 | 
			
		||||
	glibtop_free (subnet_string);
 | 
			
		||||
 | 
			
		||||
	glibtop_close ();
 | 
			
		||||
 | 
			
		||||
	exit (0);
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										145
									
								
								examples/procmap.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										145
									
								
								examples/procmap.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,145 @@
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
 | 
			
		||||
   This file is part of the Gnome Top Library.
 | 
			
		||||
   Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is free software; you can redistribute it and/or
 | 
			
		||||
   modify it under the terms of the GNU Library General Public License as
 | 
			
		||||
   published by the Free Software Foundation; either version 2 of the
 | 
			
		||||
   License, or (at your option) any later version.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is distributed in the hope that it will be useful,
 | 
			
		||||
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
   Library General Public License for more details.
 | 
			
		||||
 | 
			
		||||
   You should have received a copy of the GNU Library General Public
 | 
			
		||||
   License along with the GNU C Library; see the file COPYING.LIB.  If not,
 | 
			
		||||
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 | 
			
		||||
   Boston, MA 02111-1307, USA.  */
 | 
			
		||||
 | 
			
		||||
#include <locale.h>
 | 
			
		||||
 | 
			
		||||
#include <glibtop.h>
 | 
			
		||||
#include <glibtop/open.h>
 | 
			
		||||
#include <glibtop/close.h>
 | 
			
		||||
#include <glibtop/xmalloc.h>
 | 
			
		||||
 | 
			
		||||
#include <glibtop/parameter.h>
 | 
			
		||||
 | 
			
		||||
#include <glibtop/procmap.h>
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_INODEDB
 | 
			
		||||
#include <glibtop/inodedb.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <sys/resource.h>
 | 
			
		||||
#include <sys/mman.h>
 | 
			
		||||
 | 
			
		||||
#ifndef PROFILE_COUNT
 | 
			
		||||
#define PROFILE_COUNT	1
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
main (int argc, char *argv [])
 | 
			
		||||
{
 | 
			
		||||
#ifdef GLIBTOP_INODEDB
 | 
			
		||||
	glibtop_inodedb *inodedb;
 | 
			
		||||
#endif
 | 
			
		||||
	glibtop_proc_map procmap;
 | 
			
		||||
	glibtop_map_entry *maps;
 | 
			
		||||
	unsigned method, count, port, i;
 | 
			
		||||
	char buffer [BUFSIZ];
 | 
			
		||||
	pid_t pid;
 | 
			
		||||
 | 
			
		||||
	count = PROFILE_COUNT;
 | 
			
		||||
 | 
			
		||||
	setlocale (LC_ALL, "");
 | 
			
		||||
	bindtextdomain (PACKAGE, GTOPLOCALEDIR);
 | 
			
		||||
	textdomain (PACKAGE);
 | 
			
		||||
	
 | 
			
		||||
	glibtop_init_r (&glibtop_global_server, 0, GLIBTOP_INIT_NO_OPEN);
 | 
			
		||||
 | 
			
		||||
	glibtop_get_parameter (GLIBTOP_PARAM_METHOD, &method, sizeof (method));
 | 
			
		||||
 | 
			
		||||
	printf ("Method = %d\n", method);
 | 
			
		||||
 | 
			
		||||
	count = glibtop_get_parameter (GLIBTOP_PARAM_COMMAND, buffer, BUFSIZ);
 | 
			
		||||
	buffer [count] = 0;
 | 
			
		||||
 | 
			
		||||
	printf ("Command = '%s'\n", buffer);
 | 
			
		||||
 | 
			
		||||
	count = glibtop_get_parameter (GLIBTOP_PARAM_HOST, buffer, BUFSIZ);
 | 
			
		||||
	buffer [count] = 0;
 | 
			
		||||
 | 
			
		||||
	glibtop_get_parameter (GLIBTOP_PARAM_PORT, &port, sizeof (port));
 | 
			
		||||
 | 
			
		||||
	printf ("Host = '%s' - %u\n\n", buffer, port);
 | 
			
		||||
 | 
			
		||||
	glibtop_init_r (&glibtop_global_server, 0, 0);
 | 
			
		||||
 | 
			
		||||
	if ((argc != 2) || (sscanf (argv [1], "%d", (int *) &pid) != 1))
 | 
			
		||||
		glibtop_error ("Usage: %s pid", argv [0]);
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_INODEDB
 | 
			
		||||
	inodedb = glibtop_inodedb_open (0, 0);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	fprintf (stderr, "Getting memory maps for pid %d.\n\n", (int) pid);
 | 
			
		||||
 | 
			
		||||
	maps = glibtop_get_proc_map (&procmap, pid);
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < procmap.number; i++) {
 | 
			
		||||
		const char *filename = NULL;
 | 
			
		||||
		unsigned device, device_major, device_minor;
 | 
			
		||||
		char perm [5];
 | 
			
		||||
		
 | 
			
		||||
		if (maps [i].flags & (1 << GLIBTOP_MAP_ENTRY_FILENAME))
 | 
			
		||||
			filename = maps [i].filename;
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_INODEDB
 | 
			
		||||
		if (inodedb && !filename)
 | 
			
		||||
			filename = glibtop_inodedb_lookup
 | 
			
		||||
				(inodedb, maps [i].device, maps [i].inode);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
		perm [0] = (maps [i].perm & GLIBTOP_MAP_PERM_READ) ? 'r' : '-';
 | 
			
		||||
		perm [1] = (maps [i].perm & GLIBTOP_MAP_PERM_WRITE) ? 'w' : '-';
 | 
			
		||||
		perm [2] = (maps [i].perm & GLIBTOP_MAP_PERM_EXECUTE) ? 'x' : '-';
 | 
			
		||||
		perm [3] = (maps [i].perm & GLIBTOP_MAP_PERM_SHARED) ? 's' : '-';
 | 
			
		||||
		perm [4] = (maps [i].perm & GLIBTOP_MAP_PERM_PRIVATE) ? 'p' : '-';
 | 
			
		||||
 | 
			
		||||
		device = (unsigned long) maps [i].device;
 | 
			
		||||
		device_minor = (device & 255);
 | 
			
		||||
		device_major = ((device >> 8) & 255);
 | 
			
		||||
 | 
			
		||||
		if (filename)
 | 
			
		||||
			fprintf (stderr, "%08lx-%08lx %08lx - "
 | 
			
		||||
				 "%02x:%02x %08lu - %4s - %s\n",
 | 
			
		||||
				 (unsigned long) maps [i].start,
 | 
			
		||||
				 (unsigned long) maps [i].end,
 | 
			
		||||
				 (unsigned long) maps [i].offset,
 | 
			
		||||
				 device_major, device_minor,
 | 
			
		||||
				 (unsigned long) maps [i].inode,
 | 
			
		||||
				 perm, filename);
 | 
			
		||||
		else
 | 
			
		||||
			fprintf (stderr, "%08lx-%08lx %08lx - "
 | 
			
		||||
				 "%02x:%02x %08lu - %4s\n",
 | 
			
		||||
				 (unsigned long) maps [i].start,
 | 
			
		||||
				 (unsigned long) maps [i].end,
 | 
			
		||||
				 (unsigned long) maps [i].offset,
 | 
			
		||||
				 device_major, device_minor,
 | 
			
		||||
				 (unsigned long) maps [i].inode,
 | 
			
		||||
				 perm);
 | 
			
		||||
 | 
			
		||||
		if (filename && (filename != maps [i].filename))
 | 
			
		||||
			glibtop_free (filename);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	glibtop_free (maps);
 | 
			
		||||
 | 
			
		||||
	glibtop_close ();
 | 
			
		||||
 | 
			
		||||
	exit (0);
 | 
			
		||||
}
 | 
			
		||||
@@ -29,10 +29,210 @@
 | 
			
		||||
#include <glibtop/union.h>
 | 
			
		||||
#include <glibtop/sysdeps.h>
 | 
			
		||||
 | 
			
		||||
#include <math.h>
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
output (pid_t pid)
 | 
			
		||||
{
 | 
			
		||||
	glibtop_union data;
 | 
			
		||||
	char *args;
 | 
			
		||||
	unsigned i;
 | 
			
		||||
 | 
			
		||||
#if HAVE_LIBGTOP_SMP
 | 
			
		||||
	unsigned long total;
 | 
			
		||||
	double p_total, p_utime, p_stime;
 | 
			
		||||
	double b_total, b_utime, b_stime;
 | 
			
		||||
	double s_total, s_utime, s_stime;
 | 
			
		||||
	double my_utime, my_stime;
 | 
			
		||||
	int ncpu;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	printf ("\n");
 | 
			
		||||
		
 | 
			
		||||
	glibtop_get_proc_state (&data.proc_state, pid);
 | 
			
		||||
		
 | 
			
		||||
	printf ("Proc_State   PID  %5d (0x%08lx): "
 | 
			
		||||
		"'%s', %c, %lu, %lu\n", (int) pid,
 | 
			
		||||
		(unsigned long) data.proc_state.flags,
 | 
			
		||||
		data.proc_state.cmd, data.proc_state.state,
 | 
			
		||||
		(unsigned long) data.proc_state.uid,
 | 
			
		||||
		(unsigned long) data.proc_state.gid);
 | 
			
		||||
		
 | 
			
		||||
	glibtop_get_proc_uid (&data.proc_uid, pid);
 | 
			
		||||
		
 | 
			
		||||
	printf ("Proc_Uid     PID  %5d (0x%08lx): "
 | 
			
		||||
		"%d %d %d %d %d %d %d %d %d %d %d %d\n", (int) pid,
 | 
			
		||||
		(unsigned long) data.proc_uid.flags,
 | 
			
		||||
		data.proc_uid.uid, data.proc_uid.euid,
 | 
			
		||||
		data.proc_uid.gid, data.proc_uid.egid,
 | 
			
		||||
		data.proc_uid.pid, data.proc_uid.ppid,
 | 
			
		||||
		data.proc_uid.pgrp, data.proc_uid.session,
 | 
			
		||||
		data.proc_uid.tty, data.proc_uid.tpgid,
 | 
			
		||||
		data.proc_uid.priority, data.proc_uid.nice);
 | 
			
		||||
		
 | 
			
		||||
	glibtop_get_proc_mem (&data.proc_mem, pid);
 | 
			
		||||
		
 | 
			
		||||
	printf ("Proc_Mem     PID  %5d (0x%08lx): "
 | 
			
		||||
		"%lu %lu %lu %lu %lu %lu\n", (int) pid,
 | 
			
		||||
		(unsigned long) data.proc_mem.flags,
 | 
			
		||||
		(unsigned long) data.proc_mem.size,
 | 
			
		||||
		(unsigned long) data.proc_mem.vsize,
 | 
			
		||||
		(unsigned long) data.proc_mem.resident,
 | 
			
		||||
		(unsigned long) data.proc_mem.share,
 | 
			
		||||
		(unsigned long) data.proc_mem.rss,
 | 
			
		||||
		(unsigned long) data.proc_mem.rss_rlim);
 | 
			
		||||
		
 | 
			
		||||
	glibtop_get_proc_segment (&data.proc_segment, pid);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Segment PID  %5d (0x%08lx): "
 | 
			
		||||
		"%lu %lu %lu %lu %lu %lu %lu %lu\n", (int) pid,
 | 
			
		||||
		(unsigned long) data.proc_segment.flags,
 | 
			
		||||
		(unsigned long) data.proc_segment.text_rss,
 | 
			
		||||
		(unsigned long) data.proc_segment.shlib_rss,
 | 
			
		||||
		(unsigned long) data.proc_segment.data_rss,
 | 
			
		||||
		(unsigned long) data.proc_segment.stack_rss,
 | 
			
		||||
		(unsigned long) data.proc_segment.dirty_size,
 | 
			
		||||
		(unsigned long) data.proc_segment.start_code,
 | 
			
		||||
		(unsigned long) data.proc_segment.end_code,
 | 
			
		||||
		(unsigned long) data.proc_segment.start_stack);
 | 
			
		||||
 | 
			
		||||
	glibtop_get_proc_time (&data.proc_time, pid);
 | 
			
		||||
		
 | 
			
		||||
	printf ("Proc_Time    PID  %5d (0x%08lx): "
 | 
			
		||||
		"%lu %lu %lu %lu %lu %lu %lu %lu %lu\n", (int) pid,
 | 
			
		||||
		(unsigned long) data.proc_time.flags,
 | 
			
		||||
		(unsigned long) data.proc_time.start_time,
 | 
			
		||||
		(unsigned long) data.proc_time.rtime,
 | 
			
		||||
		(unsigned long) data.proc_time.utime,
 | 
			
		||||
		(unsigned long) data.proc_time.stime,
 | 
			
		||||
		(unsigned long) data.proc_time.cutime,
 | 
			
		||||
		(unsigned long) data.proc_time.cstime,
 | 
			
		||||
		(unsigned long) data.proc_time.timeout,
 | 
			
		||||
		(unsigned long) data.proc_time.it_real_value,
 | 
			
		||||
		(unsigned long) data.proc_time.frequency);
 | 
			
		||||
 | 
			
		||||
	glibtop_get_proc_signal (&data.proc_signal, pid);
 | 
			
		||||
	
 | 
			
		||||
	printf ("Proc_Signal  PID  %5d (0x%08lx): "
 | 
			
		||||
		"%lu %lu %lu %lu\n", (int) pid,
 | 
			
		||||
		(unsigned long) data.proc_signal.flags,
 | 
			
		||||
		(unsigned long) data.proc_signal.signal,
 | 
			
		||||
		(unsigned long) data.proc_signal.blocked,
 | 
			
		||||
		(unsigned long) data.proc_signal.sigignore,
 | 
			
		||||
		(unsigned long) data.proc_signal.sigcatch);
 | 
			
		||||
 | 
			
		||||
	glibtop_get_proc_kernel (&data.proc_kernel, pid);
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Kernel  PID  %5d (0x%08lx): "
 | 
			
		||||
		"%lu %lu %lu %lu %lu %lu %lu %lu (%s)\n", (int) pid,
 | 
			
		||||
		(unsigned long) data.proc_kernel.flags,
 | 
			
		||||
		(unsigned long) data.proc_kernel.k_flags,
 | 
			
		||||
		(unsigned long) data.proc_kernel.min_flt,
 | 
			
		||||
		(unsigned long) data.proc_kernel.maj_flt,
 | 
			
		||||
		(unsigned long) data.proc_kernel.cmin_flt,
 | 
			
		||||
		(unsigned long) data.proc_kernel.cmaj_flt,
 | 
			
		||||
		(unsigned long) data.proc_kernel.kstk_esp,
 | 
			
		||||
		(unsigned long) data.proc_kernel.kstk_eip,
 | 
			
		||||
		(unsigned long) data.proc_kernel.nwchan,
 | 
			
		||||
		data.proc_kernel.wchan);
 | 
			
		||||
 | 
			
		||||
	printf ("\n");
 | 
			
		||||
 | 
			
		||||
	args = glibtop_get_proc_args (&data.proc_args, pid, 0);
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < data.proc_args.size; i++) {
 | 
			
		||||
		if (args [i]) continue;
 | 
			
		||||
		args [i] = '|';
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Args    PID  %5d (0x%08lx): %lu - '%s'\n", (int) pid,
 | 
			
		||||
		(unsigned long) data.proc_args.flags,
 | 
			
		||||
		(unsigned long) data.proc_args.size,
 | 
			
		||||
		args);
 | 
			
		||||
 | 
			
		||||
	glibtop_free (args);
 | 
			
		||||
 | 
			
		||||
	printf ("\n");
 | 
			
		||||
 | 
			
		||||
#if HAVE_LIBGTOP_SMP
 | 
			
		||||
	ncpu = glibtop_global_server->ncpu;
 | 
			
		||||
 | 
			
		||||
	glibtop_get_proc_time (&data.proc_time, pid);
 | 
			
		||||
		
 | 
			
		||||
	total = (unsigned long) data.proc_time.utime +
 | 
			
		||||
		(unsigned long) data.proc_time.stime;
 | 
			
		||||
 | 
			
		||||
	p_total = total ? (double) total : 1.0;
 | 
			
		||||
 | 
			
		||||
	p_utime = (double) data.proc_time.utime * 100.0 / p_total;
 | 
			
		||||
	p_stime = (double) data.proc_time.stime * 100.0 / p_total;
 | 
			
		||||
 | 
			
		||||
	b_total = p_total / ncpu;
 | 
			
		||||
	b_utime = (double) data.proc_time.utime / ncpu;
 | 
			
		||||
	b_stime = (double) data.proc_time.stime / ncpu;
 | 
			
		||||
 | 
			
		||||
	s_total = 0.0; s_utime = 0.0; s_stime = 0.0;
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Time    PID  %5d (0x%08lx): %12lu   %12lu   %12lu\n", (int) pid,
 | 
			
		||||
		(unsigned long) data.proc_time.flags, total,
 | 
			
		||||
		(unsigned long) data.proc_time.utime,
 | 
			
		||||
		(unsigned long) data.proc_time.stime);
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < ncpu; i++) {
 | 
			
		||||
		unsigned long this_total;
 | 
			
		||||
 | 
			
		||||
		this_total = (unsigned long) data.proc_time.xcpu_utime [i] +
 | 
			
		||||
			(unsigned long) data.proc_time.xcpu_stime [i];
 | 
			
		||||
 | 
			
		||||
		printf ("CPU %3d      PID  %5d (0x%08lx): %12lu   %12lu   %12lu\n", i,
 | 
			
		||||
			(int) pid, (unsigned long) data.proc_time.flags, this_total,
 | 
			
		||||
			(unsigned long) data.proc_time.xcpu_utime [i],
 | 
			
		||||
			(unsigned long) data.proc_time.xcpu_stime [i]);
 | 
			
		||||
 | 
			
		||||
		s_total += fabs (((double) this_total) - b_total);
 | 
			
		||||
		s_utime += fabs (((double) data.proc_time.xcpu_utime [i]) - b_utime);
 | 
			
		||||
		s_stime += fabs (((double) data.proc_time.xcpu_stime [i]) - b_stime);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	printf ("\n");
 | 
			
		||||
 | 
			
		||||
	printf ("Proc_Time    PID  %5d (0x%08lx): %12.3f   %12.3f   %12.3f\n", (int) pid,
 | 
			
		||||
		(unsigned long) data.proc_time.flags, 100.0, p_utime, p_stime);
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < ncpu; i++) {
 | 
			
		||||
		double this_p_total, this_p_utime, this_p_stime;
 | 
			
		||||
		unsigned long this_total;
 | 
			
		||||
 | 
			
		||||
		this_total = (unsigned long) data.proc_time.xcpu_utime [i] +
 | 
			
		||||
			(unsigned long) data.proc_time.xcpu_stime [i];
 | 
			
		||||
 | 
			
		||||
		this_p_total = (double) this_total * 100.0 / p_total;
 | 
			
		||||
 | 
			
		||||
		this_p_utime = (double) data.proc_time.xcpu_utime [i] * 100.0 / p_total;
 | 
			
		||||
		this_p_stime = (double) data.proc_time.xcpu_stime [i] * 100.0 / p_total;
 | 
			
		||||
 | 
			
		||||
		printf ("CPU %3d      PID  %5d (0x%08lx): %12.3f   %12.3f   %12.3f\n", i,
 | 
			
		||||
			(int) pid, (unsigned long) data.proc_time.flags,
 | 
			
		||||
			this_p_total, this_p_utime, this_p_stime);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	printf ("\n");
 | 
			
		||||
 | 
			
		||||
	my_utime = (unsigned long) data.proc_time.utime ?
 | 
			
		||||
		(double) data.proc_time.utime : 1.0;
 | 
			
		||||
	my_stime = (unsigned long) data.proc_time.stime ?
 | 
			
		||||
		(double) data.proc_time.stime : 1.0;
 | 
			
		||||
 | 
			
		||||
	printf ("SPIN: %31s %12.3f   %12.3f   %12.3f\n", "", s_total * 100.0 / p_total,
 | 
			
		||||
		s_utime * 100.0 / my_utime, s_stime * 100.0 / my_stime);
 | 
			
		||||
 | 
			
		||||
	printf ("\n");
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
main (int argc, char *argv [])
 | 
			
		||||
{
 | 
			
		||||
	glibtop_union data;
 | 
			
		||||
	glibtop_proclist proclist;
 | 
			
		||||
	glibtop_sysdeps sysdeps;
 | 
			
		||||
	unsigned *ptr, pid, i;
 | 
			
		||||
@@ -45,23 +245,41 @@ main (int argc, char *argv [])
 | 
			
		||||
 | 
			
		||||
	glibtop_get_sysdeps (&sysdeps);
 | 
			
		||||
 | 
			
		||||
	fprintf (stderr, "Sysdeps      (0x%08lx): %lu, %lu, %lu, %lu, %lu, "
 | 
			
		||||
		 "%lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu\n",
 | 
			
		||||
		 sysdeps.flags, sysdeps.cpu, sysdeps.mem, sysdeps.swap,
 | 
			
		||||
		 sysdeps.uptime, sysdeps.loadavg, sysdeps.shm_limits,
 | 
			
		||||
		 sysdeps.msg_limits, sysdeps.sem_limits,
 | 
			
		||||
		 sysdeps.proclist, sysdeps.proc_state,
 | 
			
		||||
		 sysdeps.proc_uid, sysdeps.proc_mem,
 | 
			
		||||
		 sysdeps.proc_time, sysdeps.proc_signal,
 | 
			
		||||
		 sysdeps.proc_kernel, sysdeps.proc_segment);
 | 
			
		||||
	printf ("Sysdeps      (0x%08lx): %lu, %lu, %lu, %lu, %lu, "
 | 
			
		||||
		"%lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu\n",
 | 
			
		||||
		(unsigned long) sysdeps.flags,
 | 
			
		||||
		(unsigned long) sysdeps.cpu,
 | 
			
		||||
		(unsigned long) sysdeps.mem,
 | 
			
		||||
		(unsigned long) sysdeps.swap,
 | 
			
		||||
		(unsigned long) sysdeps.uptime,
 | 
			
		||||
		(unsigned long) sysdeps.loadavg,
 | 
			
		||||
		(unsigned long) sysdeps.shm_limits,
 | 
			
		||||
		(unsigned long) sysdeps.msg_limits,
 | 
			
		||||
		(unsigned long) sysdeps.sem_limits,
 | 
			
		||||
		(unsigned long) sysdeps.proclist,
 | 
			
		||||
		(unsigned long) sysdeps.proc_state,
 | 
			
		||||
		(unsigned long) sysdeps.proc_uid,
 | 
			
		||||
		(unsigned long) sysdeps.proc_mem,
 | 
			
		||||
		(unsigned long) sysdeps.proc_time,
 | 
			
		||||
		(unsigned long) sysdeps.proc_signal,
 | 
			
		||||
		(unsigned long) sysdeps.proc_kernel,
 | 
			
		||||
		(unsigned long) sysdeps.proc_segment);
 | 
			
		||||
 | 
			
		||||
	fprintf (stderr, "\n");
 | 
			
		||||
	
 | 
			
		||||
	ptr = glibtop_get_proclist (&proclist);
 | 
			
		||||
	if ((argc == 2) && (sscanf (argv [1], "%d", &pid) == 1)) {
 | 
			
		||||
		output (pid);
 | 
			
		||||
 | 
			
		||||
	fprintf (stderr, "Proclist     (0x%08lx): %ld, %ld, %ld\n",
 | 
			
		||||
		 proclist.flags, proclist.number, proclist.size,
 | 
			
		||||
		 proclist.total);
 | 
			
		||||
		exit (0);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	printf ("\n");
 | 
			
		||||
 | 
			
		||||
	ptr = glibtop_get_proclist (&proclist, 0, 0);
 | 
			
		||||
 | 
			
		||||
	printf ("Proclist     (0x%08lx): %lu, %lu, %lu\n",
 | 
			
		||||
		(unsigned long) proclist.flags,
 | 
			
		||||
		(unsigned long) proclist.number,
 | 
			
		||||
		(unsigned long) proclist.size,
 | 
			
		||||
		(unsigned long) proclist.total);
 | 
			
		||||
 | 
			
		||||
	if (!ptr) exit (1);
 | 
			
		||||
 | 
			
		||||
@@ -69,74 +287,13 @@ main (int argc, char *argv [])
 | 
			
		||||
 | 
			
		||||
		pid = ptr [i];
 | 
			
		||||
		
 | 
			
		||||
		fprintf (stderr, "\n");
 | 
			
		||||
		
 | 
			
		||||
		glibtop_get_proc_state (&data.proc_state, pid);
 | 
			
		||||
		
 | 
			
		||||
		fprintf (stderr, "Proc_State   PID  %5u (0x%08lx): "
 | 
			
		||||
			 "'%s', %c, %u, %u\n", pid, data.proc_state.flags,
 | 
			
		||||
			 data.proc_state.cmd, data.proc_state.state,
 | 
			
		||||
			 data.proc_state.uid, data.proc_state.gid);
 | 
			
		||||
		
 | 
			
		||||
		glibtop_get_proc_uid (&data.proc_uid, pid);
 | 
			
		||||
		
 | 
			
		||||
		fprintf (stderr, "Proc_Uid     PID  %5u (0x%08lx): "
 | 
			
		||||
			 "%d %d %d %d %d %d %d %d %d %d %d %d\n",
 | 
			
		||||
			 pid, data.proc_uid.flags, data.proc_uid.uid,
 | 
			
		||||
			 data.proc_uid.euid, data.proc_uid.gid,
 | 
			
		||||
			 data.proc_uid.egid, data.proc_uid.pid,
 | 
			
		||||
			 data.proc_uid.ppid, data.proc_uid.pgrp,
 | 
			
		||||
			 data.proc_uid.session, data.proc_uid.tty,
 | 
			
		||||
			 data.proc_uid.tpgid, data.proc_uid.priority,
 | 
			
		||||
			 data.proc_uid.nice);
 | 
			
		||||
		
 | 
			
		||||
		glibtop_get_proc_mem (&data.proc_mem, pid);
 | 
			
		||||
		
 | 
			
		||||
		fprintf (stderr, "Proc_Mem     PID  %5u (0x%08lx): "
 | 
			
		||||
			 "%ld %ld %ld %ld %ld %ld\n", pid, data.proc_mem.flags,
 | 
			
		||||
			 data.proc_mem.size, data.proc_mem.vsize,
 | 
			
		||||
			 data.proc_mem.resident, data.proc_mem.share,
 | 
			
		||||
			 data.proc_mem.rss, data.proc_mem.rss_rlim);
 | 
			
		||||
		
 | 
			
		||||
		glibtop_get_proc_time (&data.proc_time, pid);
 | 
			
		||||
		
 | 
			
		||||
		fprintf (stderr, "Proc_Time    PID  %5u (0x%08lx): "
 | 
			
		||||
			 "%ld %ld %ld %ld %ld %ld %ld\n", pid, data.proc_time.flags,
 | 
			
		||||
			 data.proc_time.start_time, data.proc_time.utime,
 | 
			
		||||
			 data.proc_time.stime, data.proc_time.cutime,
 | 
			
		||||
			 data.proc_time.cstime, data.proc_time.timeout,
 | 
			
		||||
			 data.proc_time.it_real_value);
 | 
			
		||||
 | 
			
		||||
		glibtop_get_proc_signal (&data.proc_signal, pid);
 | 
			
		||||
	
 | 
			
		||||
		fprintf (stderr, "Proc_Signal  PID  %5u (0x%08lx): "
 | 
			
		||||
			 "%d %d %d %d\n", pid, data.proc_signal.flags,
 | 
			
		||||
			 data.proc_signal.signal, data.proc_signal.blocked,
 | 
			
		||||
			 data.proc_signal.sigignore, data.proc_signal.sigcatch);
 | 
			
		||||
 | 
			
		||||
		glibtop_get_proc_kernel (&data.proc_kernel, pid);
 | 
			
		||||
 | 
			
		||||
		fprintf (stderr, "Proc_Kernel  PID  %5u (0x%08lx): "
 | 
			
		||||
			 "%lu %lu %lu %lu %lu %lu %lu %lu\n", pid,
 | 
			
		||||
			 data.proc_kernel.flags, data.proc_kernel.k_flags,
 | 
			
		||||
			 data.proc_kernel.min_flt, data.proc_kernel.maj_flt,
 | 
			
		||||
			 data.proc_kernel.cmin_flt, data.proc_kernel.cmaj_flt,
 | 
			
		||||
			 data.proc_kernel.kstk_esp, data.proc_kernel.kstk_eip,
 | 
			
		||||
			 data.proc_kernel.wchan);
 | 
			
		||||
 | 
			
		||||
		glibtop_get_proc_segment (&data.proc_segment, pid);
 | 
			
		||||
 | 
			
		||||
		fprintf (stderr, "Proc_Segment PID  %5u (0x%08lx): "
 | 
			
		||||
			 "%ld %ld %ld %ld %lu %lu %lu\n", pid, data.proc_segment.flags,
 | 
			
		||||
			 data.proc_segment.trs, data.proc_segment.lrs,
 | 
			
		||||
			 data.proc_segment.drs, data.proc_segment.dt,
 | 
			
		||||
			 data.proc_segment.start_code, data.proc_segment.end_code,
 | 
			
		||||
			 data.proc_segment.start_stack);
 | 
			
		||||
 | 
			
		||||
		fprintf (stderr, "\n");
 | 
			
		||||
		output (pid);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	glibtop_free (ptr);
 | 
			
		||||
 | 
			
		||||
	exit (0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										124
									
								
								examples/smp.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										124
									
								
								examples/smp.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,124 @@
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
 | 
			
		||||
   This file is part of the Gnome Top Library.
 | 
			
		||||
   Contributed by Martin Baulig <martin@home-of-linux.org>, September 1998.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is free software; you can redistribute it and/or
 | 
			
		||||
   modify it under the terms of the GNU Library General Public License as
 | 
			
		||||
   published by the Free Software Foundation; either version 2 of the
 | 
			
		||||
   License, or (at your option) any later version.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is distributed in the hope that it will be useful,
 | 
			
		||||
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
   Library General Public License for more details.
 | 
			
		||||
 | 
			
		||||
   You should have received a copy of the GNU Library General Public
 | 
			
		||||
   License along with the GNU C Library; see the file COPYING.LIB.  If not,
 | 
			
		||||
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 | 
			
		||||
   Boston, MA 02111-1307, USA.  */
 | 
			
		||||
 | 
			
		||||
#include <locale.h>
 | 
			
		||||
 | 
			
		||||
#include <glibtop.h>
 | 
			
		||||
#include <glibtop/cpu.h>
 | 
			
		||||
#include <glibtop/xmalloc.h>
 | 
			
		||||
 | 
			
		||||
#include <math.h>
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
main (int argc, char *argv [])
 | 
			
		||||
{
 | 
			
		||||
	glibtop_cpu cpu;
 | 
			
		||||
	unsigned long frequency;
 | 
			
		||||
	double total, user, nice, sys, idle;
 | 
			
		||||
	double b_total, b_user, b_nice, b_sys, b_idle;
 | 
			
		||||
	double s_total, s_user, s_nice, s_sys, s_idle;
 | 
			
		||||
	char separator [BUFSIZ], buffer [BUFSIZ];
 | 
			
		||||
	int ncpu, i;
 | 
			
		||||
 | 
			
		||||
	setlocale (LC_ALL, "");
 | 
			
		||||
	bindtextdomain (PACKAGE, GTOPLOCALEDIR);
 | 
			
		||||
	textdomain (PACKAGE);
 | 
			
		||||
	
 | 
			
		||||
	glibtop_get_cpu (&cpu);
 | 
			
		||||
 | 
			
		||||
	ncpu = glibtop_global_server->ncpu ? glibtop_global_server->ncpu : 1;
 | 
			
		||||
 | 
			
		||||
	frequency = (unsigned long) cpu.frequency;
 | 
			
		||||
 | 
			
		||||
	total = ((unsigned long) cpu.total) ? ((double) cpu.total) : 1.0;
 | 
			
		||||
	user  = ((unsigned long) cpu.user)  ? ((double) cpu.user)  : 1.0;
 | 
			
		||||
	nice  = ((unsigned long) cpu.nice)  ? ((double) cpu.nice)  : 1.0;
 | 
			
		||||
	sys   = ((unsigned long) cpu.sys)   ? ((double) cpu.sys)   : 1.0;
 | 
			
		||||
	idle  = ((unsigned long) cpu.idle)  ? ((double) cpu.idle)  : 1.0;
 | 
			
		||||
 | 
			
		||||
	s_total = s_user = s_nice = s_sys = s_idle = 0.0;
 | 
			
		||||
 | 
			
		||||
	b_total = total / ncpu;
 | 
			
		||||
	b_user  = user  / ncpu;
 | 
			
		||||
	b_nice  = nice  / ncpu;
 | 
			
		||||
	b_sys   = sys   / ncpu;
 | 
			
		||||
	b_idle  = idle  / ncpu;
 | 
			
		||||
 | 
			
		||||
	memset (separator, '-', 91);
 | 
			
		||||
	separator [92] = '\0';
 | 
			
		||||
 | 
			
		||||
	sprintf (buffer, _("Ticks (%d per second):"), frequency);
 | 
			
		||||
 | 
			
		||||
	printf ("\n\n%-26s %12s %12s %12s %12s %12s\n%s\n", buffer,
 | 
			
		||||
		_("Total"), _("User"), _("Nice"), _("Sys"), _("Idle"), separator);
 | 
			
		||||
 | 
			
		||||
	printf (_("CPU          (0x%08lx): %12.0f %12.0f %12.0f %12.0f %12.0f\n\n"),
 | 
			
		||||
		(unsigned long) cpu.flags, total, user, nice, sys, idle);
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < glibtop_global_server->ncpu; i++) {
 | 
			
		||||
		printf (_("CPU %3d      (0x%08lx): %12lu %12lu %12lu %12lu %12lu\n"), i,
 | 
			
		||||
			(unsigned long) cpu.flags,
 | 
			
		||||
			(unsigned long) cpu.xcpu_total [i],
 | 
			
		||||
			(unsigned long) cpu.xcpu_user  [i],
 | 
			
		||||
			(unsigned long) cpu.xcpu_nice  [i],
 | 
			
		||||
			(unsigned long) cpu.xcpu_sys   [i],
 | 
			
		||||
			(unsigned long) cpu.xcpu_idle  [i]);
 | 
			
		||||
 | 
			
		||||
		s_total += fabs (((double) cpu.xcpu_total [i]) - b_total);
 | 
			
		||||
		s_user  += fabs (((double) cpu.xcpu_user  [i]) - b_user);
 | 
			
		||||
		s_nice  += fabs (((double) cpu.xcpu_nice  [i]) - b_nice);
 | 
			
		||||
		s_sys   += fabs (((double) cpu.xcpu_sys   [i]) - b_sys);
 | 
			
		||||
		s_idle  += fabs (((double) cpu.xcpu_idle  [i]) - b_idle);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	printf ("%s\n\n\n", separator);
 | 
			
		||||
 | 
			
		||||
	printf ("%-26s %12s %12s %12s %12s %12s\n%s\n", _("Percent:"),
 | 
			
		||||
		_("Total (%)"), _("User (%)"), _("Nice (%)"), _("Sys (%)"),
 | 
			
		||||
		_("Idle (%)"), separator);
 | 
			
		||||
	
 | 
			
		||||
	printf (_("CPU          (0x%08lx): %12.3f %12.3f %12.3f %12.3f %12.3f\n\n"),
 | 
			
		||||
		(unsigned long) cpu.flags, (double) total * 100.0 / total,
 | 
			
		||||
		(double) user  * 100.0 / total,
 | 
			
		||||
		(double) nice  * 100.0 / total,
 | 
			
		||||
		(double) sys   * 100.0 / total,
 | 
			
		||||
		(double) idle  * 100.0 / total);
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < glibtop_global_server->ncpu; i++) {
 | 
			
		||||
		double p_total, p_user, p_nice, p_sys, p_idle;
 | 
			
		||||
 | 
			
		||||
		p_total = ((double) cpu.xcpu_total [i]) * 100.0 / total;
 | 
			
		||||
		p_user  = ((double) cpu.xcpu_user  [i]) * 100.0 / user;
 | 
			
		||||
		p_nice  = ((double) cpu.xcpu_nice  [i]) * 100.0 / nice;
 | 
			
		||||
		p_sys   = ((double) cpu.xcpu_sys   [i]) * 100.0 / sys;
 | 
			
		||||
		p_idle  = ((double) cpu.xcpu_idle  [i]) * 100.0 / idle;
 | 
			
		||||
 | 
			
		||||
		printf (_("CPU %3d      (0x%08lx): %12.3f %12.3f %12.3f %12.3f %12.3f\n"),
 | 
			
		||||
			i, (unsigned long) cpu.flags, p_total, p_user, p_nice,
 | 
			
		||||
			p_sys, p_idle);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	printf ("%s\n%-26s %12.3f %12.3f %12.3f %12.3f %12.3f\n\n", separator,
 | 
			
		||||
		_("Spin:"), s_total * 100.0 / total, s_user * 100.0 / user,
 | 
			
		||||
		s_nice * 100.0 / nice, s_sys * 100.0 / sys, s_idle * 100.0 / idle);
 | 
			
		||||
 | 
			
		||||
	exit (0);
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										146
									
								
								examples/sysdeps.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										146
									
								
								examples/sysdeps.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,146 @@
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
 | 
			
		||||
   This file is part of the Gnome Top Library.
 | 
			
		||||
   Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is free software; you can redistribute it and/or
 | 
			
		||||
   modify it under the terms of the GNU Library General Public License as
 | 
			
		||||
   published by the Free Software Foundation; either version 2 of the
 | 
			
		||||
   License, or (at your option) any later version.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is distributed in the hope that it will be useful,
 | 
			
		||||
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
   Library General Public License for more details.
 | 
			
		||||
 | 
			
		||||
   You should have received a copy of the GNU Library General Public
 | 
			
		||||
   License along with the GNU C Library; see the file COPYING.LIB.  If not,
 | 
			
		||||
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 | 
			
		||||
   Boston, MA 02111-1307, USA.  */
 | 
			
		||||
 | 
			
		||||
#include <locale.h>
 | 
			
		||||
 | 
			
		||||
#include <glibtop.h>
 | 
			
		||||
#include <glibtop/open.h>
 | 
			
		||||
#include <glibtop/close.h>
 | 
			
		||||
#include <glibtop/xmalloc.h>
 | 
			
		||||
 | 
			
		||||
#include <glibtop/parameter.h>
 | 
			
		||||
 | 
			
		||||
#ifndef PROFILE_COUNT
 | 
			
		||||
#define PROFILE_COUNT	1
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
main (int argc, char *argv [])
 | 
			
		||||
{
 | 
			
		||||
	glibtop_sysdeps sysdeps;
 | 
			
		||||
	unsigned method, count, port, i;
 | 
			
		||||
	char buffer [BUFSIZ];
 | 
			
		||||
 | 
			
		||||
	count = PROFILE_COUNT;
 | 
			
		||||
 | 
			
		||||
	setlocale (LC_ALL, "");
 | 
			
		||||
	bindtextdomain (PACKAGE, GTOPLOCALEDIR);
 | 
			
		||||
	textdomain (PACKAGE);
 | 
			
		||||
	
 | 
			
		||||
	glibtop_init_r (&glibtop_global_server, 0, GLIBTOP_INIT_NO_OPEN);
 | 
			
		||||
 | 
			
		||||
	glibtop_get_parameter (GLIBTOP_PARAM_METHOD, &method, sizeof (method));
 | 
			
		||||
 | 
			
		||||
	printf ("Method = %d\n", method);
 | 
			
		||||
 | 
			
		||||
	count = glibtop_get_parameter (GLIBTOP_PARAM_COMMAND, buffer, BUFSIZ);
 | 
			
		||||
	buffer [count] = 0;
 | 
			
		||||
 | 
			
		||||
	printf ("Command = '%s'\n", buffer);
 | 
			
		||||
 | 
			
		||||
	count = glibtop_get_parameter (GLIBTOP_PARAM_HOST, buffer, BUFSIZ);
 | 
			
		||||
	buffer [count] = 0;
 | 
			
		||||
 | 
			
		||||
	glibtop_get_parameter (GLIBTOP_PARAM_PORT, &port, sizeof (port));
 | 
			
		||||
 | 
			
		||||
	printf ("Host = '%s' - %u\n\n", buffer, port);
 | 
			
		||||
 | 
			
		||||
	glibtop_init_r (&glibtop_global_server, 0, 0);
 | 
			
		||||
 | 
			
		||||
	glibtop_get_sysdeps (&sysdeps);
 | 
			
		||||
 | 
			
		||||
#define FEATURE_CHECK(f) ((sysdeps.features & (1 << GLIBTOP_SYSDEPS_##f##)) ? 1 : 0)
 | 
			
		||||
 | 
			
		||||
	printf ("Sysdeps (0x%08lx):\n\n"
 | 
			
		||||
		"\tfeatures:\t\t0x%08lx\n\n"
 | 
			
		||||
		"\tcpu:\t\t%d\t0x%08lx\n"
 | 
			
		||||
		"\tmem:\t\t%d\t0x%08lx\n"
 | 
			
		||||
		"\tswap:\t\t%d\t0x%08lx\n\n"
 | 
			
		||||
		"\tuptime:\t\t%d\t0x%08lx\n"
 | 
			
		||||
		"\tloadavg:\t%d\t0x%08lx\n\n"
 | 
			
		||||
		"\tshm_limits:\t%d\t0x%08lx\n"
 | 
			
		||||
		"\tmsg_limits:\t%d\t0x%08lx\n"
 | 
			
		||||
		"\tsem_limits:\t%d\t0x%08lx\n\n"
 | 
			
		||||
		"\tproclist:\t%d\t0x%08lx\n\n"
 | 
			
		||||
		"\tproc_state:\t%d\t0x%08lx\n"
 | 
			
		||||
		"\tproc_uid:\t%d\t0x%08lx\n"
 | 
			
		||||
		"\tproc_mem:\t%d\t0x%08lx\n"
 | 
			
		||||
		"\tproc_time:\t%d\t0x%08lx\n"
 | 
			
		||||
		"\tproc_signal:\t%d\t0x%08lx\n"
 | 
			
		||||
		"\tproc_kernel:\t%d\t0x%08lx\n"
 | 
			
		||||
		"\tproc_segment:\t%d\t0x%08lx\n\n"
 | 
			
		||||
		"\tproc_args:\t%d\t0x%08lx\n"
 | 
			
		||||
		"\tproc_map:\t%d\t0x%08lx\n\n"
 | 
			
		||||
		"\tmountlist:\t%d\t0x%08lx\n"
 | 
			
		||||
		"\tfsusage:\t%d\t0x%08lx\n\n"
 | 
			
		||||
		"\tnetload:\t%d\t0x%08lx\n"
 | 
			
		||||
		"\tppp:\t\t%d\t0x%08lx\n\n",
 | 
			
		||||
		(unsigned long) sysdeps.flags,
 | 
			
		||||
		(unsigned long) sysdeps.features,
 | 
			
		||||
		FEATURE_CHECK(CPU),
 | 
			
		||||
		(unsigned long) sysdeps.cpu,
 | 
			
		||||
		FEATURE_CHECK(MEM),
 | 
			
		||||
		(unsigned long) sysdeps.mem,
 | 
			
		||||
		FEATURE_CHECK(SWAP),
 | 
			
		||||
		(unsigned long) sysdeps.swap,
 | 
			
		||||
		FEATURE_CHECK(UPTIME),
 | 
			
		||||
		(unsigned long) sysdeps.uptime,
 | 
			
		||||
		FEATURE_CHECK(LOADAVG),
 | 
			
		||||
		(unsigned long) sysdeps.loadavg,
 | 
			
		||||
		FEATURE_CHECK(SHM_LIMITS),
 | 
			
		||||
		(unsigned long) sysdeps.shm_limits,
 | 
			
		||||
		FEATURE_CHECK(MSG_LIMITS),
 | 
			
		||||
		(unsigned long) sysdeps.msg_limits,
 | 
			
		||||
		FEATURE_CHECK(SEM_LIMITS),
 | 
			
		||||
		(unsigned long) sysdeps.sem_limits,
 | 
			
		||||
		FEATURE_CHECK(PROCLIST),
 | 
			
		||||
		(unsigned long) sysdeps.proclist,
 | 
			
		||||
		FEATURE_CHECK(PROC_STATE),
 | 
			
		||||
		(unsigned long) sysdeps.proc_state,
 | 
			
		||||
		FEATURE_CHECK(PROC_UID),
 | 
			
		||||
		(unsigned long) sysdeps.proc_uid,
 | 
			
		||||
		FEATURE_CHECK(PROC_MEM),
 | 
			
		||||
		(unsigned long) sysdeps.proc_mem,
 | 
			
		||||
		FEATURE_CHECK(PROC_TIME),
 | 
			
		||||
		(unsigned long) sysdeps.proc_time,
 | 
			
		||||
		FEATURE_CHECK(PROC_SIGNAL),
 | 
			
		||||
		(unsigned long) sysdeps.proc_signal,
 | 
			
		||||
		FEATURE_CHECK(PROC_KERNEL),
 | 
			
		||||
		(unsigned long) sysdeps.proc_kernel,
 | 
			
		||||
		FEATURE_CHECK(PROC_SEGMENT),
 | 
			
		||||
		(unsigned long) sysdeps.proc_segment,
 | 
			
		||||
		FEATURE_CHECK(PROC_ARGS),
 | 
			
		||||
		(unsigned long) sysdeps.proc_args,
 | 
			
		||||
		FEATURE_CHECK(PROC_MAP),
 | 
			
		||||
		(unsigned long) sysdeps.proc_map,
 | 
			
		||||
		FEATURE_CHECK(MOUNTLIST),
 | 
			
		||||
		(unsigned long) sysdeps.mountlist,
 | 
			
		||||
		FEATURE_CHECK(FSUSAGE),
 | 
			
		||||
		(unsigned long) sysdeps.fsusage,
 | 
			
		||||
		FEATURE_CHECK(NETLOAD),
 | 
			
		||||
		(unsigned long) sysdeps.netload,
 | 
			
		||||
		FEATURE_CHECK(PPP),
 | 
			
		||||
		(unsigned long) sysdeps.ppp);
 | 
			
		||||
 | 
			
		||||
	glibtop_close ();
 | 
			
		||||
 | 
			
		||||
	exit (0);
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										38
									
								
								features.def
									
									
									
									
									
								
							
							
						
						
									
										38
									
								
								features.def
									
									
									
									
									
								
							@@ -1,16 +1,22 @@
 | 
			
		||||
cpu		ulong(total,user,nice,sys,idle,frequency)
 | 
			
		||||
mem		ulong(total,used,free,shared,buffer,cached,user,locked)
 | 
			
		||||
swap		ulong(total,used,free)
 | 
			
		||||
uptime		double(uptime,idletime)
 | 
			
		||||
loadavg		double(loadavg[0],loadavg[1],loadavg[2])
 | 
			
		||||
shm_limits	ulong(shmmax,shmmin,shmmni,shmseg,shmall)
 | 
			
		||||
msg_limits	ulong(msgpool,msgmap,msgmax,msgmnb,msgmni,msgssz,msgtql)
 | 
			
		||||
sem_limits	ulong(semmap,semmni,semmns,semmnu,semmsl,semopm,semume,semusz,semvmx,semaem)
 | 
			
		||||
proclist	ulong(number,size,total)
 | 
			
		||||
proc_state	str(cmd):char(state):ulong(uid,gid)
 | 
			
		||||
proc_uid	long(uid,euid,gid,egid,pid,ppid,pgrp,session,tty,tpgid,priority,nice)
 | 
			
		||||
proc_mem	long(size,vsize,resident,share,rss,rss_rlim)
 | 
			
		||||
proc_time	long(start_time,utime,stime,cutime,cstime,timeout,it_real_value)
 | 
			
		||||
proc_signal	long(signal,blocked,sigignore,sigcatch)
 | 
			
		||||
proc_kernel	ulong(k_flags,min_flt,maj_flt,cmin_flt,cmaj_flt,kstk_esp,kstk_eip,wchan)
 | 
			
		||||
proc_segment	long(trs,lrs,drs,dt):ulong(start_code,end_code,start_stack)
 | 
			
		||||
void|cpu|ulong(total,user,nice,sys,idle,frequency,xcpu_total[4],xcpu_user[4],xcpu_nice[4],xcpu_sys[4],xcpu_idle[4])
 | 
			
		||||
void|mem|ulong(total,used,free,shared,buffer,cached,user,locked)
 | 
			
		||||
void|swap|ulong(total,used,free,pagein,pageout)
 | 
			
		||||
void|uptime|double(uptime,idletime)
 | 
			
		||||
void|loadavg|double(loadavg[3]):ulong(nr_running,nr_tasks,last_pid)
 | 
			
		||||
void|shm_limits|ulong(shmmax,shmmin,shmmni,shmseg,shmall)
 | 
			
		||||
void|msg_limits|ulong(msgpool,msgmap,msgmax,msgmnb,msgmni,msgssz,msgtql)
 | 
			
		||||
void|sem_limits|ulong(semmap,semmni,semmns,semmnu,semmsl,semopm,semume,semusz,semvmx,semaem)
 | 
			
		||||
unsigned *|proclist|ulong(number,size,total)|long(which,arg)
 | 
			
		||||
void|proc_state|str(cmd):char(state):ulong(uid,gid)|pid_t(pid)
 | 
			
		||||
void|proc_uid|long(uid,euid,gid,egid,pid,ppid,pgrp,session,tty,tpgid,priority,nice)|pid_t(pid)
 | 
			
		||||
void|proc_mem|long(size,vsize,resident,share,rss,rss_rlim)|pid_t(pid)
 | 
			
		||||
void|proc_time|long(start_time,rtime,utime,stime,cutime,cstime,timeout,it_real_value,frequency,xcpu_utime[4],xcpu_stime[4])|pid_t(pid)
 | 
			
		||||
void|proc_signal|ulong(signal[2],blocked[2],sigignore[2],sigcatch[2])|pid_t(pid)
 | 
			
		||||
void|proc_kernel|ulong(k_flags,min_flt,maj_flt,cmin_flt,cmaj_flt,kstk_esp,kstk_eip,nwchan):str(wchan)|pid_t(pid)
 | 
			
		||||
void|proc_segment|ulong(text_rss,shlib_rss,data_rss,stack_rss,dirty_size,start_code,end_code,start_stack)|pid_t(pid)
 | 
			
		||||
char *|proc_args|ulong(size)|pid_t(pid):unsigned(max_len)
 | 
			
		||||
glibtop_map_entry *|proc_map|ulong(number,size,total)|pid_t(pid)
 | 
			
		||||
glibtop_mountentry *|@mountlist|ulong(number,size,total)|int(all_fs)
 | 
			
		||||
void|@fsusage|ulong(blocks,bfree,bavail,files,ffree)|string|mount_dir
 | 
			
		||||
void|netload|ulong(if_flags,mtu,subnet,address,packets_in,packets_out,packets_total,bytes_in,bytes_out,bytes_total,errors_in,errors_out,errors_total,collisions)|string|interface
 | 
			
		||||
void|ppp|ulong(state,bytes_in,bytes_out)|ushort(device)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										15
									
								
								glibtop.h
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								glibtop.h
									
									
									
									
									
								
							@@ -31,18 +31,26 @@
 | 
			
		||||
#include <glibtop_machine.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef GLIBTOP_MOUNTENTRY_LEN
 | 
			
		||||
#define GLIBTOP_MOUNTENTRY_LEN	79
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
typedef struct _glibtop		glibtop;
 | 
			
		||||
 | 
			
		||||
#include <glibtop/sysdeps.h>
 | 
			
		||||
 | 
			
		||||
struct _glibtop
 | 
			
		||||
{
 | 
			
		||||
	unsigned flags;
 | 
			
		||||
	unsigned method;		/* Server Method */
 | 
			
		||||
	unsigned error_method;		/* Error Method */
 | 
			
		||||
#ifdef HAVE_GLIBTOP_MACHINE_H
 | 
			
		||||
	glibtop_machine machine;	/* Machine dependent data */
 | 
			
		||||
#endif
 | 
			
		||||
	int input [2];			/* Pipe client <- server */
 | 
			
		||||
	int output [2];			/* Pipe client -> server */
 | 
			
		||||
	int socket;			/* Accepted connection of a socket */
 | 
			
		||||
	int ncpu;			/* Number of CPUs, zero if single-processor */
 | 
			
		||||
	unsigned long os_version_code;	/* Version code of the operating system */
 | 
			
		||||
	const char *name;		/* Program name for error messages */
 | 
			
		||||
	const char *server_command;	/* Command used to invoke server */
 | 
			
		||||
@@ -51,6 +59,8 @@ struct _glibtop
 | 
			
		||||
	const char *server_rsh;		/* Command used to connect to the target host */
 | 
			
		||||
	unsigned long features;		/* Server is required for this features */
 | 
			
		||||
	unsigned long server_port;	/* Port on which daemon is listening */
 | 
			
		||||
	glibtop_sysdeps sysdeps;	/* Detailed feature list */
 | 
			
		||||
	glibtop_sysdeps required;	/* Required feature list */
 | 
			
		||||
	pid_t pid;			/* PID of the server */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -62,9 +72,10 @@ extern const unsigned long glibtop_server_features;
 | 
			
		||||
 | 
			
		||||
#define glibtop_close()	glibtop_close_r(glibtop_global_server);
 | 
			
		||||
 | 
			
		||||
extern glibtop *glibtop_init_r __P((glibtop **, const unsigned long, const unsigned));
 | 
			
		||||
extern glibtop *glibtop_init_r __P((glibtop **, unsigned long, unsigned));
 | 
			
		||||
extern glibtop *glibtop_init_s __P((glibtop **, unsigned long, unsigned));
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_GUILE
 | 
			
		||||
#ifdef GLIBTOP_GUILE
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1 +0,0 @@
 | 
			
		||||
reference.sgml
 | 
			
		||||
							
								
								
									
										440
									
								
								guile/header.scm
									
									
									
									
									
								
							
							
						
						
									
										440
									
								
								guile/header.scm
									
									
									
									
									
								
							@@ -1,440 +0,0 @@
 | 
			
		||||
;; $Id$
 | 
			
		||||
 | 
			
		||||
(define cpu-type '(("name"	. "cpu")
 | 
			
		||||
		   ("label"	. "CPU Usage")
 | 
			
		||||
		   ("fields"	. (list
 | 
			
		||||
				   (("name"	. "total")
 | 
			
		||||
				    ("label"	. "Total CPU Usage")
 | 
			
		||||
				    ("type"	. "unsigned long"))
 | 
			
		||||
				   (("name"	. "user")
 | 
			
		||||
				    ("type"	. "unsigned long"))
 | 
			
		||||
				   (("name"	. "nice")
 | 
			
		||||
				    ("type"	. "unsigned long"))
 | 
			
		||||
				   (("name"	. "sys")
 | 
			
		||||
				    ("type"	. "unsigned long"))
 | 
			
		||||
				   (("name"	. "idle")
 | 
			
		||||
				    ("type"	. "unsigned long"))
 | 
			
		||||
				   (("name"	. "name")
 | 
			
		||||
				    ("type"	. "const char")
 | 
			
		||||
				    ("pointer"	. #t))
 | 
			
		||||
				   (("name"	. "test"))
 | 
			
		||||
				   )
 | 
			
		||||
				)
 | 
			
		||||
		   )
 | 
			
		||||
  )
 | 
			
		||||
 | 
			
		||||
(define main-function
 | 
			
		||||
  (lambda (definition)
 | 
			
		||||
    (letrec ((default-type "unsigned long")
 | 
			
		||||
	     (struct-label-comments #t)
 | 
			
		||||
	     (struct-name-comments #f)
 | 
			
		||||
	     (default-name-tabs-first 3)
 | 
			
		||||
	     (default-name-tabs 4)
 | 
			
		||||
	     (default-type-tabs 2)
 | 
			
		||||
	     (default-comment-tabs 5)
 | 
			
		||||
	     (default-definition-tabs 3)
 | 
			
		||||
	     (default-definition-value-tabs 2)
 | 
			
		||||
	     (default-max-line-length 60)
 | 
			
		||||
	     ;; set default values for unspecified fields
 | 
			
		||||
	     (check-field-definition
 | 
			
		||||
	      (lambda (fields)
 | 
			
		||||
		(let ((newlist (list)))
 | 
			
		||||
		  (for-each
 | 
			
		||||
		   (lambda (field)
 | 
			
		||||
		     (if (not (assoc-ref field "type"))
 | 
			
		||||
			 (set! field (assoc-set! field "type" default-type)))
 | 
			
		||||
		     (if (assoc-ref field "label")
 | 
			
		||||
			 (set! field (assoc-set! field "has-label" #t))
 | 
			
		||||
			 (begin
 | 
			
		||||
			   (set! field (assoc-set! field "label" (assoc-ref field "name")))
 | 
			
		||||
			   (set! field (assoc-set! field "has-label" #f))
 | 
			
		||||
			   )
 | 
			
		||||
			 )
 | 
			
		||||
		     (set! newlist (append newlist (list field)))
 | 
			
		||||
		     )
 | 
			
		||||
		   (cdr fields))
 | 
			
		||||
		  (set-cdr! fields newlist)
 | 
			
		||||
		  )
 | 
			
		||||
		)
 | 
			
		||||
	      )
 | 
			
		||||
	     ;; number fields sequentially
 | 
			
		||||
	     (make-field-numbers
 | 
			
		||||
	      (lambda (fields)
 | 
			
		||||
		(let ((pos 0) (newlist (list)))
 | 
			
		||||
		  (for-each
 | 
			
		||||
		   (lambda (field)
 | 
			
		||||
		     (set! field (assoc-set! field "number" pos))
 | 
			
		||||
		     (set! newlist (append newlist (list field)))
 | 
			
		||||
		     (set! pos (+ pos 1))
 | 
			
		||||
		     )
 | 
			
		||||
		   (cdr fields))
 | 
			
		||||
		  (set-cdr! fields newlist)
 | 
			
		||||
		  (set! definition (assoc-set! definition "max-fields" pos))
 | 
			
		||||
		  )
 | 
			
		||||
		)
 | 
			
		||||
	      )
 | 
			
		||||
	     ;; pad string with up to 'tabs' tabs
 | 
			
		||||
	     (tabify-string
 | 
			
		||||
	      (lambda (string tabs)
 | 
			
		||||
		(let ((length (string-length string))
 | 
			
		||||
		      (tlength (* tabs 8)))
 | 
			
		||||
		  (if (> tlength length)
 | 
			
		||||
		      (let* ((diff (- tlength length))
 | 
			
		||||
			     (count (quotient (+ diff 7) 8)))
 | 
			
		||||
			(string-append string
 | 
			
		||||
				       (make-string count #\tab))
 | 
			
		||||
			)
 | 
			
		||||
		      (string-append string
 | 
			
		||||
				     #\space)
 | 
			
		||||
		      )
 | 
			
		||||
		  )
 | 
			
		||||
		)
 | 
			
		||||
	      )
 | 
			
		||||
	     ;; pad string with spaces
 | 
			
		||||
	     (spacify-string
 | 
			
		||||
	      (lambda (string tabs)
 | 
			
		||||
		(let ((length (string-length string))
 | 
			
		||||
		      (tlength (* tabs 8)))
 | 
			
		||||
		  (if (> tlength length)
 | 
			
		||||
		      (string-append string
 | 
			
		||||
				     (make-string (- tlength length) #\space))
 | 
			
		||||
		      (string-append string
 | 
			
		||||
				     #\space)
 | 
			
		||||
		      )
 | 
			
		||||
		  )
 | 
			
		||||
		)
 | 
			
		||||
	      )
 | 
			
		||||
	     ;; creates comment string
 | 
			
		||||
	     (make-comment-string
 | 
			
		||||
	      (lambda (comment)
 | 
			
		||||
		(if comment
 | 
			
		||||
		    (string "/* "
 | 
			
		||||
			    (spacify-string comment
 | 
			
		||||
					    default-comment-tabs)
 | 
			
		||||
			    " */")
 | 
			
		||||
		    (string)
 | 
			
		||||
		    )
 | 
			
		||||
		)
 | 
			
		||||
	      )
 | 
			
		||||
	     ;; create constant for entry (eg. GLIBTOP_CPU_TOTAL)
 | 
			
		||||
	     (entry-constant-name
 | 
			
		||||
	      (lambda (name)
 | 
			
		||||
		(string-upcase! (string "GLIBTOP_"
 | 
			
		||||
					(assoc-ref definition "name")
 | 
			
		||||
					"_"
 | 
			
		||||
					name
 | 
			
		||||
					)
 | 
			
		||||
				)
 | 
			
		||||
		)
 | 
			
		||||
	      )
 | 
			
		||||
	     ;; create text that is displayed as comment along with entry
 | 
			
		||||
	     (entry-comment-text
 | 
			
		||||
	      (lambda (name label)
 | 
			
		||||
		(if label
 | 
			
		||||
		    (if struct-label-comments label #f)
 | 
			
		||||
		    (if struct-name-comments (entry-constant-name name) #f)
 | 
			
		||||
		    )
 | 
			
		||||
		)
 | 
			
		||||
	      )
 | 
			
		||||
	     ;; starts struct definition
 | 
			
		||||
	     (make-struct-definition-head
 | 
			
		||||
	      (lambda ()
 | 
			
		||||
		(let* ((class (assoc-ref definition "name"))
 | 
			
		||||
		       )
 | 
			
		||||
		  (string "struct _glibtop_" class "\n"
 | 
			
		||||
			  "{\n"
 | 
			
		||||
			  )
 | 
			
		||||
		  )
 | 
			
		||||
		)
 | 
			
		||||
	      )
 | 
			
		||||
	     ;; terminates struct definition
 | 
			
		||||
	     (make-struct-definition-tail
 | 
			
		||||
	      (lambda ()
 | 
			
		||||
		(string "};\n\n")
 | 
			
		||||
		)
 | 
			
		||||
	      )
 | 
			
		||||
	     ;; generate struct definition body
 | 
			
		||||
	     (make-struct-definition-body
 | 
			
		||||
	      (lambda (fields)
 | 
			
		||||
		(letrec ((output (string))
 | 
			
		||||
			 (is-first-entry #t)
 | 
			
		||||
			 (current-type #f)
 | 
			
		||||
			 (current-name #f)
 | 
			
		||||
			 (current-label #f)
 | 
			
		||||
			 (current-pointer #f)
 | 
			
		||||
			 ;; close entry (other = next entry is of other type)
 | 
			
		||||
			 (entry-end
 | 
			
		||||
			  (lambda (other)
 | 
			
		||||
			    (let ((old-first is-first-entry))
 | 
			
		||||
			      (set! is-first-entry other)
 | 
			
		||||
			      (if current-type
 | 
			
		||||
				  (string (tabify-string (string (string (if current-pointer "*" ""))
 | 
			
		||||
								 current-name
 | 
			
		||||
								 (string (if other ";" ","))
 | 
			
		||||
								 )
 | 
			
		||||
							 (if old-first
 | 
			
		||||
							     default-name-tabs-first
 | 
			
		||||
							     default-name-tabs
 | 
			
		||||
							     )
 | 
			
		||||
							 )
 | 
			
		||||
					  (make-comment-string (entry-comment-text
 | 
			
		||||
								current-name current-label))
 | 
			
		||||
					  "\n")
 | 
			
		||||
				  (string)
 | 
			
		||||
				  )
 | 
			
		||||
			      )
 | 
			
		||||
			    )
 | 
			
		||||
			  )
 | 
			
		||||
			 ;; start new entry
 | 
			
		||||
			 (entry-start
 | 
			
		||||
			  (lambda (name type)
 | 
			
		||||
			    (if current-type
 | 
			
		||||
				(if (equal? current-type type)
 | 
			
		||||
				    (string (entry-end #f) "\t\t")
 | 
			
		||||
				    (string (entry-end #t) "\t"
 | 
			
		||||
					    (tabify-string type default-type-tabs)
 | 
			
		||||
					    )
 | 
			
		||||
				    )
 | 
			
		||||
				(string "\t"
 | 
			
		||||
					(tabify-string type default-type-tabs)
 | 
			
		||||
					)
 | 
			
		||||
				)
 | 
			
		||||
			    )
 | 
			
		||||
			  )
 | 
			
		||||
			 )
 | 
			
		||||
		  ;; main function
 | 
			
		||||
		  (for-each
 | 
			
		||||
		   (lambda (field)
 | 
			
		||||
		     (let ((name (assoc-ref field "name"))
 | 
			
		||||
			   (type (assoc-ref field "type"))
 | 
			
		||||
			   (pointer (assoc-ref field "pointer"))
 | 
			
		||||
			   (label (if (assoc-ref field "has-label")
 | 
			
		||||
				      (assoc-ref field "label")
 | 
			
		||||
				      #f)
 | 
			
		||||
				  )
 | 
			
		||||
			   )
 | 
			
		||||
		       (set! output (string-append output
 | 
			
		||||
						   (string (entry-start name type))
 | 
			
		||||
						   )
 | 
			
		||||
			     )
 | 
			
		||||
		       ;; save current data
 | 
			
		||||
		       (set! current-type type)
 | 
			
		||||
		       (set! current-name name)
 | 
			
		||||
		       (set! current-label label)
 | 
			
		||||
		       (set! current-pointer pointer)
 | 
			
		||||
		       )
 | 
			
		||||
		     )
 | 
			
		||||
		   (cdr fields))
 | 
			
		||||
		  ;; close last entry
 | 
			
		||||
		  (string-append output (entry-end #t))
 | 
			
		||||
		  )
 | 
			
		||||
		)
 | 
			
		||||
	      )
 | 
			
		||||
	     ;; display complete struct definition
 | 
			
		||||
	     (make-struct-definition
 | 
			
		||||
	      (lambda (fields)
 | 
			
		||||
		(string-append (make-struct-definition-head)
 | 
			
		||||
			       (make-struct-definition-body fields)
 | 
			
		||||
			       (make-struct-definition-tail)
 | 
			
		||||
			       )
 | 
			
		||||
		)
 | 
			
		||||
	      )
 | 
			
		||||
	     ;; make constant definition
 | 
			
		||||
	     (make-const-definition
 | 
			
		||||
	      (lambda (name value comment)
 | 
			
		||||
		(let* ((nstring  (string-upcase! (string "GLIBTOP_" name)))
 | 
			
		||||
		       (tabname  (tabify-string nstring default-definition-tabs))
 | 
			
		||||
		       (tabvalue (if comment
 | 
			
		||||
				     (tabify-string (string value) default-definition-value-tabs)
 | 
			
		||||
				     (string value))
 | 
			
		||||
				 )
 | 
			
		||||
		       (ctext    (make-comment-string comment))
 | 
			
		||||
		       (line     (string "#define " tabname tabvalue ctext "\n"))
 | 
			
		||||
		       )
 | 
			
		||||
		  line)
 | 
			
		||||
		)
 | 
			
		||||
	      )
 | 
			
		||||
	     ;; creates constant definitions
 | 
			
		||||
	     (make-struct-constants
 | 
			
		||||
	      (lambda (fields)
 | 
			
		||||
		(let ((class  (assoc-ref definition "name"))
 | 
			
		||||
		      (output (string))
 | 
			
		||||
		      )
 | 
			
		||||
		  (for-each
 | 
			
		||||
		   (lambda (field)
 | 
			
		||||
		     (let* ((name   (assoc-ref field "name"))
 | 
			
		||||
			    (number (assoc-ref field "number"))
 | 
			
		||||
			    (key    (string class "_" name))
 | 
			
		||||
			    (value  (number->string number))
 | 
			
		||||
			    (label  (if (assoc-ref field "has-label")
 | 
			
		||||
					(assoc-ref field "label")
 | 
			
		||||
					#f)
 | 
			
		||||
				    )
 | 
			
		||||
			    (line   (make-const-definition key
 | 
			
		||||
							   value 
 | 
			
		||||
							   (entry-comment-text name label)
 | 
			
		||||
							   )
 | 
			
		||||
				    )
 | 
			
		||||
			    )
 | 
			
		||||
		       (set! output (string-append output line))
 | 
			
		||||
		       )
 | 
			
		||||
		     )
 | 
			
		||||
		   (cdr fields))
 | 
			
		||||
		  output)
 | 
			
		||||
		)
 | 
			
		||||
	      )
 | 
			
		||||
	     ;; creates definition of maximum constant
 | 
			
		||||
	     (make-struct-max-constant
 | 
			
		||||
	      (lambda ()
 | 
			
		||||
		(let* ((class (assoc-ref definition "name"))
 | 
			
		||||
		       (max   (assoc-ref definition "max-fields"))
 | 
			
		||||
		       )
 | 
			
		||||
		  (make-const-definition (string "MAX_" class)
 | 
			
		||||
					 (number->string max)
 | 
			
		||||
					 #f)
 | 
			
		||||
		  )
 | 
			
		||||
		)
 | 
			
		||||
	      )
 | 
			
		||||
	     ;; adds new list element to string, inserting newline if necessary
 | 
			
		||||
	     (add-to-string
 | 
			
		||||
	      (lambda (output line element separator indent max-length)
 | 
			
		||||
		(let* ((slen (string-length line))
 | 
			
		||||
		       (elen (string-length element))
 | 
			
		||||
		       (tlen (+ slen elen))
 | 
			
		||||
		       (bsep (if separator 
 | 
			
		||||
				 (string separator " ")
 | 
			
		||||
				 (string)
 | 
			
		||||
				 )
 | 
			
		||||
			     )
 | 
			
		||||
		       (nsep (string (if separator separator "") "\n"))
 | 
			
		||||
		       )
 | 
			
		||||
		  (if (and (> slen 0) (> tlen max-length))
 | 
			
		||||
		      (begin
 | 
			
		||||
			(set! output (string-append output line nsep))
 | 
			
		||||
			(set! line (string indent element))
 | 
			
		||||
			)
 | 
			
		||||
		      (set! line (string-append line bsep element))
 | 
			
		||||
		      )
 | 
			
		||||
		  (list output line)
 | 
			
		||||
		  )
 | 
			
		||||
		)
 | 
			
		||||
	      )
 | 
			
		||||
	     ;; create general list definition
 | 
			
		||||
	     (make-general-list-definition
 | 
			
		||||
	      (lambda (fields name symbol line-length make-element-string)
 | 
			
		||||
		(letrec ((class (assoc-ref definition "name"))
 | 
			
		||||
			 (make-general-list-definition-head
 | 
			
		||||
			  (lambda ()
 | 
			
		||||
			    (string "const char *"
 | 
			
		||||
				    "glibtop_"
 | 
			
		||||
				    symbol
 | 
			
		||||
				    "_"
 | 
			
		||||
				    class
 | 
			
		||||
				    " "
 | 
			
		||||
				    "[GLIBTOP_MAX_"
 | 
			
		||||
				    (string-upcase! (string class))
 | 
			
		||||
				    "] = \n{ "
 | 
			
		||||
				    )
 | 
			
		||||
			    )
 | 
			
		||||
			  )
 | 
			
		||||
			 (make-general-list-definition-tail
 | 
			
		||||
			  (lambda ()
 | 
			
		||||
			    (string "\n};\n")
 | 
			
		||||
			    )
 | 
			
		||||
			  )
 | 
			
		||||
			 (make-general-list-definition-body
 | 
			
		||||
			  (lambda ()
 | 
			
		||||
			    (let* ((first #t) (output (string)) (line (string)))
 | 
			
		||||
			      (for-each
 | 
			
		||||
			       (lambda (field)
 | 
			
		||||
				 (let* ((element (assoc-ref field name))
 | 
			
		||||
					(olist   (add-to-string output line
 | 
			
		||||
								(make-element-string element)
 | 
			
		||||
								(if first #f ",")
 | 
			
		||||
								"  "
 | 
			
		||||
								line-length))
 | 
			
		||||
					)
 | 
			
		||||
				   (set! output (car olist))
 | 
			
		||||
				   (set! line (car (cdr olist)))
 | 
			
		||||
				   (set! first #f)
 | 
			
		||||
				   )
 | 
			
		||||
				 )
 | 
			
		||||
			       (cdr fields))
 | 
			
		||||
			      (set! output (string-append output line))
 | 
			
		||||
			      output)
 | 
			
		||||
			    )
 | 
			
		||||
			  )
 | 
			
		||||
			 )
 | 
			
		||||
		  ;; main function
 | 
			
		||||
		  (string-append (make-general-list-definition-head)
 | 
			
		||||
				 (make-general-list-definition-body)
 | 
			
		||||
				 (make-general-list-definition-tail)
 | 
			
		||||
				 )
 | 
			
		||||
		  )
 | 
			
		||||
		)
 | 
			
		||||
	      )
 | 
			
		||||
	     ;; create name list definition
 | 
			
		||||
	     (make-name-list-definition
 | 
			
		||||
	      (lambda (fields)
 | 
			
		||||
		(make-general-list-definition fields
 | 
			
		||||
					      "name"
 | 
			
		||||
					      "names"
 | 
			
		||||
					      default-max-line-length
 | 
			
		||||
					      (lambda (x)
 | 
			
		||||
						(string #\" x #\")
 | 
			
		||||
						)
 | 
			
		||||
					      )
 | 
			
		||||
		)
 | 
			
		||||
	      )
 | 
			
		||||
	     ;; create label list definition
 | 
			
		||||
	     (make-label-list-definition
 | 
			
		||||
	      (lambda (fields)
 | 
			
		||||
		(make-general-list-definition fields
 | 
			
		||||
					      "label"
 | 
			
		||||
					      "labels"
 | 
			
		||||
					      0
 | 
			
		||||
					      (lambda (x)
 | 
			
		||||
						(string "gettext_noop (" #\" x #\" ")")
 | 
			
		||||
						)
 | 
			
		||||
					      )
 | 
			
		||||
		)
 | 
			
		||||
	      )
 | 
			
		||||
	     ;; create description list definition
 | 
			
		||||
	     (make-description-list-definition
 | 
			
		||||
	      (lambda (fields)
 | 
			
		||||
		(make-general-list-definition fields
 | 
			
		||||
					      "description"
 | 
			
		||||
					      "descriptions"
 | 
			
		||||
					      default-max-line-length
 | 
			
		||||
					      (lambda (x)
 | 
			
		||||
						(if x
 | 
			
		||||
						    (string "gettext_noop (" #\" x #\" ")")
 | 
			
		||||
						    (string "NULL")
 | 
			
		||||
						    )
 | 
			
		||||
						)
 | 
			
		||||
					      )
 | 
			
		||||
		)
 | 
			
		||||
	      )
 | 
			
		||||
	     )
 | 
			
		||||
      ;; start of main function
 | 
			
		||||
      (let ((fielddef (assoc-ref definition "fields")))
 | 
			
		||||
	(display fielddef) (newline) (newline)
 | 
			
		||||
	(check-field-definition fielddef)
 | 
			
		||||
	(make-field-numbers fielddef)
 | 
			
		||||
	(display fielddef) (newline) (newline)
 | 
			
		||||
	(display (make-struct-definition fielddef))
 | 
			
		||||
	(display (make-struct-constants fielddef)) (newline)
 | 
			
		||||
	(display (make-struct-max-constant)) (newline) (newline)
 | 
			
		||||
	(display (make-name-list-definition fielddef)) (newline)
 | 
			
		||||
	(display (make-label-list-definition fielddef)) (newline)
 | 
			
		||||
	(display (make-description-list-definition fielddef)) (newline)
 | 
			
		||||
	)
 | 
			
		||||
      )
 | 
			
		||||
    )
 | 
			
		||||
  )
 | 
			
		||||
 | 
			
		||||
(begin
 | 
			
		||||
  (main-function cpu-type)
 | 
			
		||||
  (newline)
 | 
			
		||||
  )
 | 
			
		||||
 | 
			
		||||
@@ -1,311 +0,0 @@
 | 
			
		||||
;; $Id$
 | 
			
		||||
 | 
			
		||||
(define sysdeps-list '())
 | 
			
		||||
 | 
			
		||||
(define make-sysdeps-list
 | 
			
		||||
  (lambda ()
 | 
			
		||||
    (letrec ((names (glibtop-names-sysdeps))
 | 
			
		||||
	     (labels (glibtop-labels-sysdeps))
 | 
			
		||||
	     (descriptions (glibtop-descriptions-sysdeps))
 | 
			
		||||
	     )
 | 
			
		||||
      (for-each (lambda (feature)
 | 
			
		||||
		  (let* ((label (car labels))
 | 
			
		||||
			 (description (car descriptions))
 | 
			
		||||
			 (list '())
 | 
			
		||||
			 )
 | 
			
		||||
		    (set! labels (cdr labels))
 | 
			
		||||
		    (set! descriptions (cdr descriptions))
 | 
			
		||||
		    (set! list (assoc-set! list 'name feature))
 | 
			
		||||
		    (set! list (assoc-set! list 'label label))
 | 
			
		||||
		    (set! list (assoc-set! list 'description description))
 | 
			
		||||
		    (set! sysdeps-list (assoc-set! sysdeps-list feature list))
 | 
			
		||||
		    )
 | 
			
		||||
		  )
 | 
			
		||||
		names)
 | 
			
		||||
      )
 | 
			
		||||
    )
 | 
			
		||||
  )
 | 
			
		||||
 | 
			
		||||
(define make-function-reference
 | 
			
		||||
  (lambda (feature)
 | 
			
		||||
    (let* ((names (eval-string (string "(glibtop-names-" feature ")")))
 | 
			
		||||
	   (types (eval-string (string "(glibtop-types-" feature ")")))
 | 
			
		||||
	   (labels (eval-string (string "(glibtop-labels-" feature ")")))
 | 
			
		||||
	   (sysdeps (assoc-ref sysdeps-list feature)) (retval "void")
 | 
			
		||||
	   (name (assoc-ref sysdeps 'name))
 | 
			
		||||
	   (label (assoc-ref sysdeps 'label))
 | 
			
		||||
	   (description (assoc-ref sysdeps 'description))
 | 
			
		||||
	   (descriptions (eval-string (string "(glibtop-descriptions-" feature ")")))
 | 
			
		||||
	   (decl-list '()) (field-list '())
 | 
			
		||||
 | 
			
		||||
	   (synopsis-start-string
 | 
			
		||||
	    (string "<para>Automatically generated function synopsis:\n\n"))
 | 
			
		||||
 | 
			
		||||
	   (section-string
 | 
			
		||||
	    (string "<sect1>\n"
 | 
			
		||||
		    "<title><function>glibtop_get_" feature "()</function> - "
 | 
			
		||||
		    label "</title>\n\n")
 | 
			
		||||
	    )
 | 
			
		||||
 | 
			
		||||
	   (description-string
 | 
			
		||||
	    (string "<para>\nAutomatically generated description:\n\n"
 | 
			
		||||
		    "<blockquote>\n<literallayout>\n"
 | 
			
		||||
		    description "\n"
 | 
			
		||||
		    "</literallayout>\n</blockquote>\n\n")
 | 
			
		||||
	    )
 | 
			
		||||
	   
 | 
			
		||||
	   (definition-start-string
 | 
			
		||||
	     (string "<para>Automatically generated declaration of "
 | 
			
		||||
		     "<structname>_glibtop_" feature "</structname>:\n\n")
 | 
			
		||||
	     )
 | 
			
		||||
 | 
			
		||||
	   (param-description-start-string
 | 
			
		||||
	    (string "<para>Automatically generated descriptions of "
 | 
			
		||||
		    "<structname>_glibtop_" feature "</structname>:\n\n")
 | 
			
		||||
	    )
 | 
			
		||||
 | 
			
		||||
	   (funcsynopsisinfo-string
 | 
			
		||||
	    (string "<funcsynopsisinfo>\n"
 | 
			
		||||
		    "#include <glibtop.h>\n"
 | 
			
		||||
		    "#include <glibtop/" feature ".h>"
 | 
			
		||||
		    "</funcsynopsisinfo>")
 | 
			
		||||
	    )
 | 
			
		||||
 | 
			
		||||
	   (funcdef-string
 | 
			
		||||
	    (string "<funcdef>" retval " "
 | 
			
		||||
		    "<function>glibtop_get_" feature "__r</function>"
 | 
			
		||||
		    "</funcdef>\n")
 | 
			
		||||
	    )
 | 
			
		||||
 | 
			
		||||
	   (paramdef-string
 | 
			
		||||
	    (string "<paramdef>glibtop *<parameter>server</parameter>, "
 | 
			
		||||
		    "glibtop_" feature " *<parameter>" feature "</parameter>\n"
 | 
			
		||||
		    "</paramdef>")
 | 
			
		||||
	    )
 | 
			
		||||
 | 
			
		||||
	   (funcdef-noserver-string
 | 
			
		||||
	    (string "<funcdef>" retval " "
 | 
			
		||||
		    "<function>glibtop_get_" feature "</function>"
 | 
			
		||||
		    "</funcdef>\n")
 | 
			
		||||
	    )
 | 
			
		||||
 | 
			
		||||
	   (paramdef-noserver-string
 | 
			
		||||
	    (string "<paramdef>glibtop_" feature " *"
 | 
			
		||||
		    "<parameter>" feature "</parameter>\n"
 | 
			
		||||
		    "</paramdef>")
 | 
			
		||||
	    )
 | 
			
		||||
 | 
			
		||||
	   (field-name-constant
 | 
			
		||||
	    (lambda (name field)
 | 
			
		||||
	      (string "GLIBTOP_"
 | 
			
		||||
		      (string-upcase! (string name))
 | 
			
		||||
		      "_"
 | 
			
		||||
		      (string-upcase! (string field)))
 | 
			
		||||
	      )
 | 
			
		||||
	    )
 | 
			
		||||
 | 
			
		||||
	   (make-struct-name
 | 
			
		||||
	    (lambda (type)
 | 
			
		||||
	      (string "glibtop_" (assoc-ref type "name"))
 | 
			
		||||
	      )
 | 
			
		||||
	    )
 | 
			
		||||
	   
 | 
			
		||||
	   (tab-pad-string
 | 
			
		||||
	    (lambda (string tabs)
 | 
			
		||||
	      (let* ((slength (string-length string))
 | 
			
		||||
		     (tlength (* tabs 8)))
 | 
			
		||||
		(string-append string
 | 
			
		||||
			       (make-string 
 | 
			
		||||
				(if (> tlength slength)
 | 
			
		||||
				    (- tlength slength)
 | 
			
		||||
				    1
 | 
			
		||||
				    )
 | 
			
		||||
				#\space))
 | 
			
		||||
		)
 | 
			
		||||
	      )
 | 
			
		||||
	    )
 | 
			
		||||
 | 
			
		||||
	   (make-field-list
 | 
			
		||||
	     (lambda (name type fields)
 | 
			
		||||
	       (let* ((output (string)) (pos 1))
 | 
			
		||||
		 (map
 | 
			
		||||
		  (lambda (x)
 | 
			
		||||
		    (let* ((sep   (if (= pos (length fields)) ";" ","))
 | 
			
		||||
			   (start (if (= pos 1)
 | 
			
		||||
				      (string "\t"
 | 
			
		||||
					      (tab-pad-string (string type) 2))
 | 
			
		||||
				      (string "\t\t"))
 | 
			
		||||
				  )
 | 
			
		||||
			   (comment (string (if (= pos 1) "" "\t") "/* "
 | 
			
		||||
					    (tab-pad-string
 | 
			
		||||
					     (field-name-constant name (car x)) 4)
 | 
			
		||||
					    " */"))
 | 
			
		||||
			   (field (tab-pad-string
 | 
			
		||||
				   (string-append (string (car x)) sep) 2))
 | 
			
		||||
			   )
 | 
			
		||||
		      (set! pos (+ pos 1))
 | 
			
		||||
		      (string-append start field comment "\n")
 | 
			
		||||
		      )
 | 
			
		||||
		    )
 | 
			
		||||
		  fields)
 | 
			
		||||
		 )
 | 
			
		||||
	       )
 | 
			
		||||
	     )
 | 
			
		||||
 | 
			
		||||
	   (init-field-list
 | 
			
		||||
	    (lambda ()
 | 
			
		||||
	      (let* ((old-type #f)
 | 
			
		||||
		     (type-list types)
 | 
			
		||||
		     (new-type #f)
 | 
			
		||||
		     (fields (list))
 | 
			
		||||
		     )
 | 
			
		||||
		(for-each
 | 
			
		||||
		 (lambda (x)
 | 
			
		||||
		   (set! new-type (car type-list))
 | 
			
		||||
		   (set! type-list (cdr type-list))
 | 
			
		||||
		   (if (equal? old-type new-type)
 | 
			
		||||
		       (set-car! fields
 | 
			
		||||
				 (append (list new-type)
 | 
			
		||||
					 (cdr (car fields))
 | 
			
		||||
					 (list (list x))
 | 
			
		||||
					 )
 | 
			
		||||
				 )
 | 
			
		||||
		       (if (equal? old-type #f)
 | 
			
		||||
			   (set! fields (list (list new-type (list x))))
 | 
			
		||||
			   (set! fields (append (list (list new-type (list x))) fields))
 | 
			
		||||
			   )
 | 
			
		||||
		       )
 | 
			
		||||
		   (set! old-type new-type)
 | 
			
		||||
		   )
 | 
			
		||||
		 names)
 | 
			
		||||
		fields)
 | 
			
		||||
	      )
 | 
			
		||||
	    )
 | 
			
		||||
 | 
			
		||||
	   (make-struct-body
 | 
			
		||||
	    (lambda (type)
 | 
			
		||||
	      (let* ((name   (assoc-ref type "name"))
 | 
			
		||||
		     (data   (assoc-ref type "fields"))
 | 
			
		||||
		     (output (string))
 | 
			
		||||
		     )
 | 
			
		||||
		(for-each
 | 
			
		||||
		 (lambda (y)
 | 
			
		||||
		   (for-each
 | 
			
		||||
		    (lambda (z)
 | 
			
		||||
		      (set! output (string-append output z))
 | 
			
		||||
		      )
 | 
			
		||||
		    y)
 | 
			
		||||
		   )
 | 
			
		||||
		 (map
 | 
			
		||||
		  (lambda (x) (make-field-list name (car x) (cdr x)))
 | 
			
		||||
		  data)
 | 
			
		||||
		 )
 | 
			
		||||
		output)
 | 
			
		||||
	      )
 | 
			
		||||
	    )
 | 
			
		||||
	   
 | 
			
		||||
	   (make-struct
 | 
			
		||||
	    (lambda (type)
 | 
			
		||||
	      (let* ((name   (assoc-ref type "name"))
 | 
			
		||||
		     (data   (assoc-ref type "fields"))
 | 
			
		||||
		     (output (string-append
 | 
			
		||||
			      (tab-pad-string
 | 
			
		||||
			       (string "typedef struct _glibtop_" name)
 | 
			
		||||
			       5)
 | 
			
		||||
			      (string "glibtop_" name ";\n\n"
 | 
			
		||||
				      "struct glibtop_" name "\n{\n\t"
 | 
			
		||||
				      "unsigned long\tflags;\n")
 | 
			
		||||
			      )
 | 
			
		||||
			     )
 | 
			
		||||
		     )
 | 
			
		||||
		(string-append output (make-struct-body type) "};\n")
 | 
			
		||||
		)
 | 
			
		||||
	      )
 | 
			
		||||
	    )
 | 
			
		||||
 | 
			
		||||
	   (make-param-description
 | 
			
		||||
	    (lambda ()
 | 
			
		||||
	      (let* ((label-list labels)
 | 
			
		||||
		     (description-list descriptions)
 | 
			
		||||
		     (output (string))
 | 
			
		||||
		     )
 | 
			
		||||
		(for-each
 | 
			
		||||
		 (lambda (name)
 | 
			
		||||
		   (let* ((label (car label-list))
 | 
			
		||||
			  (description (car description-list))
 | 
			
		||||
			  )
 | 
			
		||||
		     (set! label-list (cdr label-list))
 | 
			
		||||
		     (set! description-list (cdr description-list))
 | 
			
		||||
		     (set! output
 | 
			
		||||
			   (string-append output 
 | 
			
		||||
					  (string "<varlistentry>\n"
 | 
			
		||||
						  "<term><parameter>"
 | 
			
		||||
						  name
 | 
			
		||||
						  "</parameter></term>\n\n"
 | 
			
		||||
						  "<listitem>\n<para>\n"
 | 
			
		||||
						  description "\n\n")
 | 
			
		||||
					  )
 | 
			
		||||
			   )
 | 
			
		||||
		     )
 | 
			
		||||
		   )
 | 
			
		||||
		 names)
 | 
			
		||||
		output)
 | 
			
		||||
	      )
 | 
			
		||||
	    )
 | 
			
		||||
	   
 | 
			
		||||
	   )
 | 
			
		||||
      
 | 
			
		||||
      (set! decl-list (assoc-set! decl-list "name" name))
 | 
			
		||||
      (set! decl-list (assoc-set! decl-list "label" label))
 | 
			
		||||
      (set! decl-list (assoc-set! decl-list "fields" (init-field-list)))
 | 
			
		||||
 | 
			
		||||
      (string-append section-string
 | 
			
		||||
		     description-string
 | 
			
		||||
		     synopsis-start-string
 | 
			
		||||
		     (string "<blockquote>\n<funcsynopsis>\n")
 | 
			
		||||
		     funcsynopsisinfo-string
 | 
			
		||||
		     funcdef-noserver-string
 | 
			
		||||
		     paramdef-noserver-string
 | 
			
		||||
		     (string "</funcsynopsis>\n")
 | 
			
		||||
		     (string "<funcsynopsis>\n")
 | 
			
		||||
		     funcdef-string
 | 
			
		||||
		     paramdef-string
 | 
			
		||||
		     (string "</funcsynopsis>\n</blockquote>\n")
 | 
			
		||||
		     definition-start-string
 | 
			
		||||
		     (string "<blockquote>\n<literallayout>\n")
 | 
			
		||||
		     (make-struct decl-list)
 | 
			
		||||
		     (string "</literallayout>\n</blockquote>\n")
 | 
			
		||||
		     param-description-start-string
 | 
			
		||||
		     "<variablelist>\n\n"
 | 
			
		||||
		     (make-param-description)
 | 
			
		||||
		     "</variablelist>\n\n"
 | 
			
		||||
		     )
 | 
			
		||||
      )
 | 
			
		||||
    )
 | 
			
		||||
  )
 | 
			
		||||
 | 
			
		||||
;; <sect2 id="glibtop-get-cpu">
 | 
			
		||||
;; <title><function>glibtop_get_cpu()</function> - get CPU usage</title>
 | 
			
		||||
;; 
 | 
			
		||||
;; <funcsynopsis>
 | 
			
		||||
;; <funcsynopsisinfo>
 | 
			
		||||
;; #include <glibtop.h>
 | 
			
		||||
;; #include <glibtop/cpu.h></funcsynopsisinfo>
 | 
			
		||||
;; <funcdef>void <function>glibtop_get_cpu</function></funcdef>
 | 
			
		||||
;; <paramdef>glibtop *<parameter>server</parameter>, glibtop_cpu *<parameter>cpu_usage</parameter>
 | 
			
		||||
;; </paramdef></funcsynopsis>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
(begin
 | 
			
		||||
  (make-sysdeps-list)
 | 
			
		||||
 | 
			
		||||
  (display (string "<chapter id=\"functions\">\n"
 | 
			
		||||
		   "<title>Function Reference List</title>\n\n")
 | 
			
		||||
	   )
 | 
			
		||||
 | 
			
		||||
  (for-each (lambda (x)
 | 
			
		||||
	      (display (make-function-reference x))
 | 
			
		||||
	      )
 | 
			
		||||
	    (glibtop-names-sysdeps))
 | 
			
		||||
  )
 | 
			
		||||
@@ -1,195 +0,0 @@
 | 
			
		||||
(define cpu-type '(("name" . "cpu")
 | 
			
		||||
		   ("label" . "CPU Usage")
 | 
			
		||||
		   ("fields" . (("unsigned long" ("total" "Total CPU Usage")
 | 
			
		||||
						 ("user") ("nice") ("sys") ("idle"))
 | 
			
		||||
				("const char" ("name"))
 | 
			
		||||
				)
 | 
			
		||||
			     )
 | 
			
		||||
		   )
 | 
			
		||||
  )
 | 
			
		||||
 | 
			
		||||
;; computes constant for struct field (eg. GLIBTOP_CPU_TOTAL)
 | 
			
		||||
 | 
			
		||||
(define field-name-constant
 | 
			
		||||
  (lambda (name field)
 | 
			
		||||
    (string "GLIBTOP_"
 | 
			
		||||
	    (string-upcase! (string name))
 | 
			
		||||
	    "_"
 | 
			
		||||
	    (string-upcase! (string field)))
 | 
			
		||||
    )
 | 
			
		||||
  )
 | 
			
		||||
 | 
			
		||||
;; computes structure name (eg. glibtop_cpu)
 | 
			
		||||
 | 
			
		||||
(define make-struct-name
 | 
			
		||||
  (lambda (type)
 | 
			
		||||
    (string "glibtop_" (assoc-ref type "name"))
 | 
			
		||||
    )
 | 
			
		||||
  )
 | 
			
		||||
 | 
			
		||||
(define tab-pad-string
 | 
			
		||||
  (lambda (string tabs)
 | 
			
		||||
    (string-append string (make-string (- (* tabs 8) (string-length string)) #\space))
 | 
			
		||||
    )
 | 
			
		||||
  )
 | 
			
		||||
 | 
			
		||||
(define make-field-list
 | 
			
		||||
  (lambda (name type fields)
 | 
			
		||||
    (let* ((output (string)) (pos 1))
 | 
			
		||||
      (map
 | 
			
		||||
       (lambda (x)
 | 
			
		||||
	 (let* ((sep   (if (= pos (length fields)) ";" ","))
 | 
			
		||||
		(start (if (= pos 1)
 | 
			
		||||
			   (string "\t"
 | 
			
		||||
				   (tab-pad-string (string type) 2))
 | 
			
		||||
			   (string "\t\t"))
 | 
			
		||||
		       )
 | 
			
		||||
		(comment (string (if (= pos 1) "" "\t") "/* "
 | 
			
		||||
				 (tab-pad-string (field-name-constant name (car x)) 3)
 | 
			
		||||
				 " */"))
 | 
			
		||||
		(field (tab-pad-string (string-append (string (car x)) sep) 2))
 | 
			
		||||
		)
 | 
			
		||||
	   (set! pos (+ pos 1))
 | 
			
		||||
	   (string-append start field comment "\n")
 | 
			
		||||
	   )
 | 
			
		||||
	 )
 | 
			
		||||
       fields)
 | 
			
		||||
      )
 | 
			
		||||
    )
 | 
			
		||||
  )
 | 
			
		||||
 | 
			
		||||
(define make-struct-body
 | 
			
		||||
  (lambda (type)
 | 
			
		||||
    (let* ((name   (assoc-ref type "name"))
 | 
			
		||||
	   (data   (assoc-ref type "fields"))
 | 
			
		||||
	   (output (string))
 | 
			
		||||
	   )
 | 
			
		||||
      (for-each
 | 
			
		||||
       (lambda (y)
 | 
			
		||||
	 (for-each
 | 
			
		||||
	  (lambda (z)
 | 
			
		||||
	    (set! output (string-append output z))
 | 
			
		||||
	    )
 | 
			
		||||
	  y)
 | 
			
		||||
	 )
 | 
			
		||||
       (map
 | 
			
		||||
	(lambda (x) (make-field-list name (car x) (cdr x)))
 | 
			
		||||
	data)
 | 
			
		||||
       )
 | 
			
		||||
      output)
 | 
			
		||||
    )
 | 
			
		||||
  )
 | 
			
		||||
 | 
			
		||||
(define make-struct
 | 
			
		||||
  (lambda (type)
 | 
			
		||||
    (let* ((name   (assoc-ref type "name"))
 | 
			
		||||
	   (data   (assoc-ref type "fields"))
 | 
			
		||||
	   (output (string-append
 | 
			
		||||
		    (tab-pad-string
 | 
			
		||||
		     (string "typedef struct _glibtop_" name)
 | 
			
		||||
		     5)
 | 
			
		||||
		    (string "glibtop_" name ";\n\n"
 | 
			
		||||
			    "struct glibtop_" name "\n{\n\t"
 | 
			
		||||
			    "unsigned long\tflags;\n")
 | 
			
		||||
		    )
 | 
			
		||||
		   )
 | 
			
		||||
	   )
 | 
			
		||||
      (string-append output (make-struct-body type) "};\n")
 | 
			
		||||
      )
 | 
			
		||||
    )
 | 
			
		||||
  )
 | 
			
		||||
 | 
			
		||||
(define make-field-name-list
 | 
			
		||||
  (lambda (type)
 | 
			
		||||
    (let* ((name   (assoc-ref type "name"))
 | 
			
		||||
	   (data   (assoc-ref type "fields"))
 | 
			
		||||
	   (return (list))
 | 
			
		||||
	   )
 | 
			
		||||
      (map
 | 
			
		||||
       (lambda (x)
 | 
			
		||||
	 (map
 | 
			
		||||
	  (lambda (y) (set! return (append return (list (car y)))))
 | 
			
		||||
	  (cdr x)
 | 
			
		||||
	  )
 | 
			
		||||
	 )
 | 
			
		||||
       data)
 | 
			
		||||
      return)
 | 
			
		||||
    )
 | 
			
		||||
  )
 | 
			
		||||
 | 
			
		||||
(define make-field-constants
 | 
			
		||||
  (lambda (type)
 | 
			
		||||
    (let* ((name   (assoc-ref type "name"))
 | 
			
		||||
	   (data   (make-field-name-list type))
 | 
			
		||||
	   (output (string
 | 
			
		||||
		    (tab-pad-string
 | 
			
		||||
		     (string "#define GLIBTOP_MAX_"
 | 
			
		||||
			     (string-upcase! (string name))
 | 
			
		||||
			     ) 5)
 | 
			
		||||
		    (number->string (length data))
 | 
			
		||||
		    "\n\n"
 | 
			
		||||
		    )
 | 
			
		||||
		   )
 | 
			
		||||
	   (pos 0)
 | 
			
		||||
	   )
 | 
			
		||||
      (for-each
 | 
			
		||||
       (lambda (x)
 | 
			
		||||
	 (set! output (string-append output (string
 | 
			
		||||
					     (tab-pad-string
 | 
			
		||||
					      (string "#define GLIBTOP_"
 | 
			
		||||
						      (string-upcase! (string name))
 | 
			
		||||
						      "_"
 | 
			
		||||
						      (string-upcase! (string x))
 | 
			
		||||
						      ) 5)
 | 
			
		||||
					     (number->string pos)
 | 
			
		||||
					     "\n"
 | 
			
		||||
					     )
 | 
			
		||||
				     )
 | 
			
		||||
	       )
 | 
			
		||||
	 (set! pos (+ pos 1))
 | 
			
		||||
	 )
 | 
			
		||||
       data)
 | 
			
		||||
      output)
 | 
			
		||||
    )
 | 
			
		||||
  )
 | 
			
		||||
 | 
			
		||||
(define make-extern-defs
 | 
			
		||||
  (lambda (type)
 | 
			
		||||
    (let* ((name   (assoc-ref type "name"))
 | 
			
		||||
	   )
 | 
			
		||||
      (string
 | 
			
		||||
       (tab-pad-string (string "extern void glibtop_get_" name) 6)
 | 
			
		||||
       "__P(glibtop *, glibtop_" name " *);\n\n"
 | 
			
		||||
       "#ifdef HAVE_GUILE\n\n"
 | 
			
		||||
       "/* You need to link with -lgtop_guile to get this stuff here. */\n\n"
 | 
			
		||||
       (tab-pad-string (string "extern SCM glibtop_get_" name) 6)
 | 
			
		||||
       "__P(void);\n\n"
 | 
			
		||||
       "#endif /* HAVE_GUILE */\n\n"
 | 
			
		||||
       "#ifdef GLIBTOP_GUILE_NAMES\n\n"
 | 
			
		||||
       "/* You need to link with -lgtop_guile_names to get this stuff here. */\n\n"
 | 
			
		||||
       (tab-pad-string (string "extern SCM glibtop_guile_names_" name) 6)
 | 
			
		||||
       "__P(void);\n"
 | 
			
		||||
       (tab-pad-string (string "extern SCM glibtop_guile_labels_" name) 6)
 | 
			
		||||
       "__P(void);\n"
 | 
			
		||||
       (tab-pad-string (string "extern SCM glibtop_guile_descriptions_" name) 6)
 | 
			
		||||
       "__P(void);\n\n"
 | 
			
		||||
       "#endif /* GLIBTOP_GUILE_NAMES */\n\n"
 | 
			
		||||
       "#ifdef GLIBTOP_NAMES\n\n"
 | 
			
		||||
       "/* You need to link with -lgtop_names to get this stuff here. */\n\n"
 | 
			
		||||
       (tab-pad-string (string "extern const char *glibtop_names_" name) 6)
 | 
			
		||||
       "[];\n"
 | 
			
		||||
       (tab-pad-string (string "extern const char *glibtop_labels_" name) 6)
 | 
			
		||||
       "[];\n"
 | 
			
		||||
       (tab-pad-string (string "extern const char *glibtop_descriptions_" name) 6)
 | 
			
		||||
       "[];\n\n"
 | 
			
		||||
       "#endif /* GLIBTOP_NAMES */\n\n")
 | 
			
		||||
      )
 | 
			
		||||
    )
 | 
			
		||||
  )
 | 
			
		||||
 | 
			
		||||
(begin
 | 
			
		||||
  (display (make-field-constants cpu-type)) (newline)
 | 
			
		||||
  (display (make-struct cpu-type)) (newline)
 | 
			
		||||
  (display (make-extern-defs cpu-type)) (newline)
 | 
			
		||||
  )
 | 
			
		||||
 | 
			
		||||
@@ -5,5 +5,6 @@ glibtop_HEADERS		= close.h loadavg.h prockernel.h procstate.h \
 | 
			
		||||
			  proctime.h shm_limits.h version.h cpu.h msg_limits.h \
 | 
			
		||||
			  procmem.h procuid.h swap.h write.h error.h open.h \
 | 
			
		||||
			  procsegment.h read.h sysdeps.h xmalloc.h global.h \
 | 
			
		||||
			  output.h procsignal.h read_data.h union.h types.h \
 | 
			
		||||
			  parameter.h
 | 
			
		||||
			  procsignal.h read_data.h union.h types.h gnuserv.h \
 | 
			
		||||
			  parameter.h mountlist.h fsusage.h procmap.h signal.h \
 | 
			
		||||
			  inodedb.h sysinfo.h ppp.h procargs.h netload.h
 | 
			
		||||
 
 | 
			
		||||
@@ -28,6 +28,9 @@ __BEGIN_DECLS
 | 
			
		||||
 | 
			
		||||
extern void glibtop_close_r __P((glibtop *));
 | 
			
		||||
 | 
			
		||||
extern void glibtop_close_s __P((glibtop *));
 | 
			
		||||
extern void glibtop_close_p __P((glibtop *));
 | 
			
		||||
 | 
			
		||||
__END_DECLS
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -24,6 +24,7 @@
 | 
			
		||||
 | 
			
		||||
#include <glibtop.h>
 | 
			
		||||
#include <glibtop/sysdeps.h>
 | 
			
		||||
#include <glibtop/union.h>
 | 
			
		||||
 | 
			
		||||
__BEGIN_DECLS
 | 
			
		||||
 | 
			
		||||
@@ -47,8 +48,15 @@ __BEGIN_DECLS
 | 
			
		||||
#define GLIBTOP_CMND_PROC_SIGNAL	15
 | 
			
		||||
#define GLIBTOP_CMND_PROC_KERNEL	16
 | 
			
		||||
#define GLIBTOP_CMND_PROC_SEGMENT	17
 | 
			
		||||
#define GLIBTOP_CMND_PROC_ARGS		18
 | 
			
		||||
#define GLIBTOP_CMND_PROC_MAP		19
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_MAX_CMND		18
 | 
			
		||||
#define GLIBTOP_CMND_MOUNTLIST		20
 | 
			
		||||
#define GLIBTOP_CMND_FSUSAGE		21
 | 
			
		||||
#define GLIBTOP_CMND_NETLOAD		22
 | 
			
		||||
#define GLIBTOP_CMND_PPP		23
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_MAX_CMND		24
 | 
			
		||||
 | 
			
		||||
#define _GLIBTOP_PARAM_SIZE		16
 | 
			
		||||
 | 
			
		||||
@@ -59,9 +67,8 @@ typedef union  _glibtop_response_union	glibtop_response_union;
 | 
			
		||||
 | 
			
		||||
struct _glibtop_command
 | 
			
		||||
{
 | 
			
		||||
	glibtop		server;
 | 
			
		||||
	unsigned	command;
 | 
			
		||||
	size_t		size, data_size;
 | 
			
		||||
	u_int64_t	command;
 | 
			
		||||
	u_int64_t	size, data_size;
 | 
			
		||||
	char		parameter [_GLIBTOP_PARAM_SIZE];
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -73,15 +80,15 @@ union _glibtop_response_union
 | 
			
		||||
 | 
			
		||||
struct _glibtop_response
 | 
			
		||||
{
 | 
			
		||||
	off_t offset;
 | 
			
		||||
	size_t size, data_size;
 | 
			
		||||
	int64_t offset;
 | 
			
		||||
	u_int64_t size, data_size;
 | 
			
		||||
	glibtop_response_union u;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define glibtop_call(p1, p2, p3, p4)	glibtop_call_r(glibtop_global_server, p1, p2, p3, p4)
 | 
			
		||||
 | 
			
		||||
extern void *glibtop_call_l __P((glibtop *, unsigned, size_t, void *, size_t, void *));
 | 
			
		||||
extern void *glibtop_call_s __P((glibtop *, unsigned, size_t, void *, size_t, void *));
 | 
			
		||||
extern void *glibtop_call_l __P((glibtop *, unsigned, size_t, const void *, size_t, void *));
 | 
			
		||||
extern void *glibtop_call_s __P((glibtop *, unsigned, size_t, const void *, size_t, void *));
 | 
			
		||||
 | 
			
		||||
__END_DECLS
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -34,19 +34,33 @@ __BEGIN_DECLS
 | 
			
		||||
#define GLIBTOP_CPU_IDLE	4
 | 
			
		||||
#define GLIBTOP_CPU_FREQUENCY	5
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_MAX_CPU		6
 | 
			
		||||
#define GLIBTOP_XCPU_TOTAL	6
 | 
			
		||||
#define GLIBTOP_XCPU_USER	7
 | 
			
		||||
#define GLIBTOP_XCPU_NICE	8
 | 
			
		||||
#define GLIBTOP_XCPU_SYS	9
 | 
			
		||||
#define GLIBTOP_XCPU_IDLE	10
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_MAX_CPU		11
 | 
			
		||||
 | 
			
		||||
/* Nobody should really be using more than 4 processors. */
 | 
			
		||||
#define GLIBTOP_NCPU		4
 | 
			
		||||
 | 
			
		||||
typedef struct _glibtop_cpu	glibtop_cpu;
 | 
			
		||||
 | 
			
		||||
struct _glibtop_cpu
 | 
			
		||||
{
 | 
			
		||||
	unsigned long	flags,
 | 
			
		||||
		total,		/* GLIBTOP_CPU_TOTAL		*/
 | 
			
		||||
		user,		/* GLIBTOP_CPU_USER		*/
 | 
			
		||||
		nice,		/* GLIBTOP_CPU_NICE		*/
 | 
			
		||||
		sys,		/* GLIBTOP_CPU_SYS		*/
 | 
			
		||||
		idle,		/* GLIBTOP_CPU_IDLE		*/
 | 
			
		||||
		frequency;	/* GLIBTOP_CPU_FREQUENCY	*/
 | 
			
		||||
	u_int64_t	flags,
 | 
			
		||||
		total,				/* GLIBTOP_CPU_TOTAL		*/
 | 
			
		||||
		user,				/* GLIBTOP_CPU_USER		*/
 | 
			
		||||
		nice,				/* GLIBTOP_CPU_NICE		*/
 | 
			
		||||
		sys,				/* GLIBTOP_CPU_SYS		*/
 | 
			
		||||
		idle,				/* GLIBTOP_CPU_IDLE		*/
 | 
			
		||||
		frequency,			/* GLIBTOP_CPU_FREQUENCY	*/
 | 
			
		||||
		xcpu_total [GLIBTOP_NCPU],	/* GLIBTOP_XCPU_TOTAL		*/
 | 
			
		||||
		xcpu_user [GLIBTOP_NCPU],	/* GLIBTOP_XCPU_USER		*/
 | 
			
		||||
		xcpu_nice [GLIBTOP_NCPU],	/* GLIBTOP_XCPU_NICE		*/
 | 
			
		||||
		xcpu_sys  [GLIBTOP_NCPU],	/* GLIBTOP_XCPU_SYS		*/
 | 
			
		||||
		xcpu_idle [GLIBTOP_NCPU];	/* GLIBTOP_XCPU_IDLE		*/
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define glibtop_get_cpu(cpu)	glibtop_get_cpu_l(glibtop_global_server, cpu)
 | 
			
		||||
@@ -60,30 +74,13 @@ struct _glibtop_cpu
 | 
			
		||||
extern void glibtop_get_cpu_l __P((glibtop *, glibtop_cpu *));
 | 
			
		||||
 | 
			
		||||
#if GLIBTOP_SUID_CPU
 | 
			
		||||
extern void glibtop_init_cpu_p __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_cpu_p __P((glibtop *, glibtop_cpu *));
 | 
			
		||||
#else
 | 
			
		||||
extern void glibtop_init_cpu_s __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_cpu_s __P((glibtop *, glibtop_cpu *));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_GUILE
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_get_cpu __P((void));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_GUILE_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile_names to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_names_cpu __P((void));
 | 
			
		||||
extern SCM glibtop_guile_types_cpu __P((void));
 | 
			
		||||
extern SCM glibtop_guile_labels_cpu __P((void));
 | 
			
		||||
extern SCM glibtop_guile_descriptions_cpu __P((void));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_names to get this stuff here. */
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										71
									
								
								include/glibtop/fsusage.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										71
									
								
								include/glibtop/fsusage.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,71 @@
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
 | 
			
		||||
   This file is part of the Gnome Top Library.
 | 
			
		||||
   Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is free software; you can redistribute it and/or
 | 
			
		||||
   modify it under the terms of the GNU Library General Public License as
 | 
			
		||||
   published by the Free Software Foundation; either version 2 of the
 | 
			
		||||
   License, or (at your option) any later version.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is distributed in the hope that it will be useful,
 | 
			
		||||
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
   Library General Public License for more details.
 | 
			
		||||
 | 
			
		||||
   You should have received a copy of the GNU Library General Public
 | 
			
		||||
   License along with the GNU C Library; see the file COPYING.LIB.  If not,
 | 
			
		||||
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 | 
			
		||||
   Boston, MA 02111-1307, USA.  */
 | 
			
		||||
 | 
			
		||||
#ifndef __GLIBTOP_FSUSAGE_H__
 | 
			
		||||
#define __GLIBTOP_FSUSAGE_H__
 | 
			
		||||
 | 
			
		||||
#include <glibtop.h>
 | 
			
		||||
#include <glibtop/global.h>
 | 
			
		||||
 | 
			
		||||
__BEGIN_DECLS
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_FSUSAGE_BLOCKS		0
 | 
			
		||||
#define GLIBTOP_FSUSAGE_BFREE		1
 | 
			
		||||
#define GLIBTOP_FSUSAGE_BAVAIL		2
 | 
			
		||||
#define GLIBTOP_FSUSAGE_FILES		3
 | 
			
		||||
#define GLIBTOP_FSUSAGE_FFREE		4
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_MAX_FSUSAGE		5
 | 
			
		||||
 | 
			
		||||
typedef struct _glibtop_fsusage		glibtop_fsusage;
 | 
			
		||||
 | 
			
		||||
struct _glibtop_fsusage
 | 
			
		||||
{
 | 
			
		||||
	u_int64_t	flags,
 | 
			
		||||
		blocks,		/* Total blocks. */
 | 
			
		||||
		bfree,		/* Free blocks available to superuser. */
 | 
			
		||||
		bavail,		/* Free blocks available to non-superuser. */
 | 
			
		||||
		files,		/* Total file nodes. */
 | 
			
		||||
		ffree;		/* Free file nodes. */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define glibtop_get_fsusage(fsusage,disk)	glibtop_get_fsusage_l(glibtop_global_server, fsusage, disk)
 | 
			
		||||
 | 
			
		||||
#define glibtop_get_fsusage_r		glibtop_get_fsusage_s
 | 
			
		||||
 | 
			
		||||
extern void glibtop_get_fsusage_l __P((glibtop *, glibtop_fsusage *, const char *));
 | 
			
		||||
 | 
			
		||||
extern void glibtop_get_fsusage_s __P((glibtop *, glibtop_fsusage *, const char *));
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_names to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern const char *glibtop_names_fsusage [];
 | 
			
		||||
extern const unsigned glibtop_types_fsusage [];
 | 
			
		||||
extern const char *glibtop_labels_fsusage [];
 | 
			
		||||
extern const char *glibtop_descriptions_fsusage [];
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
__END_DECLS
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
@@ -51,6 +51,25 @@
 | 
			
		||||
# define __P(protos) ()
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef _IN_LIBGTOP
 | 
			
		||||
 | 
			
		||||
/* Provide macros to feature the GCC function attribute.
 | 
			
		||||
 */
 | 
			
		||||
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
 | 
			
		||||
#define G_GNUC_NORETURN				\
 | 
			
		||||
  __attribute__((noreturn))
 | 
			
		||||
#define G_GNUC_CONST				\
 | 
			
		||||
  __attribute__((const))
 | 
			
		||||
#define G_GNUC_UNUSED				\
 | 
			
		||||
  __attribute__((unused))
 | 
			
		||||
#else	/* !__GNUC__ */
 | 
			
		||||
#define G_GNUC_NORETURN
 | 
			
		||||
#define G_GNUC_CONST
 | 
			
		||||
#define	G_GNUC_UNUSED
 | 
			
		||||
#endif	/* !__GNUC__ */
 | 
			
		||||
 | 
			
		||||
#endif /* _IN_LIBGTOP */
 | 
			
		||||
 | 
			
		||||
#if TIME_WITH_SYS_TIME
 | 
			
		||||
# include <sys/time.h>
 | 
			
		||||
# include <time.h>
 | 
			
		||||
@@ -62,12 +81,16 @@
 | 
			
		||||
# endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef NEED_GNOMESUPPORT_H
 | 
			
		||||
#include <gnomesupport.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef WITHOUT_GUILE
 | 
			
		||||
#undef HAVE_GUILE
 | 
			
		||||
#undef GLIBTOP_GUILE
 | 
			
		||||
#undef GLIBTOP_GUILE_NAMES
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_GUILE
 | 
			
		||||
#ifdef GLIBTOP_GUILE
 | 
			
		||||
#include <guile/gh.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@@ -93,10 +116,16 @@
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <string.h>
 | 
			
		||||
 | 
			
		||||
#ifdef _IN_LIBGTOP
 | 
			
		||||
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#include <sys/param.h>
 | 
			
		||||
#include <sys/socket.h>
 | 
			
		||||
#include <sys/stat.h>
 | 
			
		||||
 | 
			
		||||
#endif /* _IN_LIBGTOP */
 | 
			
		||||
 | 
			
		||||
#include <signal.h>
 | 
			
		||||
#include <errno.h>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -75,7 +75,9 @@ static char header_rcsid [] = "!Header: gnuserv.h,v 2.4 95/02/16 11:58:11 arup a
 | 
			
		||||
 * stuff related to supporting MIT-MAGIC-COOKIE-1
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define MCOOKIE_SCREEN "42980"   /* screen # to use as the gnuserv cookie */
 | 
			
		||||
#if 0
 | 
			
		||||
#define MCOOKIE_SCREEN "42980"   /* screen # to use as the gnuserv cookie */ 
 | 
			
		||||
#endif
 | 
			
		||||
#define MCOOKIE_NAME   "MAGIC-1" /* authentication protocol name */
 | 
			
		||||
#define MCOOKIE_X_NAME "MIT-MAGIC-COOKIE-1"  /* as needed by X */
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										58
									
								
								include/glibtop/inodedb.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										58
									
								
								include/glibtop/inodedb.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,58 @@
 | 
			
		||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
 | 
			
		||||
   This file is part of the Gnome Top Library.
 | 
			
		||||
   Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is free software; you can redistribute it and/or
 | 
			
		||||
   modify it under the terms of the GNU Library General Public License as
 | 
			
		||||
   published by the Free Software Foundation; either version 2 of the
 | 
			
		||||
   License, or (at your option) any later version.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is distributed in the hope that it will be useful,
 | 
			
		||||
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
   Library General Public License for more details.
 | 
			
		||||
 | 
			
		||||
   You should have received a copy of the GNU Library General Public
 | 
			
		||||
   License along with the GNU C Library; see the file COPYING.LIB.  If not,
 | 
			
		||||
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 | 
			
		||||
   Boston, MA 02111-1307, USA.  */
 | 
			
		||||
 | 
			
		||||
#ifndef __GLIBTOP_INODEDB_H__
 | 
			
		||||
#define __GLIBTOP_INODEDB_H__
 | 
			
		||||
 | 
			
		||||
#include <glibtop.h>
 | 
			
		||||
#include <gdbm.h>
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_INODEDB_SYSTEM		1
 | 
			
		||||
#define GLIBTOP_INODEDB_USER		2
 | 
			
		||||
#define GLIBTOP_INODEDB_CACHE		4
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_INODEDB_ALL		7
 | 
			
		||||
 | 
			
		||||
__BEGIN_DECLS
 | 
			
		||||
 | 
			
		||||
typedef struct _glibtop_inodedb		glibtop_inodedb;
 | 
			
		||||
 | 
			
		||||
typedef struct _glibtop_inodedb_key	glibtop_inodedb_key;
 | 
			
		||||
 | 
			
		||||
struct _glibtop_inodedb_key
 | 
			
		||||
{
 | 
			
		||||
	u_int64_t device, inode;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct _glibtop_inodedb
 | 
			
		||||
{
 | 
			
		||||
	GDBM_FILE system_dbf, user_dbf;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define glibtop_inodedb_open(p1,p2)	glibtop_inodedb_open_s(glibtop_global_server, p1, p2)
 | 
			
		||||
#define glibtop_inodedb_lookup(p1,p2,p3) glibtop_inodedb_lookup_s(glibtop_global_server, p1, p2, p3)
 | 
			
		||||
#define glibtop_inodedb_close(p1)	glibtop_inodedb_close_s(glibtop_global_server)
 | 
			
		||||
 | 
			
		||||
extern glibtop_inodedb *glibtop_inodedb_open_s __P((glibtop *, unsigned, unsigned long));
 | 
			
		||||
extern const char *glibtop_inodedb_lookup_s __P((glibtop *, glibtop_inodedb *, u_int64_t, u_int64_t));
 | 
			
		||||
extern void glibtop_inodedb_close_s __P((glibtop *, glibtop_inodedb *));
 | 
			
		||||
 | 
			
		||||
__END_DECLS
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
@@ -28,15 +28,21 @@
 | 
			
		||||
__BEGIN_DECLS
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_LOADAVG_LOADAVG		0
 | 
			
		||||
#define GLIBTOP_LOADAVG_NR_RUNNING	1
 | 
			
		||||
#define GLIBTOP_LOADAVG_NR_TASKS	2
 | 
			
		||||
#define GLIBTOP_LOADAVG_LAST_PID	3
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_MAX_LOADAVG		1
 | 
			
		||||
#define GLIBTOP_MAX_LOADAVG		4
 | 
			
		||||
 | 
			
		||||
typedef struct _glibtop_loadavg	glibtop_loadavg;
 | 
			
		||||
 | 
			
		||||
struct _glibtop_loadavg
 | 
			
		||||
{
 | 
			
		||||
	unsigned long	flags;
 | 
			
		||||
	u_int64_t flags;
 | 
			
		||||
	double loadavg [3];		/* GLIBTOP_LOADAVG_LOADAVG	*/
 | 
			
		||||
	u_int64_t nr_running,		/* GLIBTOP_LOADAVG_NR_RUNNING	*/
 | 
			
		||||
		nr_tasks,		/* GLIBTOP_LOADAVG_NR_TASKS	*/
 | 
			
		||||
		last_pid;		/* GLIBTOP_LOADAVG_LAST_PID	*/
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define glibtop_get_loadavg(loadavg)	glibtop_get_loadavg_l(glibtop_global_server, loadavg)
 | 
			
		||||
@@ -50,30 +56,13 @@ struct _glibtop_loadavg
 | 
			
		||||
extern void glibtop_get_loadavg_l __P((glibtop *, glibtop_loadavg *));
 | 
			
		||||
 | 
			
		||||
#if GLIBTOP_SUID_LOADAVG
 | 
			
		||||
extern void glibtop_init_loadavg_p __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_loadavg_p __P((glibtop *, glibtop_loadavg *));
 | 
			
		||||
#else
 | 
			
		||||
extern void glibtop_init_loadavg_s __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_loadavg_s __P((glibtop *, glibtop_loadavg *));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_GUILE
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_get_loadavg __P((void));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_GUILE_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile_names to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_names_loadavg __P((void));
 | 
			
		||||
extern SCM glibtop_guile_types_loadavg __P((void));
 | 
			
		||||
extern SCM glibtop_guile_labels_loadavg __P((void));
 | 
			
		||||
extern SCM glibtop_guile_descriptions_loadavg __P((void));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_names to get this stuff here. */
 | 
			
		||||
 
 | 
			
		||||
@@ -42,7 +42,7 @@ typedef struct _glibtop_mem	glibtop_mem;
 | 
			
		||||
 | 
			
		||||
struct _glibtop_mem
 | 
			
		||||
{
 | 
			
		||||
	unsigned long	flags,
 | 
			
		||||
	u_int64_t	flags,
 | 
			
		||||
		total,		/* GLIBTOP_MEM_TOTAL	*/
 | 
			
		||||
		used,		/* GLIBTOP_MEM_USED	*/
 | 
			
		||||
		free,		/* GLIBTOP_MEM_FREE	*/
 | 
			
		||||
@@ -64,30 +64,13 @@ struct _glibtop_mem
 | 
			
		||||
extern void glibtop_get_mem_l __P((glibtop *, glibtop_mem *));
 | 
			
		||||
 | 
			
		||||
#if GLIBTOP_SUID_MEM
 | 
			
		||||
extern void glibtop_init_mem_p __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_mem_p __P((glibtop *, glibtop_mem *));
 | 
			
		||||
#else
 | 
			
		||||
extern void glibtop_init_mem_s __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_mem_s __P((glibtop *, glibtop_mem *));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_GUILE
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_get_mem __P((void));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_GUILE_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile_names to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_names_mem __P((void));
 | 
			
		||||
extern SCM glibtop_guile_types_mem __P((void));
 | 
			
		||||
extern SCM glibtop_guile_labels_mem __P((void));
 | 
			
		||||
extern SCM glibtop_guile_descriptions_mem __P((void));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_names to get this stuff here. */
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										77
									
								
								include/glibtop/mountlist.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										77
									
								
								include/glibtop/mountlist.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,77 @@
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
 | 
			
		||||
   This file is part of the Gnome Top Library.
 | 
			
		||||
   Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is free software; you can redistribute it and/or
 | 
			
		||||
   modify it under the terms of the GNU Library General Public License as
 | 
			
		||||
   published by the Free Software Foundation; either version 2 of the
 | 
			
		||||
   License, or (at your option) any later version.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is distributed in the hope that it will be useful,
 | 
			
		||||
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
   Library General Public License for more details.
 | 
			
		||||
 | 
			
		||||
   You should have received a copy of the GNU Library General Public
 | 
			
		||||
   License along with the GNU C Library; see the file COPYING.LIB.  If not,
 | 
			
		||||
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 | 
			
		||||
   Boston, MA 02111-1307, USA.  */
 | 
			
		||||
 | 
			
		||||
#ifndef __GLIBTOP_MOUNTLIST_H__
 | 
			
		||||
#define __GLIBTOP_MOUNTLIST_H__
 | 
			
		||||
 | 
			
		||||
#include <glibtop.h>
 | 
			
		||||
#include <glibtop/global.h>
 | 
			
		||||
 | 
			
		||||
__BEGIN_DECLS
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_MOUNTLIST_NUMBER	0
 | 
			
		||||
#define GLIBTOP_MOUNTLIST_TOTAL		1
 | 
			
		||||
#define GLIBTOP_MOUNTLIST_SIZE		2
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_MAX_MOUNTLIST		3
 | 
			
		||||
 | 
			
		||||
typedef struct _glibtop_mountentry	glibtop_mountentry;
 | 
			
		||||
 | 
			
		||||
typedef struct _glibtop_mountlist	glibtop_mountlist;
 | 
			
		||||
 | 
			
		||||
struct _glibtop_mountentry
 | 
			
		||||
{
 | 
			
		||||
	u_int64_t dev;
 | 
			
		||||
	char devname [GLIBTOP_MOUNTENTRY_LEN+1];
 | 
			
		||||
	char mountdir [GLIBTOP_MOUNTENTRY_LEN+1];
 | 
			
		||||
	char type [GLIBTOP_MOUNTENTRY_LEN+1];
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct _glibtop_mountlist
 | 
			
		||||
{
 | 
			
		||||
	u_int64_t	flags,
 | 
			
		||||
		number,			/* GLIBTOP_MOUNTLIST_NUMBER	*/
 | 
			
		||||
		total,			/* GLIBTOP_MOUNTLIST_TOTAL	*/
 | 
			
		||||
		size;			/* GLIBTOP_MOUNTLIST_SIZE	*/
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define glibtop_get_mountlist(mountlist,all_fs)	glibtop_get_mountlist_l(glibtop_global_server, mountlist, all_fs)
 | 
			
		||||
 | 
			
		||||
#define glibtop_get_mountlist_r		glibtop_get_mountlist_s
 | 
			
		||||
 | 
			
		||||
extern glibtop_mountentry *glibtop_get_mountlist_l __P((glibtop *, glibtop_mountlist *, int));
 | 
			
		||||
 | 
			
		||||
extern glibtop_mountentry *glibtop_get_mountlist_s __P((glibtop *, glibtop_mountlist *, int));
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_names to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern const char *glibtop_names_mountlist [];
 | 
			
		||||
extern const unsigned glibtop_types_mountlist [];
 | 
			
		||||
extern const char *glibtop_labels_mountlist [];
 | 
			
		||||
extern const char *glibtop_descriptions_mountlist [];
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
__END_DECLS
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
@@ -41,7 +41,7 @@ typedef struct _glibtop_msg_limits	glibtop_msg_limits;
 | 
			
		||||
 | 
			
		||||
struct _glibtop_msg_limits
 | 
			
		||||
{
 | 
			
		||||
	unsigned long	flags,
 | 
			
		||||
	u_int64_t	flags,
 | 
			
		||||
		msgpool,	/* GLIBTOP_IPC_MSGPOOL	*/
 | 
			
		||||
		msgmap,		/* GLIBTOP_IPC_MSGMAP	*/
 | 
			
		||||
		msgmax,		/* GLIBTOP_IPC_MSGMAX	*/
 | 
			
		||||
@@ -62,30 +62,13 @@ struct _glibtop_msg_limits
 | 
			
		||||
extern void glibtop_get_msg_limits_l __P((glibtop *, glibtop_msg_limits *));
 | 
			
		||||
 | 
			
		||||
#if GLIBTOP_SUID_MSG_LIMITS
 | 
			
		||||
extern void glibtop_init_msg_limits_p __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_msg_limits_p __P((glibtop *, glibtop_msg_limits *));
 | 
			
		||||
#else
 | 
			
		||||
extern void glibtop_init_msg_limits_s __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_msg_limits_s __P((glibtop *, glibtop_msg_limits *));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_GUILE
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_get_msg_limits __P((void));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_GUILE_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile_names to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_names_msg_limits __P((void));
 | 
			
		||||
extern SCM glibtop_guile_types_msg_limits __P((void));
 | 
			
		||||
extern SCM glibtop_guile_labels_msg_limits __P((void));
 | 
			
		||||
extern SCM glibtop_guile_descriptions_msg_limits __P((void));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_names to get this stuff here. */
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										118
									
								
								include/glibtop/netload.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										118
									
								
								include/glibtop/netload.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,118 @@
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
 | 
			
		||||
   This file is part of the Gnome Top Library.
 | 
			
		||||
   Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is free software; you can redistribute it and/or
 | 
			
		||||
   modify it under the terms of the GNU Library General Public License as
 | 
			
		||||
   published by the Free Software Foundation; either version 2 of the
 | 
			
		||||
   License, or (at your option) any later version.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is distributed in the hope that it will be useful,
 | 
			
		||||
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
   Library General Public License for more details.
 | 
			
		||||
 | 
			
		||||
   You should have received a copy of the GNU Library General Public
 | 
			
		||||
   License along with the GNU C Library; see the file COPYING.LIB.  If not,
 | 
			
		||||
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 | 
			
		||||
   Boston, MA 02111-1307, USA.  */
 | 
			
		||||
 | 
			
		||||
#ifndef __GLIBTOP_NETLOAD_H__
 | 
			
		||||
#define __GLIBTOP_NETLOAD_H__
 | 
			
		||||
 | 
			
		||||
#include <glibtop.h>
 | 
			
		||||
#include <glibtop/global.h>
 | 
			
		||||
 | 
			
		||||
__BEGIN_DECLS
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_NETLOAD_IF_FLAGS	0
 | 
			
		||||
#define GLIBTOP_NETLOAD_MTU		1
 | 
			
		||||
#define GLIBTOP_NETLOAD_SUBNET		2
 | 
			
		||||
#define GLIBTOP_NETLOAD_ADDRESS		3
 | 
			
		||||
#define GLIBTOP_NETLOAD_PACKETS_IN	4
 | 
			
		||||
#define GLIBTOP_NETLOAD_PACKETS_OUT	5
 | 
			
		||||
#define GLIBTOP_NETLOAD_PACKETS_TOTAL	6
 | 
			
		||||
#define GLIBTOP_NETLOAD_BYTES_IN	7
 | 
			
		||||
#define GLIBTOP_NETLOAD_BYTES_OUT	8
 | 
			
		||||
#define GLIBTOP_NETLOAD_BYTES_TOTAL	9
 | 
			
		||||
#define GLIBTOP_NETLOAD_ERRORS_IN	10
 | 
			
		||||
#define GLIBTOP_NETLOAD_ERRORS_OUT	11
 | 
			
		||||
#define GLIBTOP_NETLOAD_ERRORS_TOTAL	12
 | 
			
		||||
#define GLIBTOP_NETLOAD_COLLISIONS	13
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_MAX_NETLOAD		14
 | 
			
		||||
 | 
			
		||||
typedef struct _glibtop_netload	glibtop_netload;
 | 
			
		||||
 | 
			
		||||
enum {
 | 
			
		||||
	GLIBTOP_IF_FLAGS_UP = 1,
 | 
			
		||||
	GLIBTOP_IF_FLAGS_BROADCAST,
 | 
			
		||||
	GLIBTOP_IF_FLAGS_DEBUG,
 | 
			
		||||
	GLIBTOP_IF_FLAGS_LOOPBACK,
 | 
			
		||||
	GLIBTOP_IF_FLAGS_POINTOPOINT,
 | 
			
		||||
	GLIBTOP_IF_FLAGS_RUNNING,
 | 
			
		||||
	GLIBTOP_IF_FLAGS_NOARP,
 | 
			
		||||
	GLIBTOP_IF_FLAGS_PROMISC,
 | 
			
		||||
	GLIBTOP_IF_FLAGS_ALLMULTI,
 | 
			
		||||
	GLIBTOP_IF_FLAGS_OACTIVE,
 | 
			
		||||
	GLIBTOP_IF_FLAGS_SIMPLEX,
 | 
			
		||||
	GLIBTOP_IF_FLAGS_LINK0,
 | 
			
		||||
	GLIBTOP_IF_FLAGS_LINK1,
 | 
			
		||||
	GLIBTOP_IF_FLAGS_LINK2,
 | 
			
		||||
	GLIBTOP_IF_FLAGS_ALTPHYS,
 | 
			
		||||
	GLIBTOP_IF_FLAGS_MULTICAST
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct _glibtop_netload
 | 
			
		||||
{
 | 
			
		||||
	u_int64_t	flags,
 | 
			
		||||
		if_flags,		/* GLIBTOP_NETLOAD_IF_FLAGS	*/
 | 
			
		||||
		mtu,			/* GLIBTOP_NETLOAD_MTU		*/
 | 
			
		||||
		subnet,			/* GLIBTOP_NETLOAD_SUBNET	*/
 | 
			
		||||
		address,		/* GLIBTOP_NETLOAD_ADDRESS	*/
 | 
			
		||||
		packets_in,		/* GLIBTOP_NETLOAD_PACKETS_IN	*/
 | 
			
		||||
		packets_out,		/* GLIBTOP_NETLOAD_PACKETS_OUT	*/
 | 
			
		||||
		packets_total,		/* GLIBTOP_NETLOAD_PACKETS_TOTAL*/
 | 
			
		||||
		bytes_in,		/* GLIBTOP_NETLOAD_BYTES_IN	*/
 | 
			
		||||
		bytes_out,		/* GLIBTOP_NETLOAD_BYTES_OUT	*/
 | 
			
		||||
		bytes_total,		/* GLIBTOP_NETLOAD_BYTES_TOTAL	*/
 | 
			
		||||
		errors_in,		/* GLIBTOP_NETLOAD_ERRORS_IN	*/
 | 
			
		||||
		errors_out,		/* GLIBTOP_NETLOAD_ERRORS_OUT	*/
 | 
			
		||||
		errors_total,		/* GLIBTOP_NETLOAD_ERRORS_TOTAL	*/
 | 
			
		||||
		collisions;		/* GLIBTOP_NETLOAD_COLLISIONS	*/
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define glibtop_get_netload(netload,interface)	glibtop_get_netload_l(glibtop_global_server, netload, interface)
 | 
			
		||||
 | 
			
		||||
#if GLIBTOP_SUID_NETLOAD
 | 
			
		||||
#define glibtop_get_netload_r	glibtop_get_netload_p
 | 
			
		||||
#else
 | 
			
		||||
#define glibtop_get_netload_r	glibtop_get_netload_s
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
extern void glibtop_get_netload_l __P((glibtop *, glibtop_netload *, const char *));
 | 
			
		||||
 | 
			
		||||
#if GLIBTOP_SUID_NETLOAD
 | 
			
		||||
extern void glibtop_init_netload_p __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_netload_p __P((glibtop *, glibtop_netload *, const char *));
 | 
			
		||||
#else
 | 
			
		||||
extern void glibtop_init_netload_s __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_netload_s __P((glibtop *, glibtop_netload *, const char *));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_names to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern const char *glibtop_names_netload [];
 | 
			
		||||
extern const unsigned glibtop_types_netload [];
 | 
			
		||||
extern const char *glibtop_labels_netload [];
 | 
			
		||||
extern const char *glibtop_descriptions_netload [];
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
__END_DECLS
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
@@ -29,20 +29,31 @@ __BEGIN_DECLS
 | 
			
		||||
#define _GLIBTOP_INIT_STATE_INIT	0x10000
 | 
			
		||||
#define _GLIBTOP_INIT_STATE_OPEN	0x20000
 | 
			
		||||
#define _GLIBTOP_INIT_STATE_SERVER	0x40000
 | 
			
		||||
#define _GLIBTOP_INIT_STATE_SYSDEPS	0x80000
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_INIT_NO_OPEN		1
 | 
			
		||||
#define GLIBTOP_INIT_NO_INIT		2
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_OPEN_NO_OVERRIDE	1
 | 
			
		||||
#define GLIBTOP_FEATURES_NO_SERVER	4
 | 
			
		||||
#define GLIBTOP_FEATURES_EXCEPT		8
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_METHOD_DIRECT		1
 | 
			
		||||
#define GLIBTOP_METHOD_PIPE		2
 | 
			
		||||
#define GLIBTOP_METHOD_INET		3
 | 
			
		||||
#define GLIBTOP_METHOD_UNIX		4
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_ERROR_METHOD_IGNORE	0
 | 
			
		||||
#define GLIBTOP_ERROR_METHOD_WARN_ONCE	1
 | 
			
		||||
#define GLIBTOP_ERROR_METHOD_WARN	2
 | 
			
		||||
#define GLIBTOP_ERROR_METHOD_ABORT	3
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_ERROR_METHOD_DEFAULT	GLIBTOP_ERROR_METHOD_WARN_ONCE
 | 
			
		||||
 | 
			
		||||
extern void glibtop_open_l __P((glibtop *, const char *, const unsigned long, const unsigned));
 | 
			
		||||
 | 
			
		||||
extern void glibtop_open_r __P((glibtop *, const char *, const unsigned long, const unsigned));
 | 
			
		||||
extern void glibtop_init_p __P((glibtop *, const unsigned long, const unsigned));
 | 
			
		||||
extern void glibtop_open_p __P((glibtop *, const char *, const unsigned long, const unsigned));
 | 
			
		||||
extern void glibtop_open_s __P((glibtop *, const char *, const unsigned long, const unsigned));
 | 
			
		||||
 | 
			
		||||
__END_DECLS
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -25,11 +25,13 @@
 | 
			
		||||
 | 
			
		||||
__BEGIN_DECLS
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_PARAM_METHOD	1
 | 
			
		||||
#define GLIBTOP_PARAM_FEATURES	2
 | 
			
		||||
#define GLIBTOP_PARAM_COMMAND	3
 | 
			
		||||
#define GLIBTOP_PARAM_HOST	4
 | 
			
		||||
#define GLIBTOP_PARAM_PORT	5
 | 
			
		||||
#define GLIBTOP_PARAM_METHOD		1
 | 
			
		||||
#define GLIBTOP_PARAM_FEATURES		2
 | 
			
		||||
#define GLIBTOP_PARAM_COMMAND		3
 | 
			
		||||
#define GLIBTOP_PARAM_HOST		4
 | 
			
		||||
#define GLIBTOP_PARAM_PORT		5
 | 
			
		||||
#define GLIBTOP_PARAM_ERROR_METHOD	6
 | 
			
		||||
#define GLIBTOP_PARAM_REQUIRED		7
 | 
			
		||||
 | 
			
		||||
#define glibtop_get_parameter(p1,p2,p3)	glibtop_get_parameter_l(glibtop_global_server,p1,p2,p3)
 | 
			
		||||
#define glibtop_set_parameter(p1,p2,p3) glibtop_set_parameter_l(glibtop_global_server,p1,p2,p3)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										83
									
								
								include/glibtop/ppp.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										83
									
								
								include/glibtop/ppp.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,83 @@
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
 | 
			
		||||
   This file is part of the Gnome Top Library.
 | 
			
		||||
   Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is free software; you can redistribute it and/or
 | 
			
		||||
   modify it under the terms of the GNU Library General Public License as
 | 
			
		||||
   published by the Free Software Foundation; either version 2 of the
 | 
			
		||||
   License, or (at your option) any later version.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is distributed in the hope that it will be useful,
 | 
			
		||||
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
   Library General Public License for more details.
 | 
			
		||||
 | 
			
		||||
   You should have received a copy of the GNU Library General Public
 | 
			
		||||
   License along with the GNU C Library; see the file COPYING.LIB.  If not,
 | 
			
		||||
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 | 
			
		||||
   Boston, MA 02111-1307, USA.  */
 | 
			
		||||
 | 
			
		||||
#ifndef __GLIBTOP_PPP_H__
 | 
			
		||||
#define __GLIBTOP_PPP_H__
 | 
			
		||||
 | 
			
		||||
#include <glibtop.h>
 | 
			
		||||
#include <glibtop/global.h>
 | 
			
		||||
 | 
			
		||||
__BEGIN_DECLS
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_PPP_STATE	0
 | 
			
		||||
#define GLIBTOP_PPP_BYTES_IN	1	
 | 
			
		||||
#define GLIBTOP_PPP_BYTES_OUT	2
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_MAX_PPP		3
 | 
			
		||||
 | 
			
		||||
typedef struct _glibtop_ppp	glibtop_ppp;
 | 
			
		||||
 | 
			
		||||
enum {
 | 
			
		||||
	GLIBTOP_PPP_STATE_UNKNOWN = 0,
 | 
			
		||||
	GLIBTOP_PPP_STATE_HANGUP,
 | 
			
		||||
	GLIBTOP_PPP_STATE_ONLINE
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct _glibtop_ppp
 | 
			
		||||
{
 | 
			
		||||
	u_int64_t	flags,
 | 
			
		||||
		state,			/* GLIBTOP_PPP_STATE		*/
 | 
			
		||||
		bytes_in,		/* GLIBTOP_PPP_BYTES_IN		*/
 | 
			
		||||
		bytes_out;		/* GLIBTOP_PPP_BYTES_OUT	*/
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define glibtop_get_ppp(ppp,device)	glibtop_get_ppp_l(glibtop_global_server, ppp, device)
 | 
			
		||||
 | 
			
		||||
#if GLIBTOP_SUID_PPP
 | 
			
		||||
#define glibtop_get_ppp_r	glibtop_get_ppp_p
 | 
			
		||||
#else
 | 
			
		||||
#define glibtop_get_ppp_r	glibtop_get_ppp_s
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
extern void glibtop_get_ppp_l __P((glibtop *, glibtop_ppp *, unsigned short));
 | 
			
		||||
 | 
			
		||||
#if GLIBTOP_SUID_PPP
 | 
			
		||||
extern void glibtop_init_ppp_p __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_ppp_p __P((glibtop *, glibtop_ppp *, unsigned short));
 | 
			
		||||
#else
 | 
			
		||||
extern void glibtop_init_ppp_s __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_ppp_s __P((glibtop *, glibtop_ppp *, unsigned short));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_names to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern const char *glibtop_names_ppp [];
 | 
			
		||||
extern const unsigned glibtop_types_ppp [];
 | 
			
		||||
extern const char *glibtop_labels_ppp [];
 | 
			
		||||
extern const char *glibtop_descriptions_ppp [];
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
__END_DECLS
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
							
								
								
									
										73
									
								
								include/glibtop/procargs.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										73
									
								
								include/glibtop/procargs.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,73 @@
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
 | 
			
		||||
   This file is part of the Gnome Top Library.
 | 
			
		||||
   Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is free software; you can redistribute it and/or
 | 
			
		||||
   modify it under the terms of the GNU Library General Public License as
 | 
			
		||||
   published by the Free Software Foundation; either version 2 of the
 | 
			
		||||
   License, or (at your option) any later version.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is distributed in the hope that it will be useful,
 | 
			
		||||
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
   Library General Public License for more details.
 | 
			
		||||
 | 
			
		||||
   You should have received a copy of the GNU Library General Public
 | 
			
		||||
   License along with the GNU C Library; see the file COPYING.LIB.  If not,
 | 
			
		||||
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 | 
			
		||||
   Boston, MA 02111-1307, USA.  */
 | 
			
		||||
 | 
			
		||||
#ifndef __GLIBTOP_PROC_ARGS_H__
 | 
			
		||||
#define __GLIBTOP_PROC_ARGS_H__
 | 
			
		||||
 | 
			
		||||
#include <glibtop.h>
 | 
			
		||||
#include <glibtop/global.h>
 | 
			
		||||
 | 
			
		||||
__BEGIN_DECLS
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_PROC_ARGS_SIZE		0
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_MAX_PROC_ARGS		1
 | 
			
		||||
 | 
			
		||||
typedef struct _glibtop_proc_args	glibtop_proc_args;
 | 
			
		||||
 | 
			
		||||
struct _glibtop_proc_args
 | 
			
		||||
{
 | 
			
		||||
	u_int64_t	flags,
 | 
			
		||||
		size;			/* GLIBTOP_PROC_ARGS_SIZE	*/
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define glibtop_get_proc_args(proc_args,pid,max_len) glibtop_get_proc_args_l(glibtop_global_server, proc_args, pid, max_len)
 | 
			
		||||
 | 
			
		||||
#if GLIBTOP_SUID_PROC_ARGS
 | 
			
		||||
#define glibtop_get_proc_args_r		glibtop_get_proc_args_p
 | 
			
		||||
#else
 | 
			
		||||
#define glibtop_get_proc_args_r		glibtop_get_proc_args_s
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
extern char  *glibtop_get_proc_args_l __P((glibtop *, glibtop_proc_args *, pid_t, unsigned));
 | 
			
		||||
 | 
			
		||||
#if GLIBTOP_SUID_PROC_ARGS
 | 
			
		||||
extern void glibtop_init_proc_args_p __P((glibtop *));
 | 
			
		||||
extern char *glibtop_get_proc_args_p __P((glibtop *, glibtop_proc_args *, pid_t, unsigned));
 | 
			
		||||
#else
 | 
			
		||||
extern void glibtop_init_proc_args_s __P((glibtop *));
 | 
			
		||||
extern char *glibtop_get_proc_args_s __P((glibtop *, glibtop_proc_args *, pid_t, unsigned));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_names to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern const char *glibtop_names_proc_args [];
 | 
			
		||||
extern const unsigned glibtop_types_proc_args [];
 | 
			
		||||
extern const char *glibtop_labels_proc_args [];
 | 
			
		||||
extern const char *glibtop_descriptions_proc_args [];
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
__END_DECLS
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
@@ -34,9 +34,10 @@ __BEGIN_DECLS
 | 
			
		||||
#define GLIBTOP_PROC_KERNEL_CMAJ_FLT	4
 | 
			
		||||
#define GLIBTOP_PROC_KERNEL_KSTK_ESP	5
 | 
			
		||||
#define GLIBTOP_PROC_KERNEL_KSTK_EIP	6
 | 
			
		||||
#define GLIBTOP_PROC_KERNEL_WCHAN	7
 | 
			
		||||
#define GLIBTOP_PROC_KERNEL_NWCHAN	7
 | 
			
		||||
#define GLIBTOP_PROC_KERNEL_WCHAN	8
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_MAX_PROC_KERNEL		8
 | 
			
		||||
#define GLIBTOP_MAX_PROC_KERNEL		9
 | 
			
		||||
 | 
			
		||||
typedef struct _glibtop_proc_kernel	glibtop_proc_kernel;
 | 
			
		||||
 | 
			
		||||
@@ -44,8 +45,8 @@ typedef struct _glibtop_proc_kernel	glibtop_proc_kernel;
 | 
			
		||||
 | 
			
		||||
struct _glibtop_proc_kernel
 | 
			
		||||
{
 | 
			
		||||
	unsigned long flags;
 | 
			
		||||
	unsigned long k_flags,	/* kernel flags for the process */
 | 
			
		||||
	u_int64_t flags;
 | 
			
		||||
	u_int64_t k_flags,	/* kernel flags for the process */
 | 
			
		||||
		min_flt,	/* number of minor page faults since
 | 
			
		||||
				 * process start */
 | 
			
		||||
		maj_flt,	/* number of major page faults since
 | 
			
		||||
@@ -56,8 +57,9 @@ struct _glibtop_proc_kernel
 | 
			
		||||
				 * child processes */
 | 
			
		||||
		kstk_esp,	/* kernel stack pointer */
 | 
			
		||||
		kstk_eip,	/* kernel stack pointer */
 | 
			
		||||
		wchan;		/* address of kernel wait channel
 | 
			
		||||
		nwchan;		/* address of kernel wait channel
 | 
			
		||||
				 * proc is sleeping in */
 | 
			
		||||
	char wchan [40];
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define glibtop_get_proc_kernel(p1, p2)	glibtop_get_proc_kernel_l(glibtop_global_server, p1, p2)
 | 
			
		||||
@@ -71,30 +73,13 @@ struct _glibtop_proc_kernel
 | 
			
		||||
extern void glibtop_get_proc_kernel_l __P((glibtop *, glibtop_proc_kernel *, pid_t));
 | 
			
		||||
 | 
			
		||||
#if GLIBTOP_SUID_PROC_KERNEL
 | 
			
		||||
extern void glibtop_init_proc_kernel_p __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_proc_kernel_p __P((glibtop *, glibtop_proc_kernel *, pid_t));
 | 
			
		||||
#else
 | 
			
		||||
extern void glibtop_init_proc_kernel_s __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_proc_kernel_s __P((glibtop *, glibtop_proc_kernel *, pid_t));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_GUILE
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_get_proc_kernel __P((SCM));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_GUILE_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile_names to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_types_proc_kernel __P((void));
 | 
			
		||||
extern SCM glibtop_guile_names_proc_kernel __P((void));
 | 
			
		||||
extern SCM glibtop_guile_labels_proc_kernel __P((void));
 | 
			
		||||
extern SCM glibtop_guile_descriptions_proc_kernel __P((void));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_names to get this stuff here. */
 | 
			
		||||
 
 | 
			
		||||
@@ -33,17 +33,34 @@ __BEGIN_DECLS
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_MAX_PROCLIST	3
 | 
			
		||||
 | 
			
		||||
/* You can use the folowing constants as the `which' member of
 | 
			
		||||
 * glibtop_get_proclist () to specify which processes to fetch. */
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_KERN_PROC_ALL		0	/* all processes */
 | 
			
		||||
#define GLIBTOP_KERN_PROC_PID		1
 | 
			
		||||
#define GLIBTOP_KERN_PROC_PGRP		2
 | 
			
		||||
#define GLIBTOP_KERN_PROC_SESSION	3
 | 
			
		||||
#define GLIBTOP_KERN_PROC_TTY		4
 | 
			
		||||
#define GLIBTOP_KERN_PROC_UID		5
 | 
			
		||||
#define GLIBTOP_KERN_PROC_RUID		6
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_KERN_PROC_MASK		15
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_EXCLUDE_IDLE		0x1000
 | 
			
		||||
#define GLIBTOP_EXCLUDE_SYSTEM		0x2000
 | 
			
		||||
#define GLIBTOP_EXCLUDE_NOTTY		0x4000
 | 
			
		||||
 | 
			
		||||
typedef struct _glibtop_proclist	glibtop_proclist;
 | 
			
		||||
 | 
			
		||||
struct _glibtop_proclist
 | 
			
		||||
{
 | 
			
		||||
	unsigned long	flags,
 | 
			
		||||
	u_int64_t	flags,
 | 
			
		||||
		number,			/* GLIBTOP_PROCLIST_NUMBER	*/
 | 
			
		||||
		total,			/* GLIBTOP_PROCLIST_TOTAL	*/
 | 
			
		||||
		size;			/* GLIBTOP_PROCLIST_SIZE	*/
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define glibtop_get_proclist(proclist)	glibtop_get_proclist_l(glibtop_global_server, proclist)
 | 
			
		||||
#define glibtop_get_proclist(proclist,which,arg) glibtop_get_proclist_l(glibtop_global_server, proclist, which, arg)
 | 
			
		||||
 | 
			
		||||
#if GLIBTOP_SUID_PROCLIST
 | 
			
		||||
#define glibtop_get_proclist_r		glibtop_get_proclist_p
 | 
			
		||||
@@ -51,31 +68,14 @@ struct _glibtop_proclist
 | 
			
		||||
#define glibtop_get_proclist_r		glibtop_get_proclist_s
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
extern unsigned *glibtop_get_proclist_l __P((glibtop *, glibtop_proclist *));
 | 
			
		||||
extern unsigned *glibtop_get_proclist_l __P((glibtop *, glibtop_proclist *, int64_t, int64_t));
 | 
			
		||||
 | 
			
		||||
#if GLIBTOP_SUID_PROCLIST
 | 
			
		||||
extern unsigned *glibtop_get_proclist_p __P((glibtop *, glibtop_proclist *));
 | 
			
		||||
extern void glibtop_init_proclist_p __P((glibtop *));
 | 
			
		||||
extern unsigned *glibtop_get_proclist_p __P((glibtop *, glibtop_proclist *, int64_t, int64_t));
 | 
			
		||||
#else
 | 
			
		||||
extern unsigned *glibtop_get_proclist_s __P((glibtop *, glibtop_proclist *));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_GUILE
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_get_proclist __P((void));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_GUILE_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile_names to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_names_proclist __P((void));
 | 
			
		||||
extern SCM glibtop_guile_types_proclist __P((void));
 | 
			
		||||
extern SCM glibtop_guile_labels_proclist __P((void));
 | 
			
		||||
extern SCM glibtop_guile_descriptions_proclist __P((void));
 | 
			
		||||
 | 
			
		||||
extern void glibtop_init_proclist_s __P((glibtop *));
 | 
			
		||||
extern unsigned *glibtop_get_proclist_s __P((glibtop *, glibtop_proclist *, int64_t, int64_t));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_NAMES
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										103
									
								
								include/glibtop/procmap.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										103
									
								
								include/glibtop/procmap.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,103 @@
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
 | 
			
		||||
   This file is part of the Gnome Top Library.
 | 
			
		||||
   Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is free software; you can redistribute it and/or
 | 
			
		||||
   modify it under the terms of the GNU Library General Public License as
 | 
			
		||||
   published by the Free Software Foundation; either version 2 of the
 | 
			
		||||
   License, or (at your option) any later version.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is distributed in the hope that it will be useful,
 | 
			
		||||
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
   Library General Public License for more details.
 | 
			
		||||
 | 
			
		||||
   You should have received a copy of the GNU Library General Public
 | 
			
		||||
   License along with the GNU C Library; see the file COPYING.LIB.  If not,
 | 
			
		||||
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 | 
			
		||||
   Boston, MA 02111-1307, USA.  */
 | 
			
		||||
 | 
			
		||||
#ifndef __GLIBTOP_PROC_MAP_H__
 | 
			
		||||
#define __GLIBTOP_PROC_MAP_H__
 | 
			
		||||
 | 
			
		||||
#include <glibtop.h>
 | 
			
		||||
#include <glibtop/global.h>
 | 
			
		||||
 | 
			
		||||
__BEGIN_DECLS
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_PROC_MAP_NUMBER		0
 | 
			
		||||
#define GLIBTOP_PROC_MAP_TOTAL		1
 | 
			
		||||
#define GLIBTOP_PROC_MAP_SIZE		2
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_MAX_PROC_MAP		3
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_MAP_ENTRY_START		1
 | 
			
		||||
#define GLIBTOP_MAP_ENTRY_END		2
 | 
			
		||||
#define GLIBTOP_MAP_ENTRY_OFFSET	3
 | 
			
		||||
#define GLIBTOP_MAP_ENTRY_PERM		4
 | 
			
		||||
#define GLIBTOP_MAP_ENTRY_INODE		5
 | 
			
		||||
#define GLIBTOP_MAP_ENTRY_DEVICE	6
 | 
			
		||||
#define GLIBTOP_MAP_ENTRY_FILENAME	7
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_MAX_MAP_ENTRY		8
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_MAP_FILENAME_LEN	215
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_MAP_PERM_READ		1
 | 
			
		||||
#define GLIBTOP_MAP_PERM_WRITE		2
 | 
			
		||||
#define GLIBTOP_MAP_PERM_EXECUTE	4
 | 
			
		||||
#define GLIBTOP_MAP_PERM_SHARED		8
 | 
			
		||||
#define GLIBTOP_MAP_PERM_PRIVATE	16
 | 
			
		||||
 | 
			
		||||
typedef struct _glibtop_map_entry	glibtop_map_entry;
 | 
			
		||||
 | 
			
		||||
typedef struct _glibtop_proc_map	glibtop_proc_map;
 | 
			
		||||
 | 
			
		||||
struct _glibtop_map_entry
 | 
			
		||||
{
 | 
			
		||||
	u_int64_t flags, start, end, offset, perm, inode, device;
 | 
			
		||||
	char filename [GLIBTOP_MAP_FILENAME_LEN+1];
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct _glibtop_proc_map
 | 
			
		||||
{
 | 
			
		||||
	u_int64_t	flags,
 | 
			
		||||
		number,			/* GLIBTOP_PROC_MAP_NUMBER	*/
 | 
			
		||||
		total,			/* GLIBTOP_PROC_MAP_TOTAL	*/
 | 
			
		||||
		size;			/* GLIBTOP_PROC_MAP_SIZE	*/
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define glibtop_get_proc_map(proc_map,pid) glibtop_get_proc_map_l(glibtop_global_server, proc_map, pid)
 | 
			
		||||
 | 
			
		||||
#if GLIBTOP_SUID_PROC_MAP
 | 
			
		||||
#define glibtop_get_proc_map_r		glibtop_get_proc_map_p
 | 
			
		||||
#else
 | 
			
		||||
#define glibtop_get_proc_map_r		glibtop_get_proc_map_s
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
extern glibtop_map_entry *glibtop_get_proc_map_l __P((glibtop *, glibtop_proc_map *, pid_t));
 | 
			
		||||
 | 
			
		||||
#if GLIBTOP_SUID_PROC_MAP
 | 
			
		||||
extern void glibtop_init_proc_map_p __P((glibtop *));
 | 
			
		||||
extern glibtop_map_entry *glibtop_get_proc_map_p __P((glibtop *, glibtop_proc_map *, pid_t));
 | 
			
		||||
#else
 | 
			
		||||
extern void glibtop_init_proc_map_s __P((glibtop *));
 | 
			
		||||
extern glibtop_map_entry *glibtop_get_proc_map_s __P((glibtop *, glibtop_proc_map *, pid_t));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_names to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern const char *glibtop_names_proc_map [];
 | 
			
		||||
extern const unsigned glibtop_types_proc_map [];
 | 
			
		||||
extern const char *glibtop_labels_proc_map [];
 | 
			
		||||
extern const char *glibtop_descriptions_proc_map [];
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
__END_DECLS
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
@@ -42,8 +42,8 @@ typedef struct _glibtop_proc_mem	glibtop_proc_mem;
 | 
			
		||||
 | 
			
		||||
struct _glibtop_proc_mem
 | 
			
		||||
{
 | 
			
		||||
	unsigned long flags;
 | 
			
		||||
	long size,		/* total # of pages of memory */
 | 
			
		||||
	u_int64_t	flags,
 | 
			
		||||
		size,		/* total # of pages of memory */
 | 
			
		||||
		vsize,		/* number of pages of virtual memory ... */
 | 
			
		||||
		resident,	/* number of resident set
 | 
			
		||||
				 * (non-swapped) pages (4k) */
 | 
			
		||||
@@ -64,30 +64,13 @@ struct _glibtop_proc_mem
 | 
			
		||||
extern void glibtop_get_proc_mem_l __P((glibtop *, glibtop_proc_mem *, pid_t));
 | 
			
		||||
 | 
			
		||||
#if GLIBTOP_SUID_PROC_MEM
 | 
			
		||||
extern void glibtop_init_proc_mem_p __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_proc_mem_p __P((glibtop *, glibtop_proc_mem *, pid_t));
 | 
			
		||||
#else
 | 
			
		||||
extern void glibtop_init_proc_mem_s __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_proc_mem_s __P((glibtop *, glibtop_proc_mem *, pid_t));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_GUILE
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_get_proc_mem __P((SCM));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_GUILE_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile_names to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_types_proc_mem __P((void));
 | 
			
		||||
extern SCM glibtop_guile_names_proc_mem __P((void));
 | 
			
		||||
extern SCM glibtop_guile_labels_proc_mem __P((void));
 | 
			
		||||
extern SCM glibtop_guile_descriptions_proc_mem __P((void));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_names to get this stuff here. */
 | 
			
		||||
 
 | 
			
		||||
@@ -27,15 +27,16 @@
 | 
			
		||||
 | 
			
		||||
__BEGIN_DECLS
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_PROC_SEGMENT_TRS		0
 | 
			
		||||
#define GLIBTOP_PROC_SEGMENT_LRS		1
 | 
			
		||||
#define GLIBTOP_PROC_SEGMENT_DRS		2
 | 
			
		||||
#define GLIBTOP_PROC_SEGMENT_DT			3
 | 
			
		||||
#define GLIBTOP_PROC_SEGMENT_START_CODE		4
 | 
			
		||||
#define GLIBTOP_PROC_SEGMENT_END_CODE		5
 | 
			
		||||
#define GLIBTOP_PROC_SEGMENT_START_STACK	6
 | 
			
		||||
#define GLIBTOP_PROC_SEGMENT_TEXT_RSS		0
 | 
			
		||||
#define GLIBTOP_PROC_SEGMENT_SHLIB_RSS		1
 | 
			
		||||
#define GLIBTOP_PROC_SEGMENT_DATA_RSS		2
 | 
			
		||||
#define GLIBTOP_PROC_SEGMENT_STACK_RSS		3
 | 
			
		||||
#define GLIBTOP_PROC_SEGMENT_DIRTY_SIZE		4
 | 
			
		||||
#define GLIBTOP_PROC_SEGMENT_START_CODE		5
 | 
			
		||||
#define GLIBTOP_PROC_SEGMENT_END_CODE		6
 | 
			
		||||
#define GLIBTOP_PROC_SEGMENT_START_STACK	7
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_MAX_PROC_SEGMENT		7
 | 
			
		||||
#define GLIBTOP_MAX_PROC_SEGMENT		8
 | 
			
		||||
 | 
			
		||||
typedef struct _glibtop_proc_segment	glibtop_proc_segment;
 | 
			
		||||
 | 
			
		||||
@@ -43,12 +44,13 @@ typedef struct _glibtop_proc_segment	glibtop_proc_segment;
 | 
			
		||||
 | 
			
		||||
struct _glibtop_proc_segment
 | 
			
		||||
{
 | 
			
		||||
	unsigned long flags;
 | 
			
		||||
	long trs,		/* text resident set size */
 | 
			
		||||
		lrs,		/* shared-lib resident set size */
 | 
			
		||||
		drs,		/* data resident set size */
 | 
			
		||||
		dt;		/* dirty pages */
 | 
			
		||||
	unsigned long start_code,
 | 
			
		||||
	u_int64_t	flags,
 | 
			
		||||
		text_rss,	/* text resident set size */
 | 
			
		||||
		shlib_rss,	/* shared-lib resident set size */
 | 
			
		||||
		data_rss,	/* data resident set size */
 | 
			
		||||
		stack_rss,	/* stack resident set size */
 | 
			
		||||
		dirty_size,	/* size of dirty pages */
 | 
			
		||||
		start_code,
 | 
			
		||||
				/* address of beginning of code segment */
 | 
			
		||||
		end_code,	/* address of end of code segment */
 | 
			
		||||
		start_stack;	/* address of the bottom of stack segment */
 | 
			
		||||
@@ -65,30 +67,13 @@ struct _glibtop_proc_segment
 | 
			
		||||
extern void glibtop_get_proc_segment_l __P((glibtop *, glibtop_proc_segment *, pid_t));
 | 
			
		||||
 | 
			
		||||
#if GLIBTOP_SUID_PROC_SEGMENT
 | 
			
		||||
extern void glibtop_init_proc_segment_p __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_proc_segment_p __P((glibtop *, glibtop_proc_segment *, pid_t));
 | 
			
		||||
#else
 | 
			
		||||
extern void glibtop_init_proc_segment_s __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_proc_segment_s __P((glibtop *, glibtop_proc_segment *, pid_t));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_GUILE
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_get_proc_segment __P((SCM));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_GUILE_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile_names to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_names_proc_segment __P((void));
 | 
			
		||||
extern SCM glibtop_guile_types_proc_segment __P((void));
 | 
			
		||||
extern SCM glibtop_guile_labels_proc_segment __P((void));
 | 
			
		||||
extern SCM glibtop_guile_descriptions_proc_segment __P((void));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_names to get this stuff here. */
 | 
			
		||||
 
 | 
			
		||||
@@ -40,11 +40,11 @@ typedef struct _glibtop_proc_signal	glibtop_proc_signal;
 | 
			
		||||
 | 
			
		||||
struct _glibtop_proc_signal
 | 
			
		||||
{
 | 
			
		||||
	unsigned long flags;
 | 
			
		||||
	int signal,		/* mask of pending signals */
 | 
			
		||||
		blocked,	/* mask of blocked signals */
 | 
			
		||||
		sigignore,	/* mask of ignored signals */
 | 
			
		||||
		sigcatch;	/* mask of caught  signals */
 | 
			
		||||
	u_int64_t	flags,
 | 
			
		||||
		signal [2],		/* mask of pending signals */
 | 
			
		||||
		blocked [2],		/* mask of blocked signals */
 | 
			
		||||
		sigignore [2],		/* mask of ignored signals */
 | 
			
		||||
		sigcatch [2];		/* mask of caught  signals */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define glibtop_get_proc_signal(p1, p2)	glibtop_get_proc_signal_l(glibtop_global_server, p1, p2)
 | 
			
		||||
@@ -58,30 +58,13 @@ struct _glibtop_proc_signal
 | 
			
		||||
extern void glibtop_get_proc_signal_l __P((glibtop *, glibtop_proc_signal *, pid_t));
 | 
			
		||||
 | 
			
		||||
#if GLIBTOP_SUID_PROC_SIGNAL
 | 
			
		||||
extern void glibtop_init_proc_signal_p __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_proc_signal_p __P((glibtop *, glibtop_proc_signal *, pid_t));
 | 
			
		||||
#else
 | 
			
		||||
extern void glibtop_init_proc_signal_s __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_proc_signal_s __P((glibtop *, glibtop_proc_signal *, pid_t));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_GUILE
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_get_proc_signal __P((SCM));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_GUILE_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile_names to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_names_proc_signal __P((void));
 | 
			
		||||
extern SCM glibtop_guile_types_proc_signal __P((void));
 | 
			
		||||
extern SCM glibtop_guile_labels_proc_signal __P((void));
 | 
			
		||||
extern SCM glibtop_guile_descriptions_proc_signal __P((void));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_names to get this stuff here. */
 | 
			
		||||
 
 | 
			
		||||
@@ -40,7 +40,7 @@ typedef struct _glibtop_proc_state	glibtop_proc_state;
 | 
			
		||||
 | 
			
		||||
struct _glibtop_proc_state
 | 
			
		||||
{
 | 
			
		||||
	unsigned long flags;
 | 
			
		||||
	u_int64_t flags;
 | 
			
		||||
	char cmd[40],		/* basename of executable file in 
 | 
			
		||||
				 * call to exec(2) */
 | 
			
		||||
		state;		/* single-char code for process state
 | 
			
		||||
@@ -65,30 +65,13 @@ struct _glibtop_proc_state
 | 
			
		||||
extern void glibtop_get_proc_state_l __P((glibtop *, glibtop_proc_state *, pid_t));
 | 
			
		||||
 | 
			
		||||
#if GLIBTOP_SUID_PROC_STATE
 | 
			
		||||
extern void glibtop_init_proc_state_p __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_proc_state_p __P((glibtop *, glibtop_proc_state *, pid_t));
 | 
			
		||||
#else
 | 
			
		||||
extern void glibtop_init_proc_state_s __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_proc_state_s __P((glibtop *, glibtop_proc_state *, pid_t));
 | 
			
		||||
#endif
 | 
			
		||||
     
 | 
			
		||||
#ifdef HAVE_GUILE
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_get_proc_state __P((SCM));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_GUILE_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile_names to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_names_proc_state __P((void));
 | 
			
		||||
extern SCM glibtop_guile_types_proc_state __P((void));
 | 
			
		||||
extern SCM glibtop_guile_labels_proc_state __P((void));
 | 
			
		||||
extern SCM glibtop_guile_descriptions_proc_state __P((void));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_names to get this stuff here. */
 | 
			
		||||
 
 | 
			
		||||
@@ -23,19 +23,24 @@
 | 
			
		||||
#define __GLIBTOP_PROCTIME_H__
 | 
			
		||||
 | 
			
		||||
#include <glibtop.h>
 | 
			
		||||
#include <glibtop/cpu.h>
 | 
			
		||||
#include <glibtop/global.h>
 | 
			
		||||
 | 
			
		||||
__BEGIN_DECLS
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_PROC_TIME_START_TIME	0
 | 
			
		||||
#define GLIBTOP_PROC_TIME_UTIME		1
 | 
			
		||||
#define GLIBTOP_PROC_TIME_STIME		2
 | 
			
		||||
#define GLIBTOP_PROC_TIME_CUTIME	3
 | 
			
		||||
#define GLIBTOP_PROC_TIME_CSTIME	4
 | 
			
		||||
#define GLIBTOP_PROC_TIME_TIMEOUT	5
 | 
			
		||||
#define GLIBTOP_PROC_TIME_IT_REAL_VALUE	6
 | 
			
		||||
#define GLIBTOP_PROC_TIME_RTIME		1
 | 
			
		||||
#define GLIBTOP_PROC_TIME_UTIME		2
 | 
			
		||||
#define GLIBTOP_PROC_TIME_STIME		3
 | 
			
		||||
#define GLIBTOP_PROC_TIME_CUTIME	4
 | 
			
		||||
#define GLIBTOP_PROC_TIME_CSTIME	5
 | 
			
		||||
#define GLIBTOP_PROC_TIME_TIMEOUT	6
 | 
			
		||||
#define GLIBTOP_PROC_TIME_IT_REAL_VALUE	7
 | 
			
		||||
#define GLIBTOP_PROC_TIME_FREQUENCY	8
 | 
			
		||||
#define GLIBTOP_PROC_TIME_XCPU_UTIME	9
 | 
			
		||||
#define GLIBTOP_PROC_TIME_XCPU_STIME	10
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_MAX_PROC_TIME		7
 | 
			
		||||
#define GLIBTOP_MAX_PROC_TIME		11
 | 
			
		||||
 | 
			
		||||
typedef struct _glibtop_proc_time	glibtop_proc_time;
 | 
			
		||||
 | 
			
		||||
@@ -43,9 +48,10 @@ typedef struct _glibtop_proc_time	glibtop_proc_time;
 | 
			
		||||
 | 
			
		||||
struct _glibtop_proc_time
 | 
			
		||||
{
 | 
			
		||||
	unsigned long flags;
 | 
			
		||||
	long start_time,	/* start time of process -- 
 | 
			
		||||
	u_int64_t	flags,
 | 
			
		||||
		start_time,	/* start time of process -- 
 | 
			
		||||
				 * seconds since 1-1-70 */
 | 
			
		||||
		rtime,		/* real time accumulated by process */
 | 
			
		||||
		utime,		/* user-mode CPU time accumulated by process */
 | 
			
		||||
		stime,		/* kernel-mode CPU time accumulated by process */
 | 
			
		||||
		cutime,		/* cumulative utime of process and 
 | 
			
		||||
@@ -54,9 +60,12 @@ struct _glibtop_proc_time
 | 
			
		||||
				 * reaped children */
 | 
			
		||||
		timeout,	/* The time (in jiffies) of the process's
 | 
			
		||||
				 * next timeout */
 | 
			
		||||
		it_real_value;	/* The time (in jiffies) before the
 | 
			
		||||
		it_real_value,	/* The time (in jiffies) before the
 | 
			
		||||
				 * next SIGALRM is sent to the process
 | 
			
		||||
				 * due to an interval timer. */
 | 
			
		||||
		frequency,	/* Tick frequency. */
 | 
			
		||||
		xcpu_utime [GLIBTOP_NCPU],	/* utime and stime for all CPUs on */
 | 
			
		||||
		xcpu_stime [GLIBTOP_NCPU];	/* SMP machines. */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define glibtop_get_proc_time(p1, p2)	glibtop_get_proc_time_l(glibtop_global_server, p1, p2)
 | 
			
		||||
@@ -70,30 +79,13 @@ struct _glibtop_proc_time
 | 
			
		||||
extern void glibtop_get_proc_time_l __P((glibtop *, glibtop_proc_time *, pid_t));
 | 
			
		||||
 | 
			
		||||
#if GLIBTOP_SUID_PROC_TIME
 | 
			
		||||
extern void glibtop_init_proc_time_p __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_proc_time_p __P((glibtop *, glibtop_proc_time *, pid_t));
 | 
			
		||||
#else
 | 
			
		||||
extern void glibtop_init_proc_time_s __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_proc_time_s __P((glibtop *, glibtop_proc_time *, pid_t));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_GUILE
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_get_proc_time __P((SCM));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_GUILE_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile_names to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_names_proc_time __P((void));
 | 
			
		||||
extern SCM glibtop_guile_types_proc_time __P((void));
 | 
			
		||||
extern SCM glibtop_guile_labels_proc_time __P((void));
 | 
			
		||||
extern SCM glibtop_guile_descriptions_proc_time __P((void));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_names to get this stuff here. */
 | 
			
		||||
 
 | 
			
		||||
@@ -48,7 +48,7 @@ typedef struct _glibtop_proc_uid	glibtop_proc_uid;
 | 
			
		||||
 | 
			
		||||
struct _glibtop_proc_uid
 | 
			
		||||
{
 | 
			
		||||
	unsigned long flags;
 | 
			
		||||
	u_int64_t flags;
 | 
			
		||||
	int uid,		/* user id */
 | 
			
		||||
		euid,		/* effective user id */
 | 
			
		||||
		gid,		/* group id */
 | 
			
		||||
@@ -74,30 +74,13 @@ struct _glibtop_proc_uid
 | 
			
		||||
extern void glibtop_get_proc_uid_l __P((glibtop *, glibtop_proc_uid *, pid_t));
 | 
			
		||||
 | 
			
		||||
#if GLIBTOP_SUID_PROC_UID
 | 
			
		||||
extern void glibtop_init_proc_uid_p __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_proc_uid_p __P((glibtop *, glibtop_proc_uid *, pid_t));
 | 
			
		||||
#else
 | 
			
		||||
extern void glibtop_init_proc_uid_s __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_proc_uid_s __P((glibtop *, glibtop_proc_uid *, pid_t));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_GUILE
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_get_proc_uid __P((SCM));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_GUILE_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile_names to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_names_proc_uid __P((void));
 | 
			
		||||
extern SCM glibtop_guile_types_proc_uid __P((void));
 | 
			
		||||
extern SCM glibtop_guile_labels_proc_uid __P((void));
 | 
			
		||||
extern SCM glibtop_guile_descriptions_proc_uid __P((void));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_names to get this stuff here. */
 | 
			
		||||
 
 | 
			
		||||
@@ -44,7 +44,7 @@ typedef struct _glibtop_sem_limits	glibtop_sem_limits;
 | 
			
		||||
 | 
			
		||||
struct _glibtop_sem_limits
 | 
			
		||||
{
 | 
			
		||||
	unsigned long	flags,
 | 
			
		||||
	u_int64_t	flags,
 | 
			
		||||
		semmap,		/* GLIBTOP_IPC_SEMMAP	*/
 | 
			
		||||
		semmni,		/* GLIBTOP_IPC_SEMMNI	*/
 | 
			
		||||
		semmns,		/* GLIBTOP_IPC_SEMMNS	*/
 | 
			
		||||
@@ -68,30 +68,13 @@ struct _glibtop_sem_limits
 | 
			
		||||
extern void glibtop_get_sem_limits_l __P((glibtop *, glibtop_sem_limits *));
 | 
			
		||||
 | 
			
		||||
#if GLIBTOP_SUID_SEM_LIMITS
 | 
			
		||||
extern void glibtop_init_sem_limits_p __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_sem_limits_p __P((glibtop *, glibtop_sem_limits *));
 | 
			
		||||
#else
 | 
			
		||||
extern void glibtop_init_sem_limits_s __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_sem_limits_s __P((glibtop *, glibtop_sem_limits *));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_GUILE
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_get_sem_limits __P((void));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_GUILE_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile_names to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_names_sem_limits __P((void));
 | 
			
		||||
extern SCM glibtop_guile_types_sem_limits __P((void));
 | 
			
		||||
extern SCM glibtop_guile_labels_sem_limits __P((void));
 | 
			
		||||
extern SCM glibtop_guile_descriptions_sem_limits __P((void));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_names to get this stuff here. */
 | 
			
		||||
 
 | 
			
		||||
@@ -39,7 +39,7 @@ typedef struct _glibtop_shm_limits	glibtop_shm_limits;
 | 
			
		||||
 | 
			
		||||
struct _glibtop_shm_limits
 | 
			
		||||
{
 | 
			
		||||
	unsigned long	flags,
 | 
			
		||||
	u_int64_t	flags,
 | 
			
		||||
		shmmax,		/* GLIBTOP_IPC_SHMMAX	*/
 | 
			
		||||
		shmmin,		/* GLIBTOP_IPC_SHMMIN	*/
 | 
			
		||||
		shmmni,		/* GLIBTOP_IPC_SHMMNI	*/
 | 
			
		||||
@@ -58,30 +58,13 @@ struct _glibtop_shm_limits
 | 
			
		||||
extern void glibtop_get_shm_limits_l __P((glibtop *, glibtop_shm_limits *));
 | 
			
		||||
 | 
			
		||||
#if GLIBTOP_SUID_SHM_LIMITS
 | 
			
		||||
extern void glibtop_init_shm_limits_p __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_shm_limits_p __P((glibtop *, glibtop_shm_limits *));
 | 
			
		||||
#else
 | 
			
		||||
extern void glibtop_init_shm_limits_s __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_shm_limits_s __P((glibtop *, glibtop_shm_limits *));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_GUILE
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_get_shm_limits __P((void));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_GUILE_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile_names to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_names_shm_limits __P((void));
 | 
			
		||||
extern SCM glibtop_guile_types_shm_limits __P((void));
 | 
			
		||||
extern SCM glibtop_guile_labels_shm_limits __P((void));
 | 
			
		||||
extern SCM glibtop_guile_descriptions_shm_limits __P((void));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_names to get this stuff here. */
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										45
									
								
								include/glibtop/signal.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								include/glibtop/signal.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,45 @@
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
 | 
			
		||||
   This file is part of the Gnome Top Library.
 | 
			
		||||
   Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is free software; you can redistribute it and/or
 | 
			
		||||
   modify it under the terms of the GNU Library General Public License as
 | 
			
		||||
   published by the Free Software Foundation; either version 2 of the
 | 
			
		||||
   License, or (at your option) any later version.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is distributed in the hope that it will be useful,
 | 
			
		||||
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
   Library General Public License for more details.
 | 
			
		||||
 | 
			
		||||
   You should have received a copy of the GNU Library General Public
 | 
			
		||||
   License along with the GNU C Library; see the file COPYING.LIB.  If not,
 | 
			
		||||
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 | 
			
		||||
   Boston, MA 02111-1307, USA.  */
 | 
			
		||||
 | 
			
		||||
#ifndef __GLIBTOP_SIGNAL_H__
 | 
			
		||||
#define __GLIBTOP_SIGNAL_H__
 | 
			
		||||
 | 
			
		||||
#include <glibtop.h>
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_SYS_SIGNAL_H
 | 
			
		||||
#include <sys/signal.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
__BEGIN_DECLS
 | 
			
		||||
 | 
			
		||||
typedef struct _glibtop_signame	glibtop_signame;
 | 
			
		||||
 | 
			
		||||
struct _glibtop_signame
 | 
			
		||||
{
 | 
			
		||||
	const int number;
 | 
			
		||||
	const char *name, *label;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
extern const glibtop_signame glibtop_sys_siglist [];
 | 
			
		||||
 | 
			
		||||
__END_DECLS
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
@@ -30,17 +30,21 @@ __BEGIN_DECLS
 | 
			
		||||
#define GLIBTOP_SWAP_TOTAL	0
 | 
			
		||||
#define GLIBTOP_SWAP_USED	1
 | 
			
		||||
#define GLIBTOP_SWAP_FREE	2
 | 
			
		||||
#define GLIBTOP_SWAP_PAGEIN	3
 | 
			
		||||
#define GLIBTOP_SWAP_PAGEOUT	4
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_MAX_SWAP	3
 | 
			
		||||
#define GLIBTOP_MAX_SWAP	5
 | 
			
		||||
 | 
			
		||||
typedef struct _glibtop_swap	glibtop_swap;
 | 
			
		||||
 | 
			
		||||
struct _glibtop_swap
 | 
			
		||||
{
 | 
			
		||||
	unsigned long	flags,
 | 
			
		||||
	u_int64_t	flags,
 | 
			
		||||
		total,		/* GLIBTOP_SWAP_TOTAL	*/
 | 
			
		||||
		used,		/* GLIBTOP_SWAP_USED	*/
 | 
			
		||||
		free;		/* GLIBTOP_SWAP_FREE	*/
 | 
			
		||||
		free,		/* GLIBTOP_SWAP_FREE	*/
 | 
			
		||||
		pagein,		/* GLIBTOP_SWAP_PAGEIN	*/
 | 
			
		||||
		pageout;	/* GLIBTOP_SWAP_PAGEOUT	*/
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define glibtop_get_swap(swap)	glibtop_get_swap_l(glibtop_global_server, swap)
 | 
			
		||||
@@ -54,30 +58,13 @@ struct _glibtop_swap
 | 
			
		||||
extern void glibtop_get_swap_l __P((glibtop *, glibtop_swap *));
 | 
			
		||||
 | 
			
		||||
#if GLIBTOP_SUID_SWAP
 | 
			
		||||
extern void glibtop_init_swap_p __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_swap_p __P((glibtop *, glibtop_swap *));
 | 
			
		||||
#else
 | 
			
		||||
extern void glibtop_init_swap_s __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_swap_s __P((glibtop *, glibtop_swap *));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_GUILE
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_get_swap __P((void));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_GUILE_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile_names to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_names_swap __P((void));
 | 
			
		||||
extern SCM glibtop_guile_types_swap __P((void));
 | 
			
		||||
extern SCM glibtop_guile_labels_swap __P((void));
 | 
			
		||||
extern SCM glibtop_guile_descriptions_swap __P((void));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_names to get this stuff here. */
 | 
			
		||||
 
 | 
			
		||||
@@ -23,7 +23,6 @@
 | 
			
		||||
#define __GLIBTOP_SYSDEPS_H__
 | 
			
		||||
 | 
			
		||||
#include <glibtop.h>
 | 
			
		||||
#include <glibtop/union.h>
 | 
			
		||||
 | 
			
		||||
__BEGIN_DECLS
 | 
			
		||||
 | 
			
		||||
@@ -44,16 +43,26 @@ __BEGIN_DECLS
 | 
			
		||||
#define GLIBTOP_SYSDEPS_PROC_SIGNAL	14
 | 
			
		||||
#define GLIBTOP_SYSDEPS_PROC_KERNEL	15
 | 
			
		||||
#define GLIBTOP_SYSDEPS_PROC_SEGMENT	16
 | 
			
		||||
#define GLIBTOP_SYSDEPS_PROC_ARGS	17
 | 
			
		||||
#define GLIBTOP_SYSDEPS_PROC_MAP	18
 | 
			
		||||
#define GLIBTOP_SYSDEPS_MOUNTLIST	19
 | 
			
		||||
#define GLIBTOP_SYSDEPS_FSUSAGE		20
 | 
			
		||||
#define GLIBTOP_SYSDEPS_NETLOAD		21
 | 
			
		||||
#define GLIBTOP_SYSDEPS_PPP		22
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_MAX_SYSDEPS		17
 | 
			
		||||
#define GLIBTOP_MAX_SYSDEPS		23
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_SYSDEPS_ALL		((1 << GLIBTOP_MAX_SYSDEPS) - 1)
 | 
			
		||||
 | 
			
		||||
typedef void (*glibtop_init_func_t) (glibtop *);
 | 
			
		||||
extern glibtop_init_func_t _glibtop_init_hook_s [];
 | 
			
		||||
extern glibtop_init_func_t _glibtop_init_hook_p [];
 | 
			
		||||
 | 
			
		||||
typedef struct _glibtop_sysdeps	glibtop_sysdeps;
 | 
			
		||||
 | 
			
		||||
struct _glibtop_sysdeps
 | 
			
		||||
{
 | 
			
		||||
	unsigned long	flags,
 | 
			
		||||
	u_int64_t flags,
 | 
			
		||||
		features,		/* server features	*/
 | 
			
		||||
		cpu,			/* glibtop_cpu		*/
 | 
			
		||||
		mem,			/* glibtop_mem		*/
 | 
			
		||||
@@ -70,32 +79,19 @@ struct _glibtop_sysdeps
 | 
			
		||||
		proc_time,		/* glibtop_proc_time	*/
 | 
			
		||||
		proc_signal,		/* glibtop_proc_signal	*/
 | 
			
		||||
		proc_kernel,		/* glibtop_proc_kernel	*/
 | 
			
		||||
		proc_segment;		/* glibtop_proc_segment	*/
 | 
			
		||||
		proc_segment,		/* glibtop_proc_segment	*/
 | 
			
		||||
		proc_args,		/* glibtop_proc_args	*/
 | 
			
		||||
		proc_map,		/* glibtop_proc_map	*/
 | 
			
		||||
		mountlist,		/* glibtop_mountlist	*/
 | 
			
		||||
		fsusage,		/* glibtop_fsusage	*/
 | 
			
		||||
		netload,		/* glibtop_netload	*/
 | 
			
		||||
		ppp;			/* glibtop_ppp		*/
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define glibtop_get_sysdeps(sysdeps)	glibtop_get_sysdeps_r(glibtop_global_server,sysdeps)
 | 
			
		||||
 | 
			
		||||
extern void glibtop_get_sysdeps_r __P((glibtop *, glibtop_sysdeps *));
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_GUILE
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_get_sysdeps __P((void));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_GUILE_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile_names to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_names_sysdeps __P((void));
 | 
			
		||||
extern SCM glibtop_guile_types_sysdeps __P((void));
 | 
			
		||||
extern SCM glibtop_guile_labels_sysdeps __P((void));
 | 
			
		||||
extern SCM glibtop_guile_descriptions_sysdeps __P((void));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_names to get this stuff here. */
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										62
									
								
								include/glibtop/sysinfo.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								include/glibtop/sysinfo.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,62 @@
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
 | 
			
		||||
   This file is part of the Gnome Top Library.
 | 
			
		||||
   Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is free software; you can redistribute it and/or
 | 
			
		||||
   modify it under the terms of the GNU Library General Public License as
 | 
			
		||||
   published by the Free Software Foundation; either version 2 of the
 | 
			
		||||
   License, or (at your option) any later version.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is distributed in the hope that it will be useful,
 | 
			
		||||
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
   Library General Public License for more details.
 | 
			
		||||
 | 
			
		||||
   You should have received a copy of the GNU Library General Public
 | 
			
		||||
   License along with the GNU C Library; see the file COPYING.LIB.  If not,
 | 
			
		||||
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 | 
			
		||||
   Boston, MA 02111-1307, USA.  */
 | 
			
		||||
 | 
			
		||||
#ifndef __GLIBTOP_SYSINFO_H__
 | 
			
		||||
#define __GLIBTOP_SYSINFO_H__
 | 
			
		||||
 | 
			
		||||
#include <glibtop.h>
 | 
			
		||||
#include <glibtop/cpu.h>
 | 
			
		||||
#include <glibtop/global.h>
 | 
			
		||||
 | 
			
		||||
#include <glib.h>
 | 
			
		||||
 | 
			
		||||
__BEGIN_DECLS
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_SYSINFO_CPUINFO		0
 | 
			
		||||
 | 
			
		||||
#define GLIBTOP_MAX_SYSINFO		1
 | 
			
		||||
 | 
			
		||||
typedef struct _glibtop_sysinfo	glibtop_sysinfo;
 | 
			
		||||
 | 
			
		||||
typedef struct _glibtop_entry	glibtop_entry;
 | 
			
		||||
 | 
			
		||||
struct _glibtop_entry
 | 
			
		||||
{
 | 
			
		||||
	GPtrArray	*labels;
 | 
			
		||||
	GHashTable	*values;
 | 
			
		||||
	GHashTable	*descriptions;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct _glibtop_sysinfo
 | 
			
		||||
{
 | 
			
		||||
	u_int64_t	flags, ncpu;
 | 
			
		||||
	glibtop_entry	cpuinfo [GLIBTOP_NCPU];
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define glibtop_get_sysinfo()	glibtop_get_sysinfo_s(glibtop_global_server)
 | 
			
		||||
 | 
			
		||||
#define glibtop_get_sysinfo_r	glibtop_get_sysinfo_s
 | 
			
		||||
 | 
			
		||||
extern glibtop_sysinfo * glibtop_get_sysinfo_s __P((glibtop *));
 | 
			
		||||
 | 
			
		||||
__END_DECLS
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
@@ -39,6 +39,14 @@
 | 
			
		||||
#include <glibtop/procsignal.h>
 | 
			
		||||
#include <glibtop/prockernel.h>
 | 
			
		||||
#include <glibtop/procsegment.h>
 | 
			
		||||
#include <glibtop/procargs.h>
 | 
			
		||||
#include <glibtop/procmap.h>
 | 
			
		||||
 | 
			
		||||
#include <glibtop/mountlist.h>
 | 
			
		||||
#include <glibtop/fsusage.h>
 | 
			
		||||
 | 
			
		||||
#include <glibtop/netload.h>
 | 
			
		||||
#include <glibtop/ppp.h>
 | 
			
		||||
 | 
			
		||||
__BEGIN_DECLS
 | 
			
		||||
 | 
			
		||||
@@ -62,6 +70,12 @@ union _glibtop_union
 | 
			
		||||
	glibtop_proc_signal	proc_signal;
 | 
			
		||||
	glibtop_proc_kernel	proc_kernel;
 | 
			
		||||
	glibtop_proc_segment	proc_segment;
 | 
			
		||||
	glibtop_proc_args	proc_args;
 | 
			
		||||
	glibtop_proc_map	proc_map;
 | 
			
		||||
	glibtop_mountlist	mountlist;
 | 
			
		||||
	glibtop_fsusage		fsusage;
 | 
			
		||||
	glibtop_netload		netload;
 | 
			
		||||
	glibtop_ppp		ppp;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
__END_DECLS
 | 
			
		||||
 
 | 
			
		||||
@@ -36,7 +36,7 @@ typedef struct _glibtop_uptime	glibtop_uptime;
 | 
			
		||||
 | 
			
		||||
struct _glibtop_uptime
 | 
			
		||||
{
 | 
			
		||||
	unsigned long	flags;
 | 
			
		||||
	u_int64_t flags;
 | 
			
		||||
	double uptime,		/* GLIBTOP_UPTIME_UPTIME	*/
 | 
			
		||||
		idletime;	/* GLIBTOP_UPTIME_IDLETIME	*/
 | 
			
		||||
};
 | 
			
		||||
@@ -52,30 +52,13 @@ struct _glibtop_uptime
 | 
			
		||||
extern void glibtop_get_uptime_l __P((glibtop *, glibtop_uptime *));
 | 
			
		||||
 | 
			
		||||
#if GLIBTOP_SUID_UPTIME
 | 
			
		||||
extern void glibtop_init_uptime_p __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_uptime_p __P((glibtop *, glibtop_uptime *));
 | 
			
		||||
#else
 | 
			
		||||
extern void glibtop_init_uptime_s __P((glibtop *));
 | 
			
		||||
extern void glibtop_get_uptime_s __P((glibtop *, glibtop_uptime *));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef HAVE_GUILE
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_get_uptime __P((void));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_GUILE_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_guile_names to get this stuff here. */
 | 
			
		||||
 | 
			
		||||
extern SCM glibtop_guile_names_uptime __P((void));
 | 
			
		||||
extern SCM glibtop_guile_types_uptime __P((void));
 | 
			
		||||
extern SCM glibtop_guile_labels_uptime __P((void));
 | 
			
		||||
extern SCM glibtop_guile_descriptions_uptime __P((void));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLIBTOP_NAMES
 | 
			
		||||
 | 
			
		||||
/* You need to link with -lgtop_names to get this stuff here. */
 | 
			
		||||
 
 | 
			
		||||
@@ -20,11 +20,20 @@
 | 
			
		||||
#ifndef __GLIBTOP_VERSION_H__
 | 
			
		||||
#define __GLIBTOP_VERSION_H__
 | 
			
		||||
 | 
			
		||||
#include <glibtop/output.h>
 | 
			
		||||
#include <glibtop.h>
 | 
			
		||||
#include <glibtop/union.h>
 | 
			
		||||
#include <glibtop/sysdeps.h>
 | 
			
		||||
#include <glibtop/command.h>
 | 
			
		||||
 | 
			
		||||
#define LIBGTOP_VERSION_STRING "Libgtop %s server version %s (%u,%u,%u,%u)."
 | 
			
		||||
 | 
			
		||||
__BEGIN_DECLS
 | 
			
		||||
 | 
			
		||||
extern void glibtop_version __P((void));
 | 
			
		||||
#if _IN_LIBGTOP
 | 
			
		||||
 | 
			
		||||
extern void glibtop_send_version __P((glibtop *, int));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
__END_DECLS
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -30,14 +30,14 @@ __BEGIN_DECLS
 | 
			
		||||
#define glibtop_malloc(p1)	glibtop_malloc_r(glibtop_global_server, p1)
 | 
			
		||||
#define glibtop_calloc(p1, p2)	glibtop_calloc_r(glibtop_global_server, p1, p2)
 | 
			
		||||
#define glibtop_realloc(p1, p2)	glibtop_realloc_r(glibtop_global_server, p1, p2)
 | 
			
		||||
#define glibtop_strdup(p2)	glibtop_strdup_r(glibtop_global_server, p1)
 | 
			
		||||
#define glibtop_strdup(p1)	glibtop_strdup_r(glibtop_global_server, p1)
 | 
			
		||||
#define glibtop_free(p1)	glibtop_free_r(glibtop_global_server, p1)
 | 
			
		||||
 | 
			
		||||
extern void *glibtop_malloc_r	__P((glibtop *, size_t));
 | 
			
		||||
extern void *glibtop_calloc_r	__P((glibtop *, size_t, size_t));
 | 
			
		||||
extern void *glibtop_realloc_r	__P((glibtop *, void *, size_t));
 | 
			
		||||
extern char *glibtop_strdup_r	__P((glibtop *, const char *));
 | 
			
		||||
extern void glibtop_free_r	__P((glibtop *, void *));
 | 
			
		||||
extern void glibtop_free_r	__P((glibtop *, const void *));
 | 
			
		||||
 | 
			
		||||
__END_DECLS
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +1,11 @@
 | 
			
		||||
1998-07-21  Martin Baulig  <martin@home-of-linux.org>
 | 
			
		||||
 | 
			
		||||
	* table20: New directory for 2.0.xx kernels.
 | 
			
		||||
 | 
			
		||||
	* table21: New directory for 2.1.xx kernels.
 | 
			
		||||
 | 
			
		||||
	* *: Moved into `table20' and `table21'.
 | 
			
		||||
 | 
			
		||||
1998-06-14  Martin Baulig  <baulig@taurus.uni-trier.de>
 | 
			
		||||
 | 
			
		||||
	* README: Added README.
 | 
			
		||||
 
 | 
			
		||||
@@ -3,21 +3,38 @@
 | 
			
		||||
 | 
			
		||||
#ifdef _KERNEL
 | 
			
		||||
#include <linux/types.h>
 | 
			
		||||
#else
 | 
			
		||||
#define NR_TASKS		512
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define TABLE_KERN_PROC_ALL		0	/* all processes */
 | 
			
		||||
#define TABLE_KERN_PROC_PID		1
 | 
			
		||||
#define TABLE_KERN_PROC_PGRP		2
 | 
			
		||||
#define TABLE_KERN_PROC_SESSION		3
 | 
			
		||||
#define TABLE_KERN_PROC_TTY		4
 | 
			
		||||
#define TABLE_KERN_PROC_UID		5
 | 
			
		||||
#define TABLE_KERN_PROC_RUID		6
 | 
			
		||||
 | 
			
		||||
#define TABLE_KERN_PROC_MASK		15	
 | 
			
		||||
 | 
			
		||||
#define TABLE_EXCLUDE_IDLE		0x1000
 | 
			
		||||
#define TABLE_EXCLUDE_SYSTEM		0x2000
 | 
			
		||||
#define TABLE_EXCLUDE_NOTTY		0x4000
 | 
			
		||||
 | 
			
		||||
#define TABLE_VERSION		0
 | 
			
		||||
#define TABLE_CPU		1
 | 
			
		||||
#define TABLE_MEM		2
 | 
			
		||||
#define TABLE_SWAP		3
 | 
			
		||||
#define TABLE_LOADAVG		4
 | 
			
		||||
#define TABLE_UPTIME		5
 | 
			
		||||
#define TABLE_PROC_UID		6
 | 
			
		||||
#define TABLE_PROC_MEM		7
 | 
			
		||||
#define TABLE_PROC_SEGMENT	8
 | 
			
		||||
#define TABLE_PROC_TIME		9
 | 
			
		||||
#define TABLE_PROC_STATE	10
 | 
			
		||||
#define TABLE_PROC_SIGNAL	11
 | 
			
		||||
#define TABLE_PROC_KERNEL	12
 | 
			
		||||
#define TABLE_PROCLIST		6
 | 
			
		||||
#define TABLE_PROC_UID		7
 | 
			
		||||
#define TABLE_PROC_MEM		8
 | 
			
		||||
#define TABLE_PROC_SEGMENT	9
 | 
			
		||||
#define TABLE_PROC_TIME		10
 | 
			
		||||
#define TABLE_PROC_STATE	11
 | 
			
		||||
#define TABLE_PROC_SIGNAL	12
 | 
			
		||||
#define TABLE_PROC_KERNEL	13
 | 
			
		||||
 | 
			
		||||
/* CPU Usage (in jiffies = 1/100th seconds) */
 | 
			
		||||
 | 
			
		||||
@@ -50,6 +67,8 @@ struct table_swap
 | 
			
		||||
	unsigned long total;		/* Total swap space		*/
 | 
			
		||||
	unsigned long used;		/* Used swap space		*/
 | 
			
		||||
	unsigned long free;		/* Free swap space		*/
 | 
			
		||||
	unsigned long pagein;		/* Total # of pages swapped in	*/
 | 
			
		||||
	unsigned long pageout;		/* Total # of pages swapped out	*/
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* Load average */
 | 
			
		||||
@@ -70,6 +89,19 @@ struct table_uptime
 | 
			
		||||
	unsigned long idle;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* Process list. */
 | 
			
		||||
 | 
			
		||||
struct proclist_args
 | 
			
		||||
{
 | 
			
		||||
	int which, arg;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct table_proclist
 | 
			
		||||
{
 | 
			
		||||
	int nr_running, nr_tasks, last_pid;
 | 
			
		||||
	unsigned pids [NR_TASKS];
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* Information about processes. */
 | 
			
		||||
 | 
			
		||||
struct table_proc_state
 | 
			
		||||
@@ -77,6 +109,7 @@ struct table_proc_state
 | 
			
		||||
	long state;
 | 
			
		||||
	unsigned long flags;
 | 
			
		||||
	char comm[16];
 | 
			
		||||
	int uid, gid;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct table_proc_uid
 | 
			
		||||
@@ -104,8 +137,8 @@ struct table_proc_mem
 | 
			
		||||
struct table_proc_segment
 | 
			
		||||
{
 | 
			
		||||
	unsigned long vsize;
 | 
			
		||||
	int size, resident, shared;
 | 
			
		||||
	int trs, lrs, drs, dt;
 | 
			
		||||
	unsigned long size, resident, shared;
 | 
			
		||||
	unsigned long trs, lrs, drs, srs, dt;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct table_proc_time
 | 
			
		||||
@@ -118,10 +151,10 @@ struct table_proc_time
 | 
			
		||||
 | 
			
		||||
struct table_proc_signal
 | 
			
		||||
{
 | 
			
		||||
	unsigned long signal;
 | 
			
		||||
	unsigned long blocked;	/* bitmap of masked signals */
 | 
			
		||||
	unsigned long ignored;  /* mask of ignored signals */
 | 
			
		||||
	unsigned long caught;   /* mask of caught signals */
 | 
			
		||||
	unsigned long long signal,
 | 
			
		||||
		blocked,	/* bitmap of masked signals */
 | 
			
		||||
		ignored,	/* mask of ignored signals */
 | 
			
		||||
		caught;		/* mask of caught signals */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct table_proc_kernel
 | 
			
		||||
@@ -140,6 +173,7 @@ union table
 | 
			
		||||
	struct table_swap swap;
 | 
			
		||||
	struct table_loadavg loadavg;
 | 
			
		||||
	struct table_uptime uptime;
 | 
			
		||||
	struct table_proclist proclist;
 | 
			
		||||
	struct table_proc_uid proc_uid;
 | 
			
		||||
	struct table_proc_mem proc_mem;
 | 
			
		||||
	struct table_proc_segment proc_segment;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										706
									
								
								kernel/table20/entry-i386.S
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										706
									
								
								kernel/table20/entry-i386.S
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,706 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  linux/arch/i386/entry.S
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (C) 1991, 1992  Linus Torvalds
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * entry.S contains the system-call and fault low-level handling routines.
 | 
			
		||||
 * This also contains the timer-interrupt handler, as well as all interrupts
 | 
			
		||||
 * and faults that can result in a task-switch.
 | 
			
		||||
 *
 | 
			
		||||
 * NOTE: This code handles signal-recognition, which happens every time
 | 
			
		||||
 * after a timer-interrupt and after each system call.
 | 
			
		||||
 *
 | 
			
		||||
 * I changed all the .align's to 4 (16 byte alignment), as that's faster
 | 
			
		||||
 * on a 486.
 | 
			
		||||
 *
 | 
			
		||||
 * Stack layout in 'ret_from_system_call':
 | 
			
		||||
 * 	ptrace needs to have all regs on the stack.
 | 
			
		||||
 *	if the order here is changed, it needs to be 
 | 
			
		||||
 *	updated in fork.c:copy_process, signal.c:do_signal,
 | 
			
		||||
 *	ptrace.c and ptrace.h
 | 
			
		||||
 *
 | 
			
		||||
 *	 0(%esp) - %ebx
 | 
			
		||||
 *	 4(%esp) - %ecx
 | 
			
		||||
 *	 8(%esp) - %edx
 | 
			
		||||
 *       C(%esp) - %esi
 | 
			
		||||
 *	10(%esp) - %edi
 | 
			
		||||
 *	14(%esp) - %ebp
 | 
			
		||||
 *	18(%esp) - %eax
 | 
			
		||||
 *	1C(%esp) - %ds
 | 
			
		||||
 *	20(%esp) - %es
 | 
			
		||||
 *      24(%esp) - %fs
 | 
			
		||||
 *	28(%esp) - %gs
 | 
			
		||||
 *	2C(%esp) - orig_eax
 | 
			
		||||
 *	30(%esp) - %eip
 | 
			
		||||
 *	34(%esp) - %cs
 | 
			
		||||
 *	38(%esp) - %eflags
 | 
			
		||||
 *	3C(%esp) - %oldesp
 | 
			
		||||
 *	40(%esp) - %oldss
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <linux/sys.h>
 | 
			
		||||
#include <linux/linkage.h>
 | 
			
		||||
#include <asm/segment.h>
 | 
			
		||||
#define ASSEMBLY
 | 
			
		||||
#include <asm/smp.h>
 | 
			
		||||
 | 
			
		||||
EBX		= 0x00
 | 
			
		||||
ECX		= 0x04
 | 
			
		||||
EDX		= 0x08
 | 
			
		||||
ESI		= 0x0C
 | 
			
		||||
EDI		= 0x10
 | 
			
		||||
EBP		= 0x14
 | 
			
		||||
EAX		= 0x18
 | 
			
		||||
DS		= 0x1C
 | 
			
		||||
ES		= 0x20
 | 
			
		||||
FS		= 0x24
 | 
			
		||||
GS		= 0x28
 | 
			
		||||
ORIG_EAX	= 0x2C
 | 
			
		||||
EIP		= 0x30
 | 
			
		||||
CS		= 0x34
 | 
			
		||||
EFLAGS		= 0x38
 | 
			
		||||
OLDESP		= 0x3C
 | 
			
		||||
OLDSS		= 0x40
 | 
			
		||||
 | 
			
		||||
CF_MASK		= 0x00000001
 | 
			
		||||
IF_MASK		= 0x00000200
 | 
			
		||||
NT_MASK		= 0x00004000
 | 
			
		||||
VM_MASK		= 0x00020000
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * these are offsets into the task-struct.
 | 
			
		||||
 */
 | 
			
		||||
state		=  0
 | 
			
		||||
counter		=  4
 | 
			
		||||
priority	=  8
 | 
			
		||||
signal		= 12
 | 
			
		||||
blocked		= 16
 | 
			
		||||
flags		= 20
 | 
			
		||||
dbgreg6		= 52
 | 
			
		||||
dbgreg7		= 56
 | 
			
		||||
exec_domain	= 60
 | 
			
		||||
 | 
			
		||||
ENOSYS = 38
 | 
			
		||||
 | 
			
		||||
#define SAVE_ALL \
 | 
			
		||||
	cld; \
 | 
			
		||||
	push %gs; \
 | 
			
		||||
	push %fs; \
 | 
			
		||||
	push %es; \
 | 
			
		||||
	push %ds; \
 | 
			
		||||
	pushl %eax; \
 | 
			
		||||
	pushl %ebp; \
 | 
			
		||||
	pushl %edi; \
 | 
			
		||||
	pushl %esi; \
 | 
			
		||||
	pushl %edx; \
 | 
			
		||||
	pushl %ecx; \
 | 
			
		||||
	pushl %ebx; \
 | 
			
		||||
	movl $(KERNEL_DS),%edx; \
 | 
			
		||||
	mov %dx,%ds; \
 | 
			
		||||
	mov %dx,%es; \
 | 
			
		||||
	movl $(USER_DS),%edx; \
 | 
			
		||||
	mov %dx,%fs;
 | 
			
		||||
 | 
			
		||||
#ifdef	__SMP__
 | 
			
		||||
 | 
			
		||||
#define GET_PROCESSOR_ID \
 | 
			
		||||
	movl SYMBOL_NAME(apic_reg), %edx; \
 | 
			
		||||
	movl 32(%edx), %eax;\
 | 
			
		||||
	movl %eax,SYMBOL_NAME(apic_retval); \
 | 
			
		||||
	shrl $24,%eax; \
 | 
			
		||||
	andb $0x0F,%al;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *	Get the processor ID multiplied by 4
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define GET_PROCESSOR_OFFSET(x) \
 | 
			
		||||
	movl SYMBOL_NAME(apic_reg), x ; \
 | 
			
		||||
	movl 32( x ), x ; \
 | 
			
		||||
	shrl $22, x ; \
 | 
			
		||||
	andl $0x3C, x ;
 | 
			
		||||
 | 
			
		||||
/* macro LEAVE_KERNEL decrements kernel_counter and resets kernel_flag and
 | 
			
		||||
   saves processor variables if zero */
 | 
			
		||||
#define	LEAVE_KERNEL \
 | 
			
		||||
	pushfl; \
 | 
			
		||||
	cli; \
 | 
			
		||||
	GET_PROCESSOR_ID \
 | 
			
		||||
	btrl $ SMP_FROM_SYSCALL,SYMBOL_NAME(smp_proc_in_lock)(,%eax,4); \
 | 
			
		||||
	decl SYMBOL_NAME(syscall_count); \
 | 
			
		||||
	decl SYMBOL_NAME(kernel_counter); \
 | 
			
		||||
	jnz 1f;	\
 | 
			
		||||
	movb SYMBOL_NAME(saved_active_kernel_processor), %al; \
 | 
			
		||||
	movb %al, SYMBOL_NAME(active_kernel_processor); \
 | 
			
		||||
	cmpb $(NO_PROC_ID), %al; \
 | 
			
		||||
	jnz 1f; \
 | 
			
		||||
	lock; \
 | 
			
		||||
	btrl $0, SYMBOL_NAME(kernel_flag); \
 | 
			
		||||
1:	popfl;
 | 
			
		||||
 | 
			
		||||
/* macro ENTER_KERNEL waits for entering the kernel, increments
 | 
			
		||||
   kernel_counter, and reloads the processor variables if necessary
 | 
			
		||||
   uses : %eax, %edx (pushed and popped) 
 | 
			
		||||
 | 
			
		||||
   Note: We go to great pains to minimise the number of locked operations.
 | 
			
		||||
   We want to spin without locking, and lock when we attempt an update.
 | 
			
		||||
   The pentium has a MESI cache so the spin without lock will exit when
 | 
			
		||||
   another CPU write invalidates our cache, and the lock is avoided when
 | 
			
		||||
   possible so we don't play ping-pong games with the cache line.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#ifndef __SMP_PROF__
 | 
			
		||||
 | 
			
		||||
#define SMP_PROF_A
 | 
			
		||||
#define SMP_PROF_B 
 | 
			
		||||
 | 
			
		||||
#else
 | 
			
		||||
 | 
			
		||||
#define SMP_PROF_A movl $0,SYMBOL_NAME(smp_spins_syscall_cur)(,%eax,4);
 | 
			
		||||
#define SMP_PROF_B incl SYMBOL_NAME(smp_spins_syscall)(,%eax,4); \
 | 
			
		||||
        incl SYMBOL_NAME(smp_spins_syscall_cur)(,%eax,4);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define	ENTER_KERNEL \
 | 
			
		||||
	pushl %eax; \
 | 
			
		||||
	pushl %ebx; \
 | 
			
		||||
	pushl %ecx; \
 | 
			
		||||
	pushl %edx; \
 | 
			
		||||
	pushfl; \
 | 
			
		||||
	cli; \
 | 
			
		||||
	movl $6000, %ebx; \
 | 
			
		||||
	movl SYMBOL_NAME(smp_loops_per_tick), %ecx; \
 | 
			
		||||
	GET_PROCESSOR_ID \
 | 
			
		||||
	btsl $ SMP_FROM_SYSCALL,SYMBOL_NAME(smp_proc_in_lock)(,%eax,4); \
 | 
			
		||||
	SMP_PROF_A \
 | 
			
		||||
1:	lock; \
 | 
			
		||||
	btsl $0, SYMBOL_NAME(kernel_flag); \
 | 
			
		||||
	jnc 3f; \
 | 
			
		||||
	cmpb SYMBOL_NAME(active_kernel_processor), %al; \
 | 
			
		||||
	je 4f; \
 | 
			
		||||
2:	SMP_PROF_B \
 | 
			
		||||
	btl %eax, SYMBOL_NAME(smp_invalidate_needed); \
 | 
			
		||||
	jnc 5f; \
 | 
			
		||||
	lock; \
 | 
			
		||||
	btrl %eax, SYMBOL_NAME(smp_invalidate_needed); \
 | 
			
		||||
	jnc 5f; \
 | 
			
		||||
	movl %cr3,%edx; \
 | 
			
		||||
	movl %edx,%cr3; \
 | 
			
		||||
5:	sti; \
 | 
			
		||||
	decl %ecx; \
 | 
			
		||||
	cli; \
 | 
			
		||||
	jne 7f; \
 | 
			
		||||
	decl %ebx; \
 | 
			
		||||
	jne 6f; \
 | 
			
		||||
	call SYMBOL_NAME(non_irq_deadlock_detected); \
 | 
			
		||||
6:	movl SYMBOL_NAME(smp_loops_per_tick), %ecx; \
 | 
			
		||||
	cmpb SYMBOL_NAME(boot_cpu_id), %al; \
 | 
			
		||||
	jne 7f; \
 | 
			
		||||
	incl SYMBOL_NAME(jiffies);  \
 | 
			
		||||
7:	btl $0, SYMBOL_NAME(kernel_flag); \
 | 
			
		||||
	jc 2b; \
 | 
			
		||||
	jmp 1b; \
 | 
			
		||||
3:	movb %al, SYMBOL_NAME(active_kernel_processor); \
 | 
			
		||||
4:	incl SYMBOL_NAME(kernel_counter); \
 | 
			
		||||
	incl SYMBOL_NAME(syscall_count); \
 | 
			
		||||
	popfl; \
 | 
			
		||||
	popl %edx; \
 | 
			
		||||
	popl %ecx; \
 | 
			
		||||
	popl %ebx; \
 | 
			
		||||
	popl %eax;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define RESTORE_ALL \
 | 
			
		||||
	cmpw $(KERNEL_CS),CS(%esp); \
 | 
			
		||||
	je 1f;   \
 | 
			
		||||
	GET_PROCESSOR_OFFSET(%edx) \
 | 
			
		||||
	movl SYMBOL_NAME(current_set)(,%edx), %eax ; ; \
 | 
			
		||||
	movl dbgreg7(%eax),%ebx; \
 | 
			
		||||
	movl %ebx,%db7;	\
 | 
			
		||||
1:	LEAVE_KERNEL \
 | 
			
		||||
	popl %ebx; \
 | 
			
		||||
	popl %ecx; \
 | 
			
		||||
	popl %edx; \
 | 
			
		||||
	popl %esi; \
 | 
			
		||||
	popl %edi; \
 | 
			
		||||
	popl %ebp; \
 | 
			
		||||
	popl %eax; \
 | 
			
		||||
	pop %ds; \
 | 
			
		||||
	pop %es; \
 | 
			
		||||
	pop %fs; \
 | 
			
		||||
	pop %gs; \
 | 
			
		||||
	addl $4,%esp; \
 | 
			
		||||
	iret
 | 
			
		||||
 | 
			
		||||
#else
 | 
			
		||||
 | 
			
		||||
#define RESTORE_ALL \
 | 
			
		||||
	cmpw $(KERNEL_CS),CS(%esp); \
 | 
			
		||||
	je 1f;   \
 | 
			
		||||
	movl SYMBOL_NAME(current_set),%eax; \
 | 
			
		||||
	movl dbgreg7(%eax),%ebx; \
 | 
			
		||||
	movl %ebx,%db7;	\
 | 
			
		||||
1:	\
 | 
			
		||||
	popl %ebx; \
 | 
			
		||||
	popl %ecx; \
 | 
			
		||||
	popl %edx; \
 | 
			
		||||
	popl %esi; \
 | 
			
		||||
	popl %edi; \
 | 
			
		||||
	popl %ebp; \
 | 
			
		||||
	popl %eax; \
 | 
			
		||||
	pop %ds; \
 | 
			
		||||
	pop %es; \
 | 
			
		||||
	pop %fs; \
 | 
			
		||||
	pop %gs; \
 | 
			
		||||
	addl $4,%esp; \
 | 
			
		||||
	iret
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
ENTRY(lcall7)
 | 
			
		||||
	pushfl			# We get a different stack layout with call gates,
 | 
			
		||||
	pushl %eax		# which has to be cleaned up later..
 | 
			
		||||
	SAVE_ALL
 | 
			
		||||
#ifdef __SMP__
 | 
			
		||||
	ENTER_KERNEL
 | 
			
		||||
#endif
 | 
			
		||||
	movl EIP(%esp),%eax	# due to call gates, this is eflags, not eip..
 | 
			
		||||
	movl CS(%esp),%edx	# this is eip..
 | 
			
		||||
	movl EFLAGS(%esp),%ecx	# and this is cs..
 | 
			
		||||
	movl %eax,EFLAGS(%esp)	#
 | 
			
		||||
	movl %edx,EIP(%esp)	# Now we move them to their "normal" places
 | 
			
		||||
	movl %ecx,CS(%esp)	#
 | 
			
		||||
	movl %esp,%eax
 | 
			
		||||
#ifdef __SMP__
 | 
			
		||||
	GET_PROCESSOR_OFFSET(%edx)	# Processor offset into edx
 | 
			
		||||
	movl SYMBOL_NAME(current_set)(,%edx),%edx
 | 
			
		||||
#else
 | 
			
		||||
	movl SYMBOL_NAME(current_set),%edx
 | 
			
		||||
#endif
 | 
			
		||||
	pushl %eax
 | 
			
		||||
	movl exec_domain(%edx),%edx	# Get the execution domain
 | 
			
		||||
	movl 4(%edx),%edx	# Get the lcall7 handler for the domain
 | 
			
		||||
	call *%edx
 | 
			
		||||
	popl %eax
 | 
			
		||||
	jmp ret_from_sys_call
 | 
			
		||||
 | 
			
		||||
	ALIGN
 | 
			
		||||
handle_bottom_half:
 | 
			
		||||
	incl SYMBOL_NAME(intr_count)
 | 
			
		||||
	call SYMBOL_NAME(do_bottom_half)
 | 
			
		||||
	decl SYMBOL_NAME(intr_count)
 | 
			
		||||
	jmp 9f
 | 
			
		||||
	ALIGN
 | 
			
		||||
reschedule:
 | 
			
		||||
	pushl $ret_from_sys_call
 | 
			
		||||
	jmp SYMBOL_NAME(schedule)    # test
 | 
			
		||||
 | 
			
		||||
ENTRY(system_call)
 | 
			
		||||
	pushl %eax			# save orig_eax
 | 
			
		||||
	SAVE_ALL
 | 
			
		||||
#ifdef __SMP__
 | 
			
		||||
	ENTER_KERNEL
 | 
			
		||||
#endif
 | 
			
		||||
	movl $-ENOSYS,EAX(%esp)
 | 
			
		||||
	cmpl $(NR_syscalls),%eax
 | 
			
		||||
	jae ret_from_sys_call
 | 
			
		||||
	movl SYMBOL_NAME(sys_call_table)(,%eax,4),%eax
 | 
			
		||||
	testl %eax,%eax
 | 
			
		||||
	je ret_from_sys_call
 | 
			
		||||
#ifdef __SMP__
 | 
			
		||||
	GET_PROCESSOR_OFFSET(%edx)
 | 
			
		||||
	movl SYMBOL_NAME(current_set)(,%edx),%ebx
 | 
			
		||||
#else
 | 
			
		||||
	movl SYMBOL_NAME(current_set),%ebx
 | 
			
		||||
#endif
 | 
			
		||||
	andl $~CF_MASK,EFLAGS(%esp)	# clear carry - assume no errors
 | 
			
		||||
	movl %db6,%edx
 | 
			
		||||
	movl %edx,dbgreg6(%ebx)  # save current hardware debugging status
 | 
			
		||||
	testb $0x20,flags(%ebx)		# PF_TRACESYS
 | 
			
		||||
	jne 1f
 | 
			
		||||
	call *%eax
 | 
			
		||||
	movl %eax,EAX(%esp)		# save the return value
 | 
			
		||||
	jmp ret_from_sys_call
 | 
			
		||||
	ALIGN
 | 
			
		||||
1:	call SYMBOL_NAME(syscall_trace)
 | 
			
		||||
	movl ORIG_EAX(%esp),%eax
 | 
			
		||||
	call SYMBOL_NAME(sys_call_table)(,%eax,4)
 | 
			
		||||
	movl %eax,EAX(%esp)		# save the return value
 | 
			
		||||
#ifdef __SMP__
 | 
			
		||||
	GET_PROCESSOR_OFFSET(%eax)
 | 
			
		||||
	movl SYMBOL_NAME(current_set)(,%eax),%eax
 | 
			
		||||
#else
 | 
			
		||||
	movl SYMBOL_NAME(current_set),%eax
 | 
			
		||||
#endif
 | 
			
		||||
	call SYMBOL_NAME(syscall_trace)
 | 
			
		||||
 | 
			
		||||
	ALIGN
 | 
			
		||||
	.globl ret_from_sys_call
 | 
			
		||||
ret_from_sys_call:
 | 
			
		||||
	cmpl $0,SYMBOL_NAME(intr_count)
 | 
			
		||||
	jne 2f
 | 
			
		||||
9:	movl SYMBOL_NAME(bh_mask),%eax
 | 
			
		||||
	andl SYMBOL_NAME(bh_active),%eax
 | 
			
		||||
	jne handle_bottom_half
 | 
			
		||||
#ifdef __SMP__
 | 
			
		||||
	cmpb $(NO_PROC_ID), SYMBOL_NAME(saved_active_kernel_processor)
 | 
			
		||||
	jne 2f
 | 
			
		||||
#endif
 | 
			
		||||
	movl EFLAGS(%esp),%eax		# check VM86 flag: CS/SS are
 | 
			
		||||
	testl $(VM_MASK),%eax		# different then
 | 
			
		||||
	jne 1f
 | 
			
		||||
	cmpw $(KERNEL_CS),CS(%esp)	# was old code segment supervisor ?
 | 
			
		||||
	je 2f
 | 
			
		||||
1:	sti
 | 
			
		||||
	orl $(IF_MASK),%eax		# these just try to make sure
 | 
			
		||||
	andl $~NT_MASK,%eax		# the program doesn't do anything
 | 
			
		||||
	movl %eax,EFLAGS(%esp)		# stupid
 | 
			
		||||
	cmpl $0,SYMBOL_NAME(need_resched)
 | 
			
		||||
	jne reschedule
 | 
			
		||||
#ifdef __SMP__
 | 
			
		||||
	GET_PROCESSOR_OFFSET(%eax)
 | 
			
		||||
	movl SYMBOL_NAME(current_set)(,%eax), %eax
 | 
			
		||||
#else
 | 
			
		||||
	movl SYMBOL_NAME(current_set),%eax
 | 
			
		||||
#endif
 | 
			
		||||
	cmpl SYMBOL_NAME(task),%eax	# task[0] cannot have signals
 | 
			
		||||
	je 2f
 | 
			
		||||
	movl blocked(%eax),%ecx
 | 
			
		||||
	movl %ecx,%ebx			# save blocked in %ebx for signal handling
 | 
			
		||||
	notl %ecx
 | 
			
		||||
	andl signal(%eax),%ecx
 | 
			
		||||
	jne signal_return
 | 
			
		||||
2:	RESTORE_ALL
 | 
			
		||||
	ALIGN
 | 
			
		||||
signal_return:
 | 
			
		||||
	movl %esp,%ecx
 | 
			
		||||
	pushl %ecx
 | 
			
		||||
	testl $(VM_MASK),EFLAGS(%ecx)
 | 
			
		||||
	jne v86_signal_return
 | 
			
		||||
	pushl %ebx
 | 
			
		||||
	call SYMBOL_NAME(do_signal)
 | 
			
		||||
	popl %ebx
 | 
			
		||||
	popl %ebx
 | 
			
		||||
	RESTORE_ALL
 | 
			
		||||
	ALIGN
 | 
			
		||||
v86_signal_return:
 | 
			
		||||
	call SYMBOL_NAME(save_v86_state)
 | 
			
		||||
	movl %eax,%esp
 | 
			
		||||
	pushl %eax
 | 
			
		||||
	pushl %ebx
 | 
			
		||||
	call SYMBOL_NAME(do_signal)
 | 
			
		||||
	popl %ebx
 | 
			
		||||
	popl %ebx
 | 
			
		||||
	RESTORE_ALL
 | 
			
		||||
 | 
			
		||||
ENTRY(divide_error)
 | 
			
		||||
	pushl $0		# no error code
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_divide_error)
 | 
			
		||||
	ALIGN
 | 
			
		||||
error_code:
 | 
			
		||||
	push %fs
 | 
			
		||||
	push %es
 | 
			
		||||
	push %ds
 | 
			
		||||
	pushl %eax
 | 
			
		||||
	xorl %eax,%eax
 | 
			
		||||
	pushl %ebp
 | 
			
		||||
	pushl %edi
 | 
			
		||||
	pushl %esi
 | 
			
		||||
	pushl %edx
 | 
			
		||||
	decl %eax			# eax = -1
 | 
			
		||||
	pushl %ecx
 | 
			
		||||
	pushl %ebx
 | 
			
		||||
	cld
 | 
			
		||||
	xorl %ebx,%ebx			# zero ebx
 | 
			
		||||
	xchgl %eax, ORIG_EAX(%esp)	# orig_eax (get the error code. )
 | 
			
		||||
	mov %gs,%bx			# get the lower order bits of gs
 | 
			
		||||
	movl %esp,%edx
 | 
			
		||||
	xchgl %ebx, GS(%esp)		# get the address and save gs.
 | 
			
		||||
	pushl %eax			# push the error code
 | 
			
		||||
	pushl %edx
 | 
			
		||||
	movl $(KERNEL_DS),%edx
 | 
			
		||||
	mov %dx,%ds
 | 
			
		||||
	mov %dx,%es
 | 
			
		||||
	movl $(USER_DS),%edx
 | 
			
		||||
	mov %dx,%fs
 | 
			
		||||
#ifdef __SMP__
 | 
			
		||||
	ENTER_KERNEL
 | 
			
		||||
	GET_PROCESSOR_OFFSET(%eax)
 | 
			
		||||
	movl SYMBOL_NAME(current_set)(,%eax), %eax
 | 
			
		||||
#else
 | 
			
		||||
	movl SYMBOL_NAME(current_set),%eax
 | 
			
		||||
#endif
 | 
			
		||||
	movl %db6,%edx
 | 
			
		||||
	movl %edx,dbgreg6(%eax)  # save current hardware debugging status
 | 
			
		||||
	call *%ebx
 | 
			
		||||
	addl $8,%esp
 | 
			
		||||
	jmp ret_from_sys_call
 | 
			
		||||
 | 
			
		||||
ENTRY(coprocessor_error)
 | 
			
		||||
	pushl $0
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_coprocessor_error)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(device_not_available)
 | 
			
		||||
	pushl $-1		# mark this as an int
 | 
			
		||||
	SAVE_ALL
 | 
			
		||||
#ifdef __SMP__
 | 
			
		||||
	ENTER_KERNEL
 | 
			
		||||
#endif
 | 
			
		||||
	pushl $ret_from_sys_call
 | 
			
		||||
	movl %cr0,%eax
 | 
			
		||||
	testl $0x4,%eax			# EM (math emulation bit)
 | 
			
		||||
	je SYMBOL_NAME(math_state_restore)
 | 
			
		||||
	pushl $0		# temporary storage for ORIG_EIP
 | 
			
		||||
	call  SYMBOL_NAME(math_emulate)
 | 
			
		||||
	addl $4,%esp
 | 
			
		||||
	ret
 | 
			
		||||
 | 
			
		||||
ENTRY(debug)
 | 
			
		||||
	pushl $0
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_debug)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(nmi)
 | 
			
		||||
	pushl $0
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_nmi)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(int3)
 | 
			
		||||
	pushl $0
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_int3)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(overflow)
 | 
			
		||||
	pushl $0
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_overflow)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(bounds)
 | 
			
		||||
	pushl $0
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_bounds)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(invalid_op)
 | 
			
		||||
	pushl $0
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_invalid_op)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(coprocessor_segment_overrun)
 | 
			
		||||
	pushl $0
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_coprocessor_segment_overrun)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(reserved)
 | 
			
		||||
	pushl $0
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_reserved)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(double_fault)
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_double_fault)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(invalid_TSS)
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_invalid_TSS)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(segment_not_present)
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_segment_not_present)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(stack_segment)
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_stack_segment)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(general_protection)
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_general_protection)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(alignment_check)
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_alignment_check)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(page_fault)
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_page_fault)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(spurious_interrupt_bug)
 | 
			
		||||
	pushl $0
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_spurious_interrupt_bug)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
.data
 | 
			
		||||
ENTRY(sys_call_table)
 | 
			
		||||
	.long SYMBOL_NAME(sys_setup)		/* 0 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_exit)
 | 
			
		||||
	.long SYMBOL_NAME(sys_fork)
 | 
			
		||||
	.long SYMBOL_NAME(sys_read)
 | 
			
		||||
	.long SYMBOL_NAME(sys_write)
 | 
			
		||||
	.long SYMBOL_NAME(sys_open)		/* 5 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_close)
 | 
			
		||||
	.long SYMBOL_NAME(sys_waitpid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_creat)
 | 
			
		||||
	.long SYMBOL_NAME(sys_link)
 | 
			
		||||
	.long SYMBOL_NAME(sys_unlink)		/* 10 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_execve)
 | 
			
		||||
	.long SYMBOL_NAME(sys_chdir)
 | 
			
		||||
	.long SYMBOL_NAME(sys_time)
 | 
			
		||||
	.long SYMBOL_NAME(sys_mknod)
 | 
			
		||||
	.long SYMBOL_NAME(sys_chmod)		/* 15 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_chown)
 | 
			
		||||
	.long SYMBOL_NAME(sys_break)
 | 
			
		||||
	.long SYMBOL_NAME(sys_stat)
 | 
			
		||||
	.long SYMBOL_NAME(sys_lseek)
 | 
			
		||||
	.long SYMBOL_NAME(sys_getpid)		/* 20 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_mount)
 | 
			
		||||
	.long SYMBOL_NAME(sys_umount)
 | 
			
		||||
	.long SYMBOL_NAME(sys_setuid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_getuid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_stime)		/* 25 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_ptrace)
 | 
			
		||||
	.long SYMBOL_NAME(sys_alarm)
 | 
			
		||||
	.long SYMBOL_NAME(sys_fstat)
 | 
			
		||||
	.long SYMBOL_NAME(sys_pause)
 | 
			
		||||
	.long SYMBOL_NAME(sys_utime)		/* 30 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_stty)
 | 
			
		||||
	.long SYMBOL_NAME(sys_gtty)
 | 
			
		||||
	.long SYMBOL_NAME(sys_access)
 | 
			
		||||
	.long SYMBOL_NAME(sys_nice)
 | 
			
		||||
	.long SYMBOL_NAME(sys_ftime)		/* 35 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_sync)
 | 
			
		||||
	.long SYMBOL_NAME(sys_kill)
 | 
			
		||||
	.long SYMBOL_NAME(sys_rename)
 | 
			
		||||
	.long SYMBOL_NAME(sys_mkdir)
 | 
			
		||||
	.long SYMBOL_NAME(sys_rmdir)		/* 40 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_dup)
 | 
			
		||||
	.long SYMBOL_NAME(sys_pipe)
 | 
			
		||||
	.long SYMBOL_NAME(sys_times)
 | 
			
		||||
	.long SYMBOL_NAME(sys_prof)
 | 
			
		||||
	.long SYMBOL_NAME(sys_brk)		/* 45 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_setgid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_getgid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_signal)
 | 
			
		||||
	.long SYMBOL_NAME(sys_geteuid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_getegid)		/* 50 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_acct)
 | 
			
		||||
	.long SYMBOL_NAME(sys_phys)
 | 
			
		||||
	.long SYMBOL_NAME(sys_lock)
 | 
			
		||||
	.long SYMBOL_NAME(sys_ioctl)
 | 
			
		||||
	.long SYMBOL_NAME(sys_fcntl)		/* 55 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_mpx)
 | 
			
		||||
	.long SYMBOL_NAME(sys_setpgid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_ulimit)
 | 
			
		||||
	.long SYMBOL_NAME(sys_olduname)
 | 
			
		||||
	.long SYMBOL_NAME(sys_umask)		/* 60 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_chroot)
 | 
			
		||||
	.long SYMBOL_NAME(sys_ustat)
 | 
			
		||||
	.long SYMBOL_NAME(sys_dup2)
 | 
			
		||||
	.long SYMBOL_NAME(sys_getppid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_getpgrp)		/* 65 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_setsid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sigaction)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sgetmask)
 | 
			
		||||
	.long SYMBOL_NAME(sys_ssetmask)
 | 
			
		||||
	.long SYMBOL_NAME(sys_setreuid)		/* 70 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_setregid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sigsuspend)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sigpending)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sethostname)
 | 
			
		||||
	.long SYMBOL_NAME(sys_setrlimit)	/* 75 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_getrlimit)
 | 
			
		||||
	.long SYMBOL_NAME(sys_getrusage)
 | 
			
		||||
	.long SYMBOL_NAME(sys_gettimeofday)
 | 
			
		||||
	.long SYMBOL_NAME(sys_settimeofday)
 | 
			
		||||
	.long SYMBOL_NAME(sys_getgroups)	/* 80 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_setgroups)
 | 
			
		||||
	.long SYMBOL_NAME(old_select)
 | 
			
		||||
	.long SYMBOL_NAME(sys_symlink)
 | 
			
		||||
	.long SYMBOL_NAME(sys_lstat)
 | 
			
		||||
	.long SYMBOL_NAME(sys_readlink)		/* 85 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_uselib)
 | 
			
		||||
	.long SYMBOL_NAME(sys_swapon)
 | 
			
		||||
	.long SYMBOL_NAME(sys_reboot)
 | 
			
		||||
	.long SYMBOL_NAME(old_readdir)
 | 
			
		||||
	.long SYMBOL_NAME(old_mmap)		/* 90 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_munmap)
 | 
			
		||||
	.long SYMBOL_NAME(sys_truncate)
 | 
			
		||||
	.long SYMBOL_NAME(sys_ftruncate)
 | 
			
		||||
	.long SYMBOL_NAME(sys_fchmod)
 | 
			
		||||
	.long SYMBOL_NAME(sys_fchown)		/* 95 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_getpriority)
 | 
			
		||||
	.long SYMBOL_NAME(sys_setpriority)
 | 
			
		||||
	.long SYMBOL_NAME(sys_profil)
 | 
			
		||||
	.long SYMBOL_NAME(sys_statfs)
 | 
			
		||||
	.long SYMBOL_NAME(sys_fstatfs)		/* 100 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_ioperm)
 | 
			
		||||
	.long SYMBOL_NAME(sys_socketcall)
 | 
			
		||||
	.long SYMBOL_NAME(sys_syslog)
 | 
			
		||||
	.long SYMBOL_NAME(sys_setitimer)
 | 
			
		||||
	.long SYMBOL_NAME(sys_getitimer)	/* 105 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_newstat)
 | 
			
		||||
	.long SYMBOL_NAME(sys_newlstat)
 | 
			
		||||
	.long SYMBOL_NAME(sys_newfstat)
 | 
			
		||||
	.long SYMBOL_NAME(sys_uname)
 | 
			
		||||
	.long SYMBOL_NAME(sys_iopl)		/* 110 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_vhangup)
 | 
			
		||||
	.long SYMBOL_NAME(sys_idle)
 | 
			
		||||
	.long SYMBOL_NAME(sys_vm86old)
 | 
			
		||||
	.long SYMBOL_NAME(sys_wait4)
 | 
			
		||||
	.long SYMBOL_NAME(sys_swapoff)		/* 115 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_sysinfo)
 | 
			
		||||
	.long SYMBOL_NAME(sys_ipc)
 | 
			
		||||
	.long SYMBOL_NAME(sys_fsync)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sigreturn)
 | 
			
		||||
	.long SYMBOL_NAME(sys_clone)		/* 120 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_setdomainname)
 | 
			
		||||
	.long SYMBOL_NAME(sys_newuname)
 | 
			
		||||
	.long SYMBOL_NAME(sys_modify_ldt)
 | 
			
		||||
	.long SYMBOL_NAME(sys_adjtimex)
 | 
			
		||||
	.long SYMBOL_NAME(sys_mprotect)		/* 125 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_sigprocmask)
 | 
			
		||||
	.long SYMBOL_NAME(sys_create_module)
 | 
			
		||||
	.long SYMBOL_NAME(sys_init_module)
 | 
			
		||||
	.long SYMBOL_NAME(sys_delete_module)
 | 
			
		||||
	.long SYMBOL_NAME(sys_get_kernel_syms)	/* 130 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_quotactl)
 | 
			
		||||
	.long SYMBOL_NAME(sys_getpgid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_fchdir)
 | 
			
		||||
	.long SYMBOL_NAME(sys_bdflush)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sysfs)		/* 135 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_personality)
 | 
			
		||||
	.long 0					/* for afs_syscall */
 | 
			
		||||
	.long SYMBOL_NAME(sys_setfsuid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_setfsgid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_llseek)		/* 140 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_getdents)
 | 
			
		||||
	.long SYMBOL_NAME(sys_select)
 | 
			
		||||
	.long SYMBOL_NAME(sys_flock)
 | 
			
		||||
	.long SYMBOL_NAME(sys_msync)
 | 
			
		||||
	.long SYMBOL_NAME(sys_readv)		/* 145 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_writev)
 | 
			
		||||
	.long SYMBOL_NAME(sys_getsid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_fdatasync)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sysctl)
 | 
			
		||||
	.long SYMBOL_NAME(sys_mlock)		/* 150 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_munlock)
 | 
			
		||||
	.long SYMBOL_NAME(sys_mlockall)
 | 
			
		||||
	.long SYMBOL_NAME(sys_munlockall)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sched_setparam)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sched_getparam)   /* 155 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_sched_setscheduler)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sched_getscheduler)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sched_yield)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sched_get_priority_max)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sched_get_priority_min)  /* 160 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_sched_rr_get_interval)
 | 
			
		||||
	.long SYMBOL_NAME(sys_nanosleep)
 | 
			
		||||
	.long SYMBOL_NAME(sys_mremap)
 | 
			
		||||
	.long 0,0
 | 
			
		||||
	.long SYMBOL_NAME(sys_vm86)
 | 
			
		||||
	.long 0,0,0,0					/* 170 */
 | 
			
		||||
	.long 0,0,0,0,0,0,0,0,0,0			/* 180 */
 | 
			
		||||
	.long 0,0,0,0,0,0,0
 | 
			
		||||
	.long SYMBOL_NAME(sys_table)
 | 
			
		||||
	.space (NR_syscalls-188)*4
 | 
			
		||||
@@ -28,14 +28,16 @@ diff -ur linux-2.0.32/Makefile linux-hacked/Makefile
 | 
			
		||||
diff -ur linux-2.0.32/arch/i386/kernel/entry.S linux-hacked/arch/i386/kernel/entry.S
 | 
			
		||||
--- linux-2.0.32/arch/i386/kernel/entry.S	Tue Sep 16 23:42:45 1997
 | 
			
		||||
+++ linux-hacked/arch/i386/kernel/entry.S	Thu Jun 11 21:37:20 1998
 | 
			
		||||
@@ -699,4 +699,6 @@
 | 
			
		||||
@@ -699,4 +699,8 @@
 | 
			
		||||
 	.long SYMBOL_NAME(sys_mremap)
 | 
			
		||||
 	.long 0,0
 | 
			
		||||
 	.long SYMBOL_NAME(sys_vm86)
 | 
			
		||||
-	.space (NR_syscalls-166)*4
 | 
			
		||||
+	.long 0
 | 
			
		||||
+	.long 0,0,0,0					/* 170 */
 | 
			
		||||
+	.long 0,0,0,0,0,0,0,0,0,0			/* 180 */
 | 
			
		||||
+	.long 0,0,0,0,0,0,0
 | 
			
		||||
+	.long SYMBOL_NAME(sys_table)
 | 
			
		||||
+	.space (NR_syscalls-168)*4
 | 
			
		||||
+	.space (NR_syscalls-188)*4
 | 
			
		||||
diff -ur linux-2.0.32/include/asm-i386/unistd.h linux-hacked/include/asm-i386/unistd.h
 | 
			
		||||
--- linux-2.0.32/include/asm-i386/unistd.h	Fri Mar 22 07:34:02 1996
 | 
			
		||||
+++ linux-hacked/include/asm-i386/unistd.h	Thu Jun 11 21:37:03 1998
 | 
			
		||||
@@ -43,7 +45,7 @@ diff -ur linux-2.0.32/include/asm-i386/unistd.h linux-hacked/include/asm-i386/un
 | 
			
		||||
 #define __NR_sched_rr_get_interval	161
 | 
			
		||||
 #define __NR_nanosleep		162
 | 
			
		||||
 #define __NR_mremap		163
 | 
			
		||||
+#define __NR_table		168
 | 
			
		||||
+#define __NR_table		188
 | 
			
		||||
 
 | 
			
		||||
 /* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
 | 
			
		||||
 #define _syscall0(type,name) \
 | 
			
		||||
@@ -189,8 +189,11 @@ sys_table (int type, union table *buf, const void *param)
 | 
			
		||||
	union table tbl;
 | 
			
		||||
	struct sysinfo i;
 | 
			
		||||
	struct task_struct *tsk = NULL;
 | 
			
		||||
	struct ip_chain *chain;
 | 
			
		||||
	struct ip_fwkernel *rule;
 | 
			
		||||
	char devname [9];
 | 
			
		||||
	int index, err;
 | 
			
		||||
	pid_t pid;
 | 
			
		||||
	int err;
 | 
			
		||||
 | 
			
		||||
	if (type == TABLE_VERSION)
 | 
			
		||||
		return _TABLE_VERSION;
 | 
			
		||||
@@ -219,17 +222,36 @@ sys_table (int type, union table *buf, const void *param)
 | 
			
		||||
		if (tsk == NULL)
 | 
			
		||||
			return -ESRCH;
 | 
			
		||||
		break;
 | 
			
		||||
	case TABLE_NETACCT:
 | 
			
		||||
		err = verify_area (VERIFY_READ, param, 5);
 | 
			
		||||
		if (err)
 | 
			
		||||
			return err;
 | 
			
		||||
		copy_from_user (devname, param, 5);
 | 
			
		||||
		devname [5] = 0;
 | 
			
		||||
 | 
			
		||||
		break;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* Main function dispatcher */
 | 
			
		||||
 | 
			
		||||
	switch (type) {
 | 
			
		||||
	case TABLE_PROCLIST:
 | 
			
		||||
		tsk = task [0];
 | 
			
		||||
		for (index = 0; index < nr_tasks; index++) {
 | 
			
		||||
			tbl.proclist.pids [index] = tsk->pid;
 | 
			
		||||
			tsk = tsk->next_task;
 | 
			
		||||
		}
 | 
			
		||||
		tbl.proclist.nr_running = nr_running;
 | 
			
		||||
		tbl.proclist.nr_tasks = nr_tasks;
 | 
			
		||||
		tbl.proclist.last_pid = last_pid;
 | 
			
		||||
		break;
 | 
			
		||||
	case TABLE_CPU:
 | 
			
		||||
		tbl.cpu.total = jiffies;    
 | 
			
		||||
		tbl.cpu.user  = kstat.cpu_user;
 | 
			
		||||
		tbl.cpu.nice  = kstat.cpu_nice;
 | 
			
		||||
		tbl.cpu.sys   = kstat.cpu_system;
 | 
			
		||||
		tbl.cpu.idle  = tbl.cpu.total - (tbl.cpu.user + tbl.cpu.nice + tbl.cpu.sys);
 | 
			
		||||
		tbl.cpu.idle  = tbl.cpu.total -
 | 
			
		||||
			(tbl.cpu.user + tbl.cpu.nice + tbl.cpu.sys);
 | 
			
		||||
		tbl.cpu.frequency = HZ;
 | 
			
		||||
		break;
 | 
			
		||||
	case TABLE_MEM:
 | 
			
		||||
@@ -246,6 +268,8 @@ sys_table (int type, union table *buf, const void *param)
 | 
			
		||||
		tbl.swap.total = i.totalswap;
 | 
			
		||||
		tbl.swap.used  = i.totalswap - i.freeswap;
 | 
			
		||||
		tbl.swap.free  = i.freeswap;
 | 
			
		||||
		tbl.swap.pagein = kstat.pswpin;
 | 
			
		||||
		tbl.swap.pageout = kstat.pswpout;
 | 
			
		||||
		break;
 | 
			
		||||
	case TABLE_LOADAVG:
 | 
			
		||||
		tbl.loadavg.loadavg [0] = (double) avenrun [0] / (1 << FSHIFT);
 | 
			
		||||
@@ -262,7 +286,8 @@ sys_table (int type, union table *buf, const void *param)
 | 
			
		||||
	case TABLE_PROC_STATE:
 | 
			
		||||
		tbl.proc_state.state = tsk->state;
 | 
			
		||||
		tbl.proc_state.flags = tsk->flags;
 | 
			
		||||
		memcpy (tbl.proc_state.comm, tsk->comm, sizeof (tbl.proc_state.comm));
 | 
			
		||||
		memcpy (tbl.proc_state.comm, tsk->comm,
 | 
			
		||||
			sizeof (tbl.proc_state.comm));
 | 
			
		||||
		break;
 | 
			
		||||
	case TABLE_PROC_UID:
 | 
			
		||||
		tbl.proc_uid.uid = tsk->uid;
 | 
			
		||||
@@ -280,7 +305,8 @@ sys_table (int type, union table *buf, const void *param)
 | 
			
		||||
		tbl.proc_uid.ppid = tsk->p_pptr->pid;
 | 
			
		||||
		
 | 
			
		||||
		tbl.proc_uid.session = tsk->session;
 | 
			
		||||
	        tbl.proc_uid.tty = tsk->tty ? kdev_t_to_nr (tsk->tty->device) : 0;
 | 
			
		||||
	        tbl.proc_uid.tty = tsk->tty ?
 | 
			
		||||
			kdev_t_to_nr (tsk->tty->device) : 0;
 | 
			
		||||
		tbl.proc_uid.tpgid = tsk->tty ? tsk->tty->pgrp : -1;
 | 
			
		||||
		
 | 
			
		||||
		tbl.proc_uid.priority = tsk->priority;
 | 
			
		||||
@@ -337,7 +363,8 @@ sys_table (int type, union table *buf, const void *param)
 | 
			
		||||
			tbl.proc_mem.total_vm = tsk->mm->total_vm;
 | 
			
		||||
			tbl.proc_mem.locked_vm = tsk->mm->locked_vm;
 | 
			
		||||
		}
 | 
			
		||||
		tbl.proc_mem.rlim = tsk->rlim ? tsk->rlim[RLIMIT_RSS].rlim_cur : 0;
 | 
			
		||||
		tbl.proc_mem.rlim = tsk->rlim ?
 | 
			
		||||
			tsk->rlim[RLIMIT_RSS].rlim_cur : 0;
 | 
			
		||||
		break;
 | 
			
		||||
	case TABLE_PROC_SEGMENT:
 | 
			
		||||
		if (tsk->mm && tsk->mm != &init_mm) {
 | 
			
		||||
@@ -410,6 +437,24 @@ sys_table (int type, union table *buf, const void *param)
 | 
			
		||||
 | 
			
		||||
		tbl.proc_kernel.wchan = get_wchan (tsk);
 | 
			
		||||
		break;
 | 
			
		||||
	case TABLE_NETACCT:
 | 
			
		||||
		for (chain = ip_fw_chains; chain; chain = chain->next) {
 | 
			
		||||
			for (rule = chain->chain; rule; rule = rule->next) {
 | 
			
		||||
				const char *name = rule->ipfw.fw_vianame;
 | 
			
		||||
				int k;
 | 
			
		||||
				
 | 
			
		||||
				if (name [0] && !strncmp (param, name, 5))
 | 
			
		||||
					continue;
 | 
			
		||||
				
 | 
			
		||||
				for (k = 0; k < NUM_SLOTS; k++) {
 | 
			
		||||
					tbl.netacct.packets +=
 | 
			
		||||
						rule->counters[k].pcnt;
 | 
			
		||||
					tbl.netacct.bytes +=
 | 
			
		||||
						rule->counters[k].bcnt;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		break;
 | 
			
		||||
	default:
 | 
			
		||||
		return -EINVAL;
 | 
			
		||||
	}
 | 
			
		||||
							
								
								
									
										324
									
								
								kernel/table20/unistd-i386.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										324
									
								
								kernel/table20/unistd-i386.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,324 @@
 | 
			
		||||
#ifndef _ASM_I386_UNISTD_H_
 | 
			
		||||
#define _ASM_I386_UNISTD_H_
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * This file contains the system call numbers.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define __NR_setup		  0	/* used only by init, to get system going */
 | 
			
		||||
#define __NR_exit		  1
 | 
			
		||||
#define __NR_fork		  2
 | 
			
		||||
#define __NR_read		  3
 | 
			
		||||
#define __NR_write		  4
 | 
			
		||||
#define __NR_open		  5
 | 
			
		||||
#define __NR_close		  6
 | 
			
		||||
#define __NR_waitpid		  7
 | 
			
		||||
#define __NR_creat		  8
 | 
			
		||||
#define __NR_link		  9
 | 
			
		||||
#define __NR_unlink		 10
 | 
			
		||||
#define __NR_execve		 11
 | 
			
		||||
#define __NR_chdir		 12
 | 
			
		||||
#define __NR_time		 13
 | 
			
		||||
#define __NR_mknod		 14
 | 
			
		||||
#define __NR_chmod		 15
 | 
			
		||||
#define __NR_chown		 16
 | 
			
		||||
#define __NR_break		 17
 | 
			
		||||
#define __NR_oldstat		 18
 | 
			
		||||
#define __NR_lseek		 19
 | 
			
		||||
#define __NR_getpid		 20
 | 
			
		||||
#define __NR_mount		 21
 | 
			
		||||
#define __NR_umount		 22
 | 
			
		||||
#define __NR_setuid		 23
 | 
			
		||||
#define __NR_getuid		 24
 | 
			
		||||
#define __NR_stime		 25
 | 
			
		||||
#define __NR_ptrace		 26
 | 
			
		||||
#define __NR_alarm		 27
 | 
			
		||||
#define __NR_oldfstat		 28
 | 
			
		||||
#define __NR_pause		 29
 | 
			
		||||
#define __NR_utime		 30
 | 
			
		||||
#define __NR_stty		 31
 | 
			
		||||
#define __NR_gtty		 32
 | 
			
		||||
#define __NR_access		 33
 | 
			
		||||
#define __NR_nice		 34
 | 
			
		||||
#define __NR_ftime		 35
 | 
			
		||||
#define __NR_sync		 36
 | 
			
		||||
#define __NR_kill		 37
 | 
			
		||||
#define __NR_rename		 38
 | 
			
		||||
#define __NR_mkdir		 39
 | 
			
		||||
#define __NR_rmdir		 40
 | 
			
		||||
#define __NR_dup		 41
 | 
			
		||||
#define __NR_pipe		 42
 | 
			
		||||
#define __NR_times		 43
 | 
			
		||||
#define __NR_prof		 44
 | 
			
		||||
#define __NR_brk		 45
 | 
			
		||||
#define __NR_setgid		 46
 | 
			
		||||
#define __NR_getgid		 47
 | 
			
		||||
#define __NR_signal		 48
 | 
			
		||||
#define __NR_geteuid		 49
 | 
			
		||||
#define __NR_getegid		 50
 | 
			
		||||
#define __NR_acct		 51
 | 
			
		||||
#define __NR_phys		 52
 | 
			
		||||
#define __NR_lock		 53
 | 
			
		||||
#define __NR_ioctl		 54
 | 
			
		||||
#define __NR_fcntl		 55
 | 
			
		||||
#define __NR_mpx		 56
 | 
			
		||||
#define __NR_setpgid		 57
 | 
			
		||||
#define __NR_ulimit		 58
 | 
			
		||||
#define __NR_oldolduname	 59
 | 
			
		||||
#define __NR_umask		 60
 | 
			
		||||
#define __NR_chroot		 61
 | 
			
		||||
#define __NR_ustat		 62
 | 
			
		||||
#define __NR_dup2		 63
 | 
			
		||||
#define __NR_getppid		 64
 | 
			
		||||
#define __NR_getpgrp		 65
 | 
			
		||||
#define __NR_setsid		 66
 | 
			
		||||
#define __NR_sigaction		 67
 | 
			
		||||
#define __NR_sgetmask		 68
 | 
			
		||||
#define __NR_ssetmask		 69
 | 
			
		||||
#define __NR_setreuid		 70
 | 
			
		||||
#define __NR_setregid		 71
 | 
			
		||||
#define __NR_sigsuspend		 72
 | 
			
		||||
#define __NR_sigpending		 73
 | 
			
		||||
#define __NR_sethostname	 74
 | 
			
		||||
#define __NR_setrlimit		 75
 | 
			
		||||
#define __NR_getrlimit		 76
 | 
			
		||||
#define __NR_getrusage		 77
 | 
			
		||||
#define __NR_gettimeofday	 78
 | 
			
		||||
#define __NR_settimeofday	 79
 | 
			
		||||
#define __NR_getgroups		 80
 | 
			
		||||
#define __NR_setgroups		 81
 | 
			
		||||
#define __NR_select		 82
 | 
			
		||||
#define __NR_symlink		 83
 | 
			
		||||
#define __NR_oldlstat		 84
 | 
			
		||||
#define __NR_readlink		 85
 | 
			
		||||
#define __NR_uselib		 86
 | 
			
		||||
#define __NR_swapon		 87
 | 
			
		||||
#define __NR_reboot		 88
 | 
			
		||||
#define __NR_readdir		 89
 | 
			
		||||
#define __NR_mmap		 90
 | 
			
		||||
#define __NR_munmap		 91
 | 
			
		||||
#define __NR_truncate		 92
 | 
			
		||||
#define __NR_ftruncate		 93
 | 
			
		||||
#define __NR_fchmod		 94
 | 
			
		||||
#define __NR_fchown		 95
 | 
			
		||||
#define __NR_getpriority	 96
 | 
			
		||||
#define __NR_setpriority	 97
 | 
			
		||||
#define __NR_profil		 98
 | 
			
		||||
#define __NR_statfs		 99
 | 
			
		||||
#define __NR_fstatfs		100
 | 
			
		||||
#define __NR_ioperm		101
 | 
			
		||||
#define __NR_socketcall		102
 | 
			
		||||
#define __NR_syslog		103
 | 
			
		||||
#define __NR_setitimer		104
 | 
			
		||||
#define __NR_getitimer		105
 | 
			
		||||
#define __NR_stat		106
 | 
			
		||||
#define __NR_lstat		107
 | 
			
		||||
#define __NR_fstat		108
 | 
			
		||||
#define __NR_olduname		109
 | 
			
		||||
#define __NR_iopl		110
 | 
			
		||||
#define __NR_vhangup		111
 | 
			
		||||
#define __NR_idle		112
 | 
			
		||||
#define __NR_vm86		113
 | 
			
		||||
#define __NR_wait4		114
 | 
			
		||||
#define __NR_swapoff		115
 | 
			
		||||
#define __NR_sysinfo		116
 | 
			
		||||
#define __NR_ipc		117
 | 
			
		||||
#define __NR_fsync		118
 | 
			
		||||
#define __NR_sigreturn		119
 | 
			
		||||
#define __NR_clone		120
 | 
			
		||||
#define __NR_setdomainname	121
 | 
			
		||||
#define __NR_uname		122
 | 
			
		||||
#define __NR_modify_ldt		123
 | 
			
		||||
#define __NR_adjtimex		124
 | 
			
		||||
#define __NR_mprotect		125
 | 
			
		||||
#define __NR_sigprocmask	126
 | 
			
		||||
#define __NR_create_module	127
 | 
			
		||||
#define __NR_init_module	128
 | 
			
		||||
#define __NR_delete_module	129
 | 
			
		||||
#define __NR_get_kernel_syms	130
 | 
			
		||||
#define __NR_quotactl		131
 | 
			
		||||
#define __NR_getpgid		132
 | 
			
		||||
#define __NR_fchdir		133
 | 
			
		||||
#define __NR_bdflush		134
 | 
			
		||||
#define __NR_sysfs		135
 | 
			
		||||
#define __NR_personality	136
 | 
			
		||||
#define __NR_afs_syscall	137 /* Syscall for Andrew File System */
 | 
			
		||||
#define __NR_setfsuid		138
 | 
			
		||||
#define __NR_setfsgid		139
 | 
			
		||||
#define __NR__llseek		140
 | 
			
		||||
#define __NR_getdents		141
 | 
			
		||||
#define __NR__newselect		142
 | 
			
		||||
#define __NR_flock		143
 | 
			
		||||
#define __NR_msync		144
 | 
			
		||||
#define __NR_readv		145
 | 
			
		||||
#define __NR_writev		146
 | 
			
		||||
#define __NR_getsid		147
 | 
			
		||||
#define __NR_fdatasync		148
 | 
			
		||||
#define __NR__sysctl		149
 | 
			
		||||
#define __NR_mlock		150
 | 
			
		||||
#define __NR_munlock		151
 | 
			
		||||
#define __NR_mlockall		152
 | 
			
		||||
#define __NR_munlockall		153
 | 
			
		||||
#define __NR_sched_setparam		154
 | 
			
		||||
#define __NR_sched_getparam		155
 | 
			
		||||
#define __NR_sched_setscheduler		156
 | 
			
		||||
#define __NR_sched_getscheduler		157
 | 
			
		||||
#define __NR_sched_yield		158
 | 
			
		||||
#define __NR_sched_get_priority_max	159
 | 
			
		||||
#define __NR_sched_get_priority_min	160
 | 
			
		||||
#define __NR_sched_rr_get_interval	161
 | 
			
		||||
#define __NR_nanosleep		162
 | 
			
		||||
#define __NR_mremap		163
 | 
			
		||||
#define __NR_table		188
 | 
			
		||||
 | 
			
		||||
/* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
 | 
			
		||||
#define _syscall0(type,name) \
 | 
			
		||||
type name(void) \
 | 
			
		||||
{ \
 | 
			
		||||
long __res; \
 | 
			
		||||
__asm__ volatile ("int $0x80" \
 | 
			
		||||
	: "=a" (__res) \
 | 
			
		||||
	: "0" (__NR_##name)); \
 | 
			
		||||
if (__res >= 0) \
 | 
			
		||||
	return (type) __res; \
 | 
			
		||||
errno = -__res; \
 | 
			
		||||
return -1; \
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define _syscall1(type,name,type1,arg1) \
 | 
			
		||||
type name(type1 arg1) \
 | 
			
		||||
{ \
 | 
			
		||||
long __res; \
 | 
			
		||||
__asm__ volatile ("int $0x80" \
 | 
			
		||||
	: "=a" (__res) \
 | 
			
		||||
	: "0" (__NR_##name),"b" ((long)(arg1))); \
 | 
			
		||||
if (__res >= 0) \
 | 
			
		||||
	return (type) __res; \
 | 
			
		||||
errno = -__res; \
 | 
			
		||||
return -1; \
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define _syscall2(type,name,type1,arg1,type2,arg2) \
 | 
			
		||||
type name(type1 arg1,type2 arg2) \
 | 
			
		||||
{ \
 | 
			
		||||
long __res; \
 | 
			
		||||
__asm__ volatile ("int $0x80" \
 | 
			
		||||
	: "=a" (__res) \
 | 
			
		||||
	: "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2))); \
 | 
			
		||||
if (__res >= 0) \
 | 
			
		||||
	return (type) __res; \
 | 
			
		||||
errno = -__res; \
 | 
			
		||||
return -1; \
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
 | 
			
		||||
type name(type1 arg1,type2 arg2,type3 arg3) \
 | 
			
		||||
{ \
 | 
			
		||||
long __res; \
 | 
			
		||||
__asm__ volatile ("int $0x80" \
 | 
			
		||||
	: "=a" (__res) \
 | 
			
		||||
	: "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2)), \
 | 
			
		||||
		  "d" ((long)(arg3))); \
 | 
			
		||||
if (__res>=0) \
 | 
			
		||||
	return (type) __res; \
 | 
			
		||||
errno=-__res; \
 | 
			
		||||
return -1; \
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
 | 
			
		||||
type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
 | 
			
		||||
{ \
 | 
			
		||||
long __res; \
 | 
			
		||||
__asm__ volatile ("int $0x80" \
 | 
			
		||||
	: "=a" (__res) \
 | 
			
		||||
	: "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2)), \
 | 
			
		||||
	  "d" ((long)(arg3)),"S" ((long)(arg4))); \
 | 
			
		||||
if (__res>=0) \
 | 
			
		||||
	return (type) __res; \
 | 
			
		||||
errno=-__res; \
 | 
			
		||||
return -1; \
 | 
			
		||||
} 
 | 
			
		||||
 | 
			
		||||
#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
 | 
			
		||||
	  type5,arg5) \
 | 
			
		||||
type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
 | 
			
		||||
{ \
 | 
			
		||||
long __res; \
 | 
			
		||||
__asm__ volatile ("int $0x80" \
 | 
			
		||||
	: "=a" (__res) \
 | 
			
		||||
	: "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2)), \
 | 
			
		||||
	  "d" ((long)(arg3)),"S" ((long)(arg4)),"D" ((long)(arg5))); \
 | 
			
		||||
if (__res>=0) \
 | 
			
		||||
	return (type) __res; \
 | 
			
		||||
errno=-__res; \
 | 
			
		||||
return -1; \
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#ifdef __KERNEL_SYSCALLS__
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * we need this inline - forking from kernel space will result
 | 
			
		||||
 * in NO COPY ON WRITE (!!!), until an execve is executed. This
 | 
			
		||||
 * is no problem, but for the stack. This is handled by not letting
 | 
			
		||||
 * main() use the stack at all after fork(). Thus, no function
 | 
			
		||||
 * calls - which means inline code for fork too, as otherwise we
 | 
			
		||||
 * would use the stack upon exit from 'fork()'.
 | 
			
		||||
 *
 | 
			
		||||
 * Actually only pause and fork are needed inline, so that there
 | 
			
		||||
 * won't be any messing with the stack from main(), but we define
 | 
			
		||||
 * some others too.
 | 
			
		||||
 */
 | 
			
		||||
#define __NR__exit __NR_exit
 | 
			
		||||
static inline _syscall0(int,idle)
 | 
			
		||||
static inline _syscall0(int,fork)
 | 
			
		||||
static inline _syscall2(int,clone,unsigned long,flags,char *,esp)
 | 
			
		||||
static inline _syscall0(int,pause)
 | 
			
		||||
static inline _syscall0(int,setup)
 | 
			
		||||
static inline _syscall0(int,sync)
 | 
			
		||||
static inline _syscall0(pid_t,setsid)
 | 
			
		||||
static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count)
 | 
			
		||||
static inline _syscall1(int,dup,int,fd)
 | 
			
		||||
static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
 | 
			
		||||
static inline _syscall3(int,open,const char *,file,int,flag,int,mode)
 | 
			
		||||
static inline _syscall1(int,close,int,fd)
 | 
			
		||||
static inline _syscall1(int,_exit,int,exitcode)
 | 
			
		||||
static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
 | 
			
		||||
 | 
			
		||||
static inline pid_t wait(int * wait_stat)
 | 
			
		||||
{
 | 
			
		||||
	return waitpid(-1,wait_stat,0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * This is the mechanism for creating a new kernel thread.
 | 
			
		||||
 *
 | 
			
		||||
 * NOTE! Only a kernel-only process(ie the swapper or direct descendants
 | 
			
		||||
 * who haven't done an "execve()") should use this: it will work within
 | 
			
		||||
 * a system call from a "real" process, but the process memory space will
 | 
			
		||||
 * not be free'd until both the parent and the child have exited.
 | 
			
		||||
 */
 | 
			
		||||
static inline pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
 | 
			
		||||
{
 | 
			
		||||
	long retval;
 | 
			
		||||
 | 
			
		||||
	__asm__ __volatile__(
 | 
			
		||||
		"movl %%esp,%%esi\n\t"
 | 
			
		||||
		"int $0x80\n\t"		/* Linux/i386 system call */
 | 
			
		||||
		"cmpl %%esp,%%esi\n\t"	/* child or parent? */
 | 
			
		||||
		"je 1f\n\t"		/* parent - jump */
 | 
			
		||||
		"pushl %3\n\t"		/* push argument */
 | 
			
		||||
		"call *%4\n\t"		/* call fn */
 | 
			
		||||
		"movl %2,%0\n\t"	/* exit */
 | 
			
		||||
		"int $0x80\n"
 | 
			
		||||
		"1:\t"
 | 
			
		||||
		:"=a" (retval)
 | 
			
		||||
		:"0" (__NR_clone), "i" (__NR_exit),
 | 
			
		||||
		 "r" (arg), "r" (fn),
 | 
			
		||||
		 "b" (flags | CLONE_VM)
 | 
			
		||||
		:"si");
 | 
			
		||||
	return retval;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* _ASM_I386_UNISTD_H_ */
 | 
			
		||||
							
								
								
									
										1
									
								
								kernel/table20/version.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								kernel/table20/version.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
#define _TABLE_VERSION	1
 | 
			
		||||
							
								
								
									
										4
									
								
								kernel/table21/.cvsignore
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								kernel/table21/.cvsignore
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
			
		||||
kernel.patch
 | 
			
		||||
.main.o.flags
 | 
			
		||||
.table.o.flags
 | 
			
		||||
.module.o.flags
 | 
			
		||||
							
								
								
									
										16
									
								
								kernel/table21/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								kernel/table21/Makefile
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,16 @@
 | 
			
		||||
#
 | 
			
		||||
# Makefile for the linux system information tables.
 | 
			
		||||
#
 | 
			
		||||
# Note! Dependencies are done automagically by 'make dep', which also
 | 
			
		||||
# removes any old dependencies. DON'T put your own dependencies here
 | 
			
		||||
# unless it's something special (ie not a .c file).
 | 
			
		||||
#
 | 
			
		||||
# Note 2! The CFLAGS definition is now in the main makefile...
 | 
			
		||||
 | 
			
		||||
O_TARGET := table.o
 | 
			
		||||
OX_OBJS  := main.o
 | 
			
		||||
 | 
			
		||||
M_TARGET := table_mod.o
 | 
			
		||||
MX_OBJS  := module.o
 | 
			
		||||
 | 
			
		||||
include $(TOPDIR)/Rules.make
 | 
			
		||||
							
								
								
									
										21
									
								
								kernel/table21/README
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								kernel/table21/README
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,21 @@
 | 
			
		||||
This is a new system call `table ()' for the Linux table. It is faster
 | 
			
		||||
than reading from /proc and can be used to fetch all information required
 | 
			
		||||
for libgtop until whe have some other function (extended sysctl, ...) in
 | 
			
		||||
standard kernels.
 | 
			
		||||
 | 
			
		||||
I didn't want to change sysctl or some other function myself cause this may
 | 
			
		||||
cause other applications relying upon those function to fail. This is
 | 
			
		||||
something for the ``real'' kernel gurus ...
 | 
			
		||||
 | 
			
		||||
To use this new system call for libgtop, do the following:
 | 
			
		||||
 | 
			
		||||
* Copy this directory to /usr/src/linux/table
 | 
			
		||||
* Make /usr/src/linux/include/linux/table.h symlink to /usr/src/linux/table/table.h
 | 
			
		||||
* Apply the patch `kernel.patch' to the kernel, compile, install and reboot
 | 
			
		||||
* Recompile libgtop (remove `config.cache' and run the `autogen.sh' again).
 | 
			
		||||
 | 
			
		||||
If you want to change and/or add something - feel free to do so !
 | 
			
		||||
 | 
			
		||||
Have fun,
 | 
			
		||||
 | 
			
		||||
Martin
 | 
			
		||||
							
								
								
									
										571
									
								
								kernel/table21/entry-i386.S
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										571
									
								
								kernel/table21/entry-i386.S
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,571 @@
 | 
			
		||||
/*
 | 
			
		||||
 *  linux/arch/i386/entry.S
 | 
			
		||||
 *
 | 
			
		||||
 *  Copyright (C) 1991, 1992  Linus Torvalds
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * entry.S contains the system-call and fault low-level handling routines.
 | 
			
		||||
 * This also contains the timer-interrupt handler, as well as all interrupts
 | 
			
		||||
 * and faults that can result in a task-switch.
 | 
			
		||||
 *
 | 
			
		||||
 * NOTE: This code handles signal-recognition, which happens every time
 | 
			
		||||
 * after a timer-interrupt and after each system call.
 | 
			
		||||
 *
 | 
			
		||||
 * I changed all the .align's to 4 (16 byte alignment), as that's faster
 | 
			
		||||
 * on a 486.
 | 
			
		||||
 *
 | 
			
		||||
 * Stack layout in 'ret_from_system_call':
 | 
			
		||||
 * 	ptrace needs to have all regs on the stack.
 | 
			
		||||
 *	if the order here is changed, it needs to be
 | 
			
		||||
 *	updated in fork.c:copy_process, signal.c:do_signal,
 | 
			
		||||
 *	ptrace.c and ptrace.h
 | 
			
		||||
 *
 | 
			
		||||
 *	 0(%esp) - %ebx
 | 
			
		||||
 *	 4(%esp) - %ecx
 | 
			
		||||
 *	 8(%esp) - %edx
 | 
			
		||||
 *       C(%esp) - %esi
 | 
			
		||||
 *	10(%esp) - %edi
 | 
			
		||||
 *	14(%esp) - %ebp
 | 
			
		||||
 *	18(%esp) - %eax
 | 
			
		||||
 *	1C(%esp) - %ds
 | 
			
		||||
 *	20(%esp) - %es
 | 
			
		||||
 *	24(%esp) - orig_eax
 | 
			
		||||
 *	28(%esp) - %eip
 | 
			
		||||
 *	2C(%esp) - %cs
 | 
			
		||||
 *	30(%esp) - %eflags
 | 
			
		||||
 *	34(%esp) - %oldesp
 | 
			
		||||
 *	38(%esp) - %oldss
 | 
			
		||||
 *
 | 
			
		||||
 * "current" is in register %ebx during any slow entries.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <linux/sys.h>
 | 
			
		||||
#include <linux/linkage.h>
 | 
			
		||||
#include <asm/segment.h>
 | 
			
		||||
#define ASSEMBLY
 | 
			
		||||
#include <asm/smp.h>
 | 
			
		||||
 | 
			
		||||
EBX		= 0x00
 | 
			
		||||
ECX		= 0x04
 | 
			
		||||
EDX		= 0x08
 | 
			
		||||
ESI		= 0x0C
 | 
			
		||||
EDI		= 0x10
 | 
			
		||||
EBP		= 0x14
 | 
			
		||||
EAX		= 0x18
 | 
			
		||||
DS		= 0x1C
 | 
			
		||||
ES		= 0x20
 | 
			
		||||
ORIG_EAX	= 0x24
 | 
			
		||||
EIP		= 0x28
 | 
			
		||||
CS		= 0x2C
 | 
			
		||||
EFLAGS		= 0x30
 | 
			
		||||
OLDESP		= 0x34
 | 
			
		||||
OLDSS		= 0x38
 | 
			
		||||
 | 
			
		||||
CF_MASK		= 0x00000001
 | 
			
		||||
IF_MASK		= 0x00000200
 | 
			
		||||
NT_MASK		= 0x00004000
 | 
			
		||||
VM_MASK		= 0x00020000
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * these are offsets into the task-struct.
 | 
			
		||||
 */
 | 
			
		||||
state		=  0
 | 
			
		||||
flags		=  4
 | 
			
		||||
sigpending	=  8
 | 
			
		||||
addr_limit	= 12
 | 
			
		||||
exec_domain	= 16
 | 
			
		||||
need_resched	= 20
 | 
			
		||||
 | 
			
		||||
ENOSYS = 38
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define SAVE_ALL \
 | 
			
		||||
	cld; \
 | 
			
		||||
	pushl %es; \
 | 
			
		||||
	pushl %ds; \
 | 
			
		||||
	pushl %eax; \
 | 
			
		||||
	pushl %ebp; \
 | 
			
		||||
	pushl %edi; \
 | 
			
		||||
	pushl %esi; \
 | 
			
		||||
	pushl %edx; \
 | 
			
		||||
	pushl %ecx; \
 | 
			
		||||
	pushl %ebx; \
 | 
			
		||||
	movl $(__KERNEL_DS),%edx; \
 | 
			
		||||
	movl %dx,%ds; \
 | 
			
		||||
	movl %dx,%es;
 | 
			
		||||
 | 
			
		||||
#define RESTORE_ALL	\
 | 
			
		||||
	popl %ebx;	\
 | 
			
		||||
	popl %ecx;	\
 | 
			
		||||
	popl %edx;	\
 | 
			
		||||
	popl %esi;	\
 | 
			
		||||
	popl %edi;	\
 | 
			
		||||
	popl %ebp;	\
 | 
			
		||||
	popl %eax;	\
 | 
			
		||||
1:	popl %ds;	\
 | 
			
		||||
2:	popl %es;	\
 | 
			
		||||
3:	addl $4,%esp;	\
 | 
			
		||||
	iret;		\
 | 
			
		||||
.section fixup,"ax";	\
 | 
			
		||||
4:	pushl $0;	\
 | 
			
		||||
	popl %ds;	\
 | 
			
		||||
	jmp 2b;		\
 | 
			
		||||
5:	pushl $0;	\
 | 
			
		||||
	popl %es;	\
 | 
			
		||||
	jmp 3b;		\
 | 
			
		||||
.previous;		\
 | 
			
		||||
.section __ex_table,"a";\
 | 
			
		||||
	.align 4;	\
 | 
			
		||||
	.long 1b,4b;	\
 | 
			
		||||
	.long 2b,5b;	\
 | 
			
		||||
.previous
 | 
			
		||||
 | 
			
		||||
#define GET_CURRENT(reg) \
 | 
			
		||||
	movl %esp, reg; \
 | 
			
		||||
	andl $-8192, reg;
 | 
			
		||||
 | 
			
		||||
ENTRY(lcall7)
 | 
			
		||||
	pushfl			# We get a different stack layout with call gates,
 | 
			
		||||
	pushl %eax		# which has to be cleaned up later..
 | 
			
		||||
	SAVE_ALL
 | 
			
		||||
	movl EIP(%esp),%eax	# due to call gates, this is eflags, not eip..
 | 
			
		||||
	movl CS(%esp),%edx	# this is eip..
 | 
			
		||||
	movl EFLAGS(%esp),%ecx	# and this is cs..
 | 
			
		||||
	movl %eax,EFLAGS(%esp)	#
 | 
			
		||||
	movl %edx,EIP(%esp)	# Now we move them to their "normal" places
 | 
			
		||||
	movl %ecx,CS(%esp)	#
 | 
			
		||||
	movl %esp,%ebx
 | 
			
		||||
	pushl %ebx
 | 
			
		||||
	andl $-8192,%ebx	# GET_CURRENT
 | 
			
		||||
	movl exec_domain(%ebx),%edx	# Get the execution domain
 | 
			
		||||
	movl 4(%edx),%edx	# Get the lcall7 handler for the domain
 | 
			
		||||
	call *%edx
 | 
			
		||||
	popl %eax
 | 
			
		||||
	jmp ret_from_sys_call
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifdef __SMP__
 | 
			
		||||
	ALIGN
 | 
			
		||||
	.globl	ret_from_smpfork
 | 
			
		||||
ret_from_smpfork:
 | 
			
		||||
	GET_CURRENT(%ebx)
 | 
			
		||||
	btrl	$0, SYMBOL_NAME(scheduler_lock)
 | 
			
		||||
	jmp	ret_from_sys_call
 | 
			
		||||
#endif /* __SMP__ */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Return to user mode is not as complex as all this looks,
 | 
			
		||||
 * but we want the default path for a system call return to
 | 
			
		||||
 * go as quickly as possible which is why some of this is
 | 
			
		||||
 * less clear than it otherwise should be.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
ENTRY(system_call)
 | 
			
		||||
	pushl %eax			# save orig_eax
 | 
			
		||||
	SAVE_ALL
 | 
			
		||||
	GET_CURRENT(%ebx)
 | 
			
		||||
	cmpl $(NR_syscalls),%eax
 | 
			
		||||
	jae badsys
 | 
			
		||||
	testb $0x20,flags(%ebx)		# PF_TRACESYS
 | 
			
		||||
	jne tracesys
 | 
			
		||||
	call *SYMBOL_NAME(sys_call_table)(,%eax,4)
 | 
			
		||||
	movl %eax,EAX(%esp)		# save the return value
 | 
			
		||||
	ALIGN
 | 
			
		||||
	.globl ret_from_sys_call
 | 
			
		||||
	.globl ret_from_intr
 | 
			
		||||
ret_from_sys_call:
 | 
			
		||||
	movl SYMBOL_NAME(bh_mask),%eax
 | 
			
		||||
	andl SYMBOL_NAME(bh_active),%eax
 | 
			
		||||
	jne handle_bottom_half
 | 
			
		||||
ret_with_reschedule:
 | 
			
		||||
	cmpl $0,need_resched(%ebx)
 | 
			
		||||
	jne reschedule
 | 
			
		||||
	cmpl $0,sigpending(%ebx)
 | 
			
		||||
	jne signal_return
 | 
			
		||||
	RESTORE_ALL
 | 
			
		||||
	ALIGN
 | 
			
		||||
signal_return:
 | 
			
		||||
	testl $(VM_MASK),EFLAGS(%esp)
 | 
			
		||||
	pushl %esp
 | 
			
		||||
	jne v86_signal_return
 | 
			
		||||
	pushl $0
 | 
			
		||||
	call SYMBOL_NAME(do_signal)
 | 
			
		||||
	addl $8,%esp
 | 
			
		||||
	RESTORE_ALL
 | 
			
		||||
	ALIGN
 | 
			
		||||
v86_signal_return:
 | 
			
		||||
	call SYMBOL_NAME(save_v86_state)
 | 
			
		||||
	movl %eax,%esp
 | 
			
		||||
	pushl %eax
 | 
			
		||||
	pushl $0
 | 
			
		||||
	call SYMBOL_NAME(do_signal)
 | 
			
		||||
	addl $8,%esp
 | 
			
		||||
	RESTORE_ALL
 | 
			
		||||
	ALIGN
 | 
			
		||||
tracesys:
 | 
			
		||||
	movl $-ENOSYS,EAX(%esp)
 | 
			
		||||
	call SYMBOL_NAME(syscall_trace)
 | 
			
		||||
	movl ORIG_EAX(%esp),%eax
 | 
			
		||||
	call *SYMBOL_NAME(sys_call_table)(,%eax,4)
 | 
			
		||||
	movl %eax,EAX(%esp)		# save the return value
 | 
			
		||||
	call SYMBOL_NAME(syscall_trace)
 | 
			
		||||
	jmp ret_from_sys_call
 | 
			
		||||
badsys:
 | 
			
		||||
	movl $-ENOSYS,EAX(%esp)
 | 
			
		||||
	jmp ret_from_sys_call
 | 
			
		||||
 | 
			
		||||
	ALIGN
 | 
			
		||||
ret_from_exception:
 | 
			
		||||
	movl SYMBOL_NAME(bh_mask),%eax
 | 
			
		||||
	andl SYMBOL_NAME(bh_active),%eax
 | 
			
		||||
	jne handle_bottom_half
 | 
			
		||||
	ALIGN
 | 
			
		||||
ret_from_intr:
 | 
			
		||||
	GET_CURRENT(%ebx)
 | 
			
		||||
	movl EFLAGS(%esp),%eax		# mix EFLAGS and CS
 | 
			
		||||
	movb CS(%esp),%al
 | 
			
		||||
	testl $(VM_MASK | 3),%eax	# return to VM86 mode or non-supervisor?
 | 
			
		||||
	jne ret_with_reschedule
 | 
			
		||||
	RESTORE_ALL
 | 
			
		||||
 | 
			
		||||
	ALIGN
 | 
			
		||||
handle_bottom_half:
 | 
			
		||||
	pushl $ret_from_intr
 | 
			
		||||
	jmp SYMBOL_NAME(do_bottom_half)
 | 
			
		||||
 | 
			
		||||
	ALIGN
 | 
			
		||||
reschedule:
 | 
			
		||||
	pushl $ret_from_sys_call
 | 
			
		||||
	jmp SYMBOL_NAME(schedule)    # test
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
ENTRY(divide_error)
 | 
			
		||||
	pushl $0		# no error code
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_divide_error)
 | 
			
		||||
	ALIGN
 | 
			
		||||
error_code:
 | 
			
		||||
	pushl %ds
 | 
			
		||||
	pushl %eax
 | 
			
		||||
	xorl %eax,%eax
 | 
			
		||||
	pushl %ebp
 | 
			
		||||
	pushl %edi
 | 
			
		||||
	pushl %esi
 | 
			
		||||
	pushl %edx
 | 
			
		||||
	decl %eax			# eax = -1
 | 
			
		||||
	pushl %ecx
 | 
			
		||||
	pushl %ebx
 | 
			
		||||
#if 1
 | 
			
		||||
	xorl %ecx,%ecx			# zero ecx
 | 
			
		||||
	cld
 | 
			
		||||
	mov %es,%cx			# get the lower order bits of es
 | 
			
		||||
#else
 | 
			
		||||
	cld
 | 
			
		||||
# Some older processors leave the top 16 bits of the 32 bit destination
 | 
			
		||||
# register undefined, rather than zeroed in the following instruction.
 | 
			
		||||
# This won't matter when restoring or loading a segment register from the
 | 
			
		||||
# stack.  It may be a problem if any code reads the full 32 bit value.
 | 
			
		||||
# dosemu? kernel?  Would somebody like to verify that this way is really OK?
 | 
			
		||||
	movl %es,%cx
 | 
			
		||||
#endif
 | 
			
		||||
	xchgl %eax, ORIG_EAX(%esp)	# orig_eax (get the error code. )
 | 
			
		||||
	movl %esp,%edx
 | 
			
		||||
	xchgl %ecx, ES(%esp)		# get the address and save es.
 | 
			
		||||
	pushl %eax			# push the error code
 | 
			
		||||
	pushl %edx
 | 
			
		||||
	movl $(__KERNEL_DS),%edx
 | 
			
		||||
	movl %dx,%ds
 | 
			
		||||
	movl %dx,%es
 | 
			
		||||
	GET_CURRENT(%ebx)
 | 
			
		||||
	call *%ecx
 | 
			
		||||
	addl $8,%esp
 | 
			
		||||
	jmp ret_from_exception
 | 
			
		||||
 | 
			
		||||
ENTRY(coprocessor_error)
 | 
			
		||||
	pushl $0
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_coprocessor_error)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(device_not_available)
 | 
			
		||||
	pushl $-1		# mark this as an int
 | 
			
		||||
	SAVE_ALL
 | 
			
		||||
	GET_CURRENT(%ebx)
 | 
			
		||||
	pushl $ret_from_exception
 | 
			
		||||
	movl %cr0,%eax
 | 
			
		||||
	testl $0x4,%eax			# EM (math emulation bit)
 | 
			
		||||
	je SYMBOL_NAME(math_state_restore)
 | 
			
		||||
	pushl $0		# temporary storage for ORIG_EIP
 | 
			
		||||
	call  SYMBOL_NAME(math_emulate)
 | 
			
		||||
	addl $4,%esp
 | 
			
		||||
	ret
 | 
			
		||||
 | 
			
		||||
ENTRY(debug)
 | 
			
		||||
	pushl $0
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_debug)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(nmi)
 | 
			
		||||
	pushl $0
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_nmi)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(int3)
 | 
			
		||||
	pushl $0
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_int3)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(overflow)
 | 
			
		||||
	pushl $0
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_overflow)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(bounds)
 | 
			
		||||
	pushl $0
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_bounds)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(invalid_op)
 | 
			
		||||
	pushl $0
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_invalid_op)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(coprocessor_segment_overrun)
 | 
			
		||||
	pushl $0
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_coprocessor_segment_overrun)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(reserved)
 | 
			
		||||
	pushl $0
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_reserved)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(double_fault)
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_double_fault)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(invalid_TSS)
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_invalid_TSS)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(segment_not_present)
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_segment_not_present)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(stack_segment)
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_stack_segment)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(general_protection)
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_general_protection)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(alignment_check)
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_alignment_check)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(page_fault)
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_page_fault)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
ENTRY(spurious_interrupt_bug)
 | 
			
		||||
	pushl $0
 | 
			
		||||
	pushl $ SYMBOL_NAME(do_spurious_interrupt_bug)
 | 
			
		||||
	jmp error_code
 | 
			
		||||
 | 
			
		||||
.data
 | 
			
		||||
ENTRY(sys_call_table)
 | 
			
		||||
	.long SYMBOL_NAME(sys_setup)		/* 0 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_exit)
 | 
			
		||||
	.long SYMBOL_NAME(sys_fork)
 | 
			
		||||
	.long SYMBOL_NAME(sys_read)
 | 
			
		||||
	.long SYMBOL_NAME(sys_write)
 | 
			
		||||
	.long SYMBOL_NAME(sys_open)		/* 5 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_close)
 | 
			
		||||
	.long SYMBOL_NAME(sys_waitpid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_creat)
 | 
			
		||||
	.long SYMBOL_NAME(sys_link)
 | 
			
		||||
	.long SYMBOL_NAME(sys_unlink)		/* 10 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_execve)
 | 
			
		||||
	.long SYMBOL_NAME(sys_chdir)
 | 
			
		||||
	.long SYMBOL_NAME(sys_time)
 | 
			
		||||
	.long SYMBOL_NAME(sys_mknod)
 | 
			
		||||
	.long SYMBOL_NAME(sys_chmod)		/* 15 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_lchown)
 | 
			
		||||
	.long SYMBOL_NAME(sys_ni_syscall)				/* old break syscall holder */
 | 
			
		||||
	.long SYMBOL_NAME(sys_stat)
 | 
			
		||||
	.long SYMBOL_NAME(sys_lseek)
 | 
			
		||||
	.long SYMBOL_NAME(sys_getpid)		/* 20 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_mount)
 | 
			
		||||
	.long SYMBOL_NAME(sys_umount)
 | 
			
		||||
	.long SYMBOL_NAME(sys_setuid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_getuid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_stime)		/* 25 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_ptrace)
 | 
			
		||||
	.long SYMBOL_NAME(sys_alarm)
 | 
			
		||||
	.long SYMBOL_NAME(sys_fstat)
 | 
			
		||||
	.long SYMBOL_NAME(sys_pause)
 | 
			
		||||
	.long SYMBOL_NAME(sys_utime)		/* 30 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_ni_syscall)				/* old stty syscall holder */
 | 
			
		||||
	.long SYMBOL_NAME(sys_ni_syscall)				/* old gtty syscall holder */
 | 
			
		||||
	.long SYMBOL_NAME(sys_access)
 | 
			
		||||
	.long SYMBOL_NAME(sys_nice)
 | 
			
		||||
	.long SYMBOL_NAME(sys_ni_syscall)	/* 35 */		/* old ftime syscall holder */
 | 
			
		||||
	.long SYMBOL_NAME(sys_sync)
 | 
			
		||||
	.long SYMBOL_NAME(sys_kill)
 | 
			
		||||
	.long SYMBOL_NAME(sys_rename)
 | 
			
		||||
	.long SYMBOL_NAME(sys_mkdir)
 | 
			
		||||
	.long SYMBOL_NAME(sys_rmdir)		/* 40 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_dup)
 | 
			
		||||
	.long SYMBOL_NAME(sys_pipe)
 | 
			
		||||
	.long SYMBOL_NAME(sys_times)
 | 
			
		||||
	.long SYMBOL_NAME(sys_ni_syscall)				/* old prof syscall holder */
 | 
			
		||||
	.long SYMBOL_NAME(sys_brk)		/* 45 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_setgid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_getgid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_signal)
 | 
			
		||||
	.long SYMBOL_NAME(sys_geteuid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_getegid)		/* 50 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_acct)
 | 
			
		||||
	.long SYMBOL_NAME(sys_ni_syscall)				/* old phys syscall holder */
 | 
			
		||||
	.long SYMBOL_NAME(sys_ni_syscall)				/* old lock syscall holder */
 | 
			
		||||
	.long SYMBOL_NAME(sys_ioctl)
 | 
			
		||||
	.long SYMBOL_NAME(sys_fcntl)		/* 55 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_ni_syscall)				/* old mpx syscall holder */
 | 
			
		||||
	.long SYMBOL_NAME(sys_setpgid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_ni_syscall)				/* old ulimit syscall holder */
 | 
			
		||||
	.long SYMBOL_NAME(sys_olduname)
 | 
			
		||||
	.long SYMBOL_NAME(sys_umask)		/* 60 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_chroot)
 | 
			
		||||
	.long SYMBOL_NAME(sys_ustat)
 | 
			
		||||
	.long SYMBOL_NAME(sys_dup2)
 | 
			
		||||
	.long SYMBOL_NAME(sys_getppid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_getpgrp)		/* 65 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_setsid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sigaction)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sgetmask)
 | 
			
		||||
	.long SYMBOL_NAME(sys_ssetmask)
 | 
			
		||||
	.long SYMBOL_NAME(sys_setreuid)		/* 70 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_setregid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sigsuspend)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sigpending)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sethostname)
 | 
			
		||||
	.long SYMBOL_NAME(sys_setrlimit)	/* 75 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_getrlimit)
 | 
			
		||||
	.long SYMBOL_NAME(sys_getrusage)
 | 
			
		||||
	.long SYMBOL_NAME(sys_gettimeofday)
 | 
			
		||||
	.long SYMBOL_NAME(sys_settimeofday)
 | 
			
		||||
	.long SYMBOL_NAME(sys_getgroups)	/* 80 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_setgroups)
 | 
			
		||||
	.long SYMBOL_NAME(old_select)
 | 
			
		||||
	.long SYMBOL_NAME(sys_symlink)
 | 
			
		||||
	.long SYMBOL_NAME(sys_lstat)
 | 
			
		||||
	.long SYMBOL_NAME(sys_readlink)		/* 85 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_uselib)
 | 
			
		||||
	.long SYMBOL_NAME(sys_swapon)
 | 
			
		||||
	.long SYMBOL_NAME(sys_reboot)
 | 
			
		||||
	.long SYMBOL_NAME(old_readdir)
 | 
			
		||||
	.long SYMBOL_NAME(old_mmap)		/* 90 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_munmap)
 | 
			
		||||
	.long SYMBOL_NAME(sys_truncate)
 | 
			
		||||
	.long SYMBOL_NAME(sys_ftruncate)
 | 
			
		||||
	.long SYMBOL_NAME(sys_fchmod)
 | 
			
		||||
	.long SYMBOL_NAME(sys_fchown)		/* 95 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_getpriority)
 | 
			
		||||
	.long SYMBOL_NAME(sys_setpriority)
 | 
			
		||||
	.long SYMBOL_NAME(sys_ni_syscall)				/* old profil syscall holder */
 | 
			
		||||
	.long SYMBOL_NAME(sys_statfs)
 | 
			
		||||
	.long SYMBOL_NAME(sys_fstatfs)		/* 100 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_ioperm)
 | 
			
		||||
	.long SYMBOL_NAME(sys_socketcall)
 | 
			
		||||
	.long SYMBOL_NAME(sys_syslog)
 | 
			
		||||
	.long SYMBOL_NAME(sys_setitimer)
 | 
			
		||||
	.long SYMBOL_NAME(sys_getitimer)	/* 105 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_newstat)
 | 
			
		||||
	.long SYMBOL_NAME(sys_newlstat)
 | 
			
		||||
	.long SYMBOL_NAME(sys_newfstat)
 | 
			
		||||
	.long SYMBOL_NAME(sys_uname)
 | 
			
		||||
	.long SYMBOL_NAME(sys_iopl)		/* 110 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_vhangup)
 | 
			
		||||
	.long SYMBOL_NAME(sys_idle)
 | 
			
		||||
	.long SYMBOL_NAME(sys_vm86old)
 | 
			
		||||
	.long SYMBOL_NAME(sys_wait4)
 | 
			
		||||
	.long SYMBOL_NAME(sys_swapoff)		/* 115 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_sysinfo)
 | 
			
		||||
	.long SYMBOL_NAME(sys_ipc)
 | 
			
		||||
	.long SYMBOL_NAME(sys_fsync)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sigreturn)
 | 
			
		||||
	.long SYMBOL_NAME(sys_clone)		/* 120 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_setdomainname)
 | 
			
		||||
	.long SYMBOL_NAME(sys_newuname)
 | 
			
		||||
	.long SYMBOL_NAME(sys_modify_ldt)
 | 
			
		||||
	.long SYMBOL_NAME(sys_adjtimex)
 | 
			
		||||
	.long SYMBOL_NAME(sys_mprotect)		/* 125 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_sigprocmask)
 | 
			
		||||
	.long SYMBOL_NAME(sys_create_module)
 | 
			
		||||
	.long SYMBOL_NAME(sys_init_module)
 | 
			
		||||
	.long SYMBOL_NAME(sys_delete_module)
 | 
			
		||||
	.long SYMBOL_NAME(sys_get_kernel_syms)	/* 130 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_quotactl)
 | 
			
		||||
	.long SYMBOL_NAME(sys_getpgid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_fchdir)
 | 
			
		||||
	.long SYMBOL_NAME(sys_bdflush)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sysfs)		/* 135 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_personality)
 | 
			
		||||
	.long SYMBOL_NAME(sys_ni_syscall)	/* for afs_syscall */
 | 
			
		||||
	.long SYMBOL_NAME(sys_setfsuid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_setfsgid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_llseek)		/* 140 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_getdents)
 | 
			
		||||
	.long SYMBOL_NAME(sys_select)
 | 
			
		||||
	.long SYMBOL_NAME(sys_flock)
 | 
			
		||||
	.long SYMBOL_NAME(sys_msync)
 | 
			
		||||
	.long SYMBOL_NAME(sys_readv)		/* 145 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_writev)
 | 
			
		||||
	.long SYMBOL_NAME(sys_getsid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_fdatasync)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sysctl)
 | 
			
		||||
	.long SYMBOL_NAME(sys_mlock)		/* 150 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_munlock)
 | 
			
		||||
	.long SYMBOL_NAME(sys_mlockall)
 | 
			
		||||
	.long SYMBOL_NAME(sys_munlockall)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sched_setparam)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sched_getparam)   /* 155 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_sched_setscheduler)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sched_getscheduler)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sched_yield)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sched_get_priority_max)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sched_get_priority_min)  /* 160 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_sched_rr_get_interval)
 | 
			
		||||
	.long SYMBOL_NAME(sys_nanosleep)
 | 
			
		||||
	.long SYMBOL_NAME(sys_mremap)
 | 
			
		||||
	.long SYMBOL_NAME(sys_setresuid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_getresuid)	/* 165 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_vm86)
 | 
			
		||||
	.long SYMBOL_NAME(sys_query_module)
 | 
			
		||||
	.long SYMBOL_NAME(sys_poll)
 | 
			
		||||
	.long SYMBOL_NAME(sys_nfsservctl)
 | 
			
		||||
	.long SYMBOL_NAME(sys_setresgid)	/* 170 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_getresgid)
 | 
			
		||||
	.long SYMBOL_NAME(sys_prctl)
 | 
			
		||||
	.long SYMBOL_NAME(sys_rt_sigreturn)
 | 
			
		||||
	.long SYMBOL_NAME(sys_rt_sigaction)
 | 
			
		||||
	.long SYMBOL_NAME(sys_rt_sigprocmask)	/* 175 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_rt_sigpending)
 | 
			
		||||
	.long SYMBOL_NAME(sys_rt_sigtimedwait)
 | 
			
		||||
	.long SYMBOL_NAME(sys_rt_sigqueueinfo)
 | 
			
		||||
	.long SYMBOL_NAME(sys_rt_sigsuspend)
 | 
			
		||||
	.long SYMBOL_NAME(sys_pread)		/* 180 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_pwrite)
 | 
			
		||||
	.long SYMBOL_NAME(sys_chown)
 | 
			
		||||
	.long SYMBOL_NAME(sys_getcwd)
 | 
			
		||||
	.long SYMBOL_NAME(sys_capget)
 | 
			
		||||
	.long SYMBOL_NAME(sys_capset)           /* 185 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_sigaltstack)
 | 
			
		||||
	.long SYMBOL_NAME(sys_sendfile)
 | 
			
		||||
	.long SYMBOL_NAME(sys_ni_syscall)		/* streams1 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_ni_syscall)		/* streams2 */
 | 
			
		||||
	.long SYMBOL_NAME(sys_table)		/* 190 */
 | 
			
		||||
	
 | 
			
		||||
	.rept NR_syscalls-190
 | 
			
		||||
		.long SYMBOL_NAME(sys_ni_syscall)
 | 
			
		||||
	.endr
 | 
			
		||||
							
								
								
									
										61
									
								
								kernel/table21/main.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										61
									
								
								kernel/table21/main.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,61 @@
 | 
			
		||||
/*
 | 
			
		||||
 * linux/table/table_impl.c
 | 
			
		||||
 * Copyright (C) 1998 Martin Baulig
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <linux/types.h>
 | 
			
		||||
#include <linux/errno.h>
 | 
			
		||||
#include <linux/sched.h>
 | 
			
		||||
#include <linux/kernel.h>
 | 
			
		||||
#include <linux/kernel_stat.h>
 | 
			
		||||
#include <linux/tty.h>
 | 
			
		||||
#include <linux/user.h>
 | 
			
		||||
#include <linux/a.out.h>
 | 
			
		||||
#include <linux/string.h>
 | 
			
		||||
#include <linux/mman.h>
 | 
			
		||||
#include <linux/proc_fs.h>
 | 
			
		||||
#include <linux/ioport.h>
 | 
			
		||||
#include <linux/config.h>
 | 
			
		||||
#include <linux/mm.h>
 | 
			
		||||
#include <linux/pagemap.h>
 | 
			
		||||
#include <linux/swap.h>
 | 
			
		||||
#include <linux/slab.h>
 | 
			
		||||
#include <linux/smp.h>
 | 
			
		||||
#include <linux/signal.h>
 | 
			
		||||
 | 
			
		||||
#include <asm/uaccess.h>
 | 
			
		||||
#include <asm/pgtable.h>
 | 
			
		||||
#include <asm/io.h>
 | 
			
		||||
 | 
			
		||||
#include <linux/module.h>
 | 
			
		||||
#include <linux/table.h>
 | 
			
		||||
 | 
			
		||||
#include "version.h"
 | 
			
		||||
 | 
			
		||||
extern void scheduling_functions_start_here(void);
 | 
			
		||||
extern void scheduling_functions_end_here(void);
 | 
			
		||||
 | 
			
		||||
int (*table_function_ptr) (int, union table *, const void *) = 0;
 | 
			
		||||
 | 
			
		||||
EXPORT_SYMBOL(table_function_ptr);
 | 
			
		||||
 | 
			
		||||
EXPORT_SYMBOL(nr_running);
 | 
			
		||||
EXPORT_SYMBOL(pidhash);
 | 
			
		||||
EXPORT_SYMBOL(task);
 | 
			
		||||
EXPORT_SYMBOL(si_swapinfo);
 | 
			
		||||
EXPORT_SYMBOL(scheduling_functions_start_here);
 | 
			
		||||
EXPORT_SYMBOL(scheduling_functions_end_here);
 | 
			
		||||
EXPORT_SYMBOL(avenrun);
 | 
			
		||||
EXPORT_SYMBOL(nr_tasks);
 | 
			
		||||
EXPORT_SYMBOL(last_pid);
 | 
			
		||||
EXPORT_SYMBOL(page_cache_size);
 | 
			
		||||
EXPORT_SYMBOL(init_mm);
 | 
			
		||||
 | 
			
		||||
asmlinkage int
 | 
			
		||||
sys_table (int type, union table *buf, const void *param)
 | 
			
		||||
{
 | 
			
		||||
	if (table_function_ptr == 0)
 | 
			
		||||
		return -ENOSYS;
 | 
			
		||||
 | 
			
		||||
	return (*table_function_ptr) (type, buf, param);
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										607
									
								
								kernel/table21/module.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										607
									
								
								kernel/table21/module.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,607 @@
 | 
			
		||||
/*
 | 
			
		||||
 * linux/table/table_impl.c
 | 
			
		||||
 * Copyright (C) 1998 Martin Baulig
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <linux/types.h>
 | 
			
		||||
#include <linux/errno.h>
 | 
			
		||||
#include <linux/sched.h>
 | 
			
		||||
#include <linux/kernel.h>
 | 
			
		||||
#include <linux/kernel_stat.h>
 | 
			
		||||
#include <linux/tty.h>
 | 
			
		||||
#include <linux/user.h>
 | 
			
		||||
#include <linux/a.out.h>
 | 
			
		||||
#include <linux/string.h>
 | 
			
		||||
#include <linux/mman.h>
 | 
			
		||||
#include <linux/proc_fs.h>
 | 
			
		||||
#include <linux/ioport.h>
 | 
			
		||||
#include <linux/config.h>
 | 
			
		||||
#include <linux/mm.h>
 | 
			
		||||
#include <linux/pagemap.h>
 | 
			
		||||
#include <linux/swap.h>
 | 
			
		||||
#include <linux/slab.h>
 | 
			
		||||
#include <linux/smp.h>
 | 
			
		||||
#include <linux/signal.h>
 | 
			
		||||
 | 
			
		||||
#include <asm/uaccess.h>
 | 
			
		||||
#include <asm/pgtable.h>
 | 
			
		||||
#include <asm/io.h>
 | 
			
		||||
 | 
			
		||||
#include <linux/module.h>
 | 
			
		||||
#include <linux/table.h>
 | 
			
		||||
 | 
			
		||||
#include "version.h"
 | 
			
		||||
 | 
			
		||||
extern int (*table_function_ptr) (int, union table *, const void *);
 | 
			
		||||
 | 
			
		||||
int table_fkt (int, union table *, const void *);
 | 
			
		||||
 | 
			
		||||
EXPORT_NO_SYMBOLS;
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
init_module(void)
 | 
			
		||||
{
 | 
			
		||||
	printk ("init_module () = %p - %d, %d\n",
 | 
			
		||||
		table_fkt, sizeof (union table), sizeof (sigset_t));
 | 
			
		||||
	table_function_ptr = table_fkt;
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
cleanup_module(void)
 | 
			
		||||
{
 | 
			
		||||
	table_function_ptr = 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define LOAD_INT(x) ((x) >> FSHIFT)
 | 
			
		||||
#define LOAD_FRAC(x) LOAD_INT(((x) & (FIXED_1-1)) * 100)
 | 
			
		||||
 | 
			
		||||
#ifdef CONFIG_DEBUG_MALLOC
 | 
			
		||||
int get_malloc(char * buffer);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
static void collect_sigign_sigcatch(struct task_struct *p, sigset_t *ign,
 | 
			
		||||
				    sigset_t *catch)
 | 
			
		||||
{
 | 
			
		||||
	struct k_sigaction *k;
 | 
			
		||||
	int i;
 | 
			
		||||
 | 
			
		||||
	sigemptyset(ign);
 | 
			
		||||
	sigemptyset(catch);
 | 
			
		||||
 | 
			
		||||
#if 0
 | 
			
		||||
	printk ("collect_sigign_sigcatch: %p - %p\n",
 | 
			
		||||
		p, p->sig);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	if (p->sig) {
 | 
			
		||||
		k = p->sig->action;
 | 
			
		||||
		for (i = 1; i <= _NSIG; ++i, ++k) {
 | 
			
		||||
#if 0
 | 
			
		||||
			printk ("signal: %d - %p (%p, %p)\n",
 | 
			
		||||
				i, k->sa.sa_handler, SIG_IGN, SIG_DFL);
 | 
			
		||||
#endif
 | 
			
		||||
			if (k->sa.sa_handler == SIG_IGN)
 | 
			
		||||
				sigaddset(ign, i);
 | 
			
		||||
			else if (k->sa.sa_handler != SIG_DFL)
 | 
			
		||||
				sigaddset(catch, i);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * These bracket the sleeping functions..
 | 
			
		||||
 */
 | 
			
		||||
extern void scheduling_functions_start_here(void);
 | 
			
		||||
extern void scheduling_functions_end_here(void);
 | 
			
		||||
#define first_sched	((unsigned long) scheduling_functions_start_here)
 | 
			
		||||
#define last_sched	((unsigned long) scheduling_functions_end_here)
 | 
			
		||||
 | 
			
		||||
static unsigned long get_wchan(struct task_struct *p)
 | 
			
		||||
{
 | 
			
		||||
	if (!p || p == current || p->state == TASK_RUNNING)
 | 
			
		||||
		return 0;
 | 
			
		||||
#if defined(__i386__)
 | 
			
		||||
	{
 | 
			
		||||
		unsigned long ebp, eip;
 | 
			
		||||
		unsigned long stack_page;
 | 
			
		||||
		int count = 0;
 | 
			
		||||
 | 
			
		||||
		stack_page = 4096 + (unsigned long)p;
 | 
			
		||||
		if (!stack_page)
 | 
			
		||||
			return 0;
 | 
			
		||||
		ebp = p->tss.ebp;
 | 
			
		||||
		do {
 | 
			
		||||
			if (ebp < stack_page || ebp >= 4092+stack_page)
 | 
			
		||||
				return 0;
 | 
			
		||||
			eip = *(unsigned long *) (ebp+4);
 | 
			
		||||
			if (eip < first_sched || eip >= last_sched)
 | 
			
		||||
				return eip;
 | 
			
		||||
			ebp = *(unsigned long *) ebp;
 | 
			
		||||
		} while (count++ < 16);
 | 
			
		||||
	}
 | 
			
		||||
#elif defined(__alpha__)
 | 
			
		||||
	/*
 | 
			
		||||
	 * This one depends on the frame size of schedule().  Do a
 | 
			
		||||
	 * "disass schedule" in gdb to find the frame size.  Also, the
 | 
			
		||||
	 * code assumes that sleep_on() follows immediately after
 | 
			
		||||
	 * interruptible_sleep_on() and that add_timer() follows
 | 
			
		||||
	 * immediately after interruptible_sleep().  Ugly, isn't it?
 | 
			
		||||
	 * Maybe adding a wchan field to task_struct would be better,
 | 
			
		||||
	 * after all...
 | 
			
		||||
	 */
 | 
			
		||||
	{
 | 
			
		||||
	    unsigned long schedule_frame;
 | 
			
		||||
	    unsigned long pc;
 | 
			
		||||
 | 
			
		||||
	    pc = thread_saved_pc(&p->tss);
 | 
			
		||||
	    if (pc >= first_sched && pc < last_sched) {
 | 
			
		||||
		schedule_frame = ((unsigned long *)p->tss.ksp)[6];
 | 
			
		||||
		return ((unsigned long *)schedule_frame)[12];
 | 
			
		||||
	    }
 | 
			
		||||
	    return pc;
 | 
			
		||||
	}	
 | 
			
		||||
#elif defined(__mc68000__)
 | 
			
		||||
	{
 | 
			
		||||
	    unsigned long fp, pc;
 | 
			
		||||
	    unsigned long stack_page;
 | 
			
		||||
	    int count = 0;
 | 
			
		||||
	    extern int sys_pause (void);
 | 
			
		||||
 | 
			
		||||
	    stack_page = p->kernel_stack_page;
 | 
			
		||||
	    if (!stack_page)
 | 
			
		||||
		    return 0;
 | 
			
		||||
	    fp = ((struct switch_stack *)p->tss.ksp)->a6;
 | 
			
		||||
	    do {
 | 
			
		||||
		    if (fp < stack_page || fp >= 4088+stack_page)
 | 
			
		||||
			    return 0;
 | 
			
		||||
		    pc = ((unsigned long *)fp)[1];
 | 
			
		||||
		/* FIXME: This depends on the order of these functions. */
 | 
			
		||||
		    if (pc < first_sched || pc >= last_sched)
 | 
			
		||||
		      return pc;
 | 
			
		||||
		    fp = *(unsigned long *) fp;
 | 
			
		||||
	    } while (count++ < 16);
 | 
			
		||||
	}
 | 
			
		||||
#elif defined(__powerpc__)
 | 
			
		||||
	return (p->tss.wchan);
 | 
			
		||||
#elif defined (CONFIG_ARM)
 | 
			
		||||
	{
 | 
			
		||||
		unsigned long fp, lr;
 | 
			
		||||
		unsigned long stack_page;
 | 
			
		||||
		int count = 0;
 | 
			
		||||
 | 
			
		||||
		stack_page = 4096 + (unsigned long)p;
 | 
			
		||||
		fp = get_css_fp (&p->tss);
 | 
			
		||||
		do {
 | 
			
		||||
			if (fp < stack_page || fp > 4092+stack_page)
 | 
			
		||||
				return 0;
 | 
			
		||||
			lr = pc_pointer (((unsigned long *)fp)[-1]);
 | 
			
		||||
			if (lr < first_sched || lr > last_sched)
 | 
			
		||||
				return lr;
 | 
			
		||||
			fp = *(unsigned long *) (fp - 12);
 | 
			
		||||
		} while (count ++ < 16);
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if defined(__i386__)
 | 
			
		||||
# define KSTK_EIP(tsk)	(((unsigned long *)(4096+(unsigned long)(tsk)))[1019])
 | 
			
		||||
# define KSTK_ESP(tsk)	(((unsigned long *)(4096+(unsigned long)(tsk)))[1022])
 | 
			
		||||
#elif defined(__alpha__)
 | 
			
		||||
  /*
 | 
			
		||||
   * See arch/alpha/kernel/ptrace.c for details.
 | 
			
		||||
   */
 | 
			
		||||
# define PT_REG(reg)		(PAGE_SIZE - sizeof(struct pt_regs)	\
 | 
			
		||||
				 + (long)&((struct pt_regs *)0)->reg)
 | 
			
		||||
# define KSTK_EIP(tsk) \
 | 
			
		||||
    (*(unsigned long *)(PT_REG(pc) + PAGE_SIZE + (unsigned long)(tsk)))
 | 
			
		||||
# define KSTK_ESP(tsk)	((tsk) == current ? rdusp() : (tsk)->tss.usp)
 | 
			
		||||
#elif defined(CONFIG_ARM)
 | 
			
		||||
# define KSTK_EIP(tsk)	(((unsigned long *)(4096+(unsigned long)(tsk)))[1022])
 | 
			
		||||
# define KSTK_ESP(tsk)	(((unsigned long *)(4096+(unsigned long)(tsk)))[1020])
 | 
			
		||||
#elif defined(__mc68000__)
 | 
			
		||||
#define	KSTK_EIP(tsk)	\
 | 
			
		||||
    ({			\
 | 
			
		||||
	unsigned long eip = 0;	 \
 | 
			
		||||
 	if ((tsk)->tss.esp0 > PAGE_SIZE && \
 | 
			
		||||
	    MAP_NR((tsk)->tss.esp0) < max_mapnr) \
 | 
			
		||||
	      eip = ((struct pt_regs *) (tsk)->tss.esp0)->pc;	 \
 | 
			
		||||
        eip; })
 | 
			
		||||
#define	KSTK_ESP(tsk)	((tsk) == current ? rdusp() : (tsk)->tss.usp)
 | 
			
		||||
#elif defined(__powerpc__)
 | 
			
		||||
#define KSTK_EIP(tsk)	((tsk)->tss.regs->nip)
 | 
			
		||||
#define KSTK_ESP(tsk)	((tsk)->tss.regs->gpr[1])
 | 
			
		||||
#elif defined (__sparc_v9__)
 | 
			
		||||
# define KSTK_EIP(tsk)  ((tsk)->tss.kregs->tpc)
 | 
			
		||||
# define KSTK_ESP(tsk)  ((tsk)->tss.kregs->u_regs[UREG_FP])
 | 
			
		||||
#elif defined(__sparc__)
 | 
			
		||||
# define KSTK_EIP(tsk)  ((tsk)->tss.kregs->pc)
 | 
			
		||||
# define KSTK_ESP(tsk)  ((tsk)->tss.kregs->u_regs[UREG_FP])
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Gcc optimizes away "strlen(x)" for constant x */
 | 
			
		||||
#define ADDBUF(buffer, string) \
 | 
			
		||||
do { memcpy(buffer, string, strlen(string)); \
 | 
			
		||||
     buffer += strlen(string); } while (0)
 | 
			
		||||
 | 
			
		||||
static inline void statm_pte_range(pmd_t * pmd, unsigned long address, unsigned long size,
 | 
			
		||||
	int * pages, int * shared, int * dirty, int * total)
 | 
			
		||||
{
 | 
			
		||||
	pte_t * pte;
 | 
			
		||||
	unsigned long end;
 | 
			
		||||
 | 
			
		||||
	if (pmd_none(*pmd))
 | 
			
		||||
		return;
 | 
			
		||||
	if (pmd_bad(*pmd)) {
 | 
			
		||||
		printk("statm_pte_range: bad pmd (%08lx)\n", pmd_val(*pmd));
 | 
			
		||||
		pmd_clear(pmd);
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	pte = pte_offset(pmd, address);
 | 
			
		||||
	address &= ~PMD_MASK;
 | 
			
		||||
	end = address + size;
 | 
			
		||||
	if (end > PMD_SIZE)
 | 
			
		||||
		end = PMD_SIZE;
 | 
			
		||||
	do {
 | 
			
		||||
		pte_t page = *pte;
 | 
			
		||||
 | 
			
		||||
		address += PAGE_SIZE;
 | 
			
		||||
		pte++;
 | 
			
		||||
		if (pte_none(page))
 | 
			
		||||
			continue;
 | 
			
		||||
		++*total;
 | 
			
		||||
		if (!pte_present(page))
 | 
			
		||||
			continue;
 | 
			
		||||
		++*pages;
 | 
			
		||||
		if (pte_dirty(page))
 | 
			
		||||
			++*dirty;
 | 
			
		||||
		if (MAP_NR(pte_page(page)) >= max_mapnr)
 | 
			
		||||
			continue;
 | 
			
		||||
		if (atomic_read(&mem_map[MAP_NR(pte_page(page))].count) > 1)
 | 
			
		||||
			++*shared;
 | 
			
		||||
	} while (address < end);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static inline void statm_pmd_range(pgd_t * pgd, unsigned long address, unsigned long size,
 | 
			
		||||
	int * pages, int * shared, int * dirty, int * total)
 | 
			
		||||
{
 | 
			
		||||
	pmd_t * pmd;
 | 
			
		||||
	unsigned long end;
 | 
			
		||||
 | 
			
		||||
	if (pgd_none(*pgd))
 | 
			
		||||
		return;
 | 
			
		||||
	if (pgd_bad(*pgd)) {
 | 
			
		||||
		printk("statm_pmd_range: bad pgd (%08lx)\n", pgd_val(*pgd));
 | 
			
		||||
		pgd_clear(pgd);
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	pmd = pmd_offset(pgd, address);
 | 
			
		||||
	address &= ~PGDIR_MASK;
 | 
			
		||||
	end = address + size;
 | 
			
		||||
	if (end > PGDIR_SIZE)
 | 
			
		||||
		end = PGDIR_SIZE;
 | 
			
		||||
	do {
 | 
			
		||||
		statm_pte_range(pmd, address, end - address, pages, shared, dirty, total);
 | 
			
		||||
		address = (address + PMD_SIZE) & PMD_MASK;
 | 
			
		||||
		pmd++;
 | 
			
		||||
	} while (address < end);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void statm_pgd_range(pgd_t * pgd, unsigned long address, unsigned long end,
 | 
			
		||||
	int * pages, int * shared, int * dirty, int * total)
 | 
			
		||||
{
 | 
			
		||||
	while (address < end) {
 | 
			
		||||
		statm_pmd_range(pgd, address, end - address, pages, shared, dirty, total);
 | 
			
		||||
		address = (address + PGDIR_SIZE) & PGDIR_MASK;
 | 
			
		||||
		pgd++;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
table_fkt (int type, union table *buf, const void *param)
 | 
			
		||||
{
 | 
			
		||||
	union table tbl;
 | 
			
		||||
	struct sysinfo i;
 | 
			
		||||
	struct task_struct *tsk = NULL;
 | 
			
		||||
	struct proclist_args plistargs;
 | 
			
		||||
	int index, tindex, err, tty;
 | 
			
		||||
	sigset_t sigign, sigcatch;
 | 
			
		||||
	pid_t pid;
 | 
			
		||||
 | 
			
		||||
	if (type == TABLE_VERSION)
 | 
			
		||||
		return _TABLE_VERSION;
 | 
			
		||||
 | 
			
		||||
	if (!buf)
 | 
			
		||||
		return -EFAULT;
 | 
			
		||||
 | 
			
		||||
	memset (&tbl, 0, sizeof (union table));
 | 
			
		||||
 | 
			
		||||
	/* For TABLE_PROC_*, read pid and get task_struct */
 | 
			
		||||
 | 
			
		||||
	switch (type) {
 | 
			
		||||
	case TABLE_PROC_UID:
 | 
			
		||||
	case TABLE_PROC_MEM:
 | 
			
		||||
	case TABLE_PROC_SEGMENT:
 | 
			
		||||
	case TABLE_PROC_TIME:
 | 
			
		||||
	case TABLE_PROC_STATE:
 | 
			
		||||
	case TABLE_PROC_SIGNAL:
 | 
			
		||||
	case TABLE_PROC_KERNEL:
 | 
			
		||||
		err = verify_area (VERIFY_READ, param, sizeof (pid_t));
 | 
			
		||||
		if (err)
 | 
			
		||||
			return err;
 | 
			
		||||
		copy_from_user (&pid, param, sizeof (pid_t));
 | 
			
		||||
 | 
			
		||||
		read_lock (&tasklist_lock);
 | 
			
		||||
		tsk = find_task_by_pid (pid);
 | 
			
		||||
		/* FIXME!! This should be done after the last use */
 | 
			
		||||
		read_unlock(&tasklist_lock);
 | 
			
		||||
 | 
			
		||||
		if (tsk == NULL)
 | 
			
		||||
			return -ESRCH;
 | 
			
		||||
		break;
 | 
			
		||||
	case TABLE_PROCLIST:
 | 
			
		||||
		err = verify_area (VERIFY_READ, param,
 | 
			
		||||
				   sizeof (struct proclist_args));
 | 
			
		||||
		if (err)
 | 
			
		||||
			return err;
 | 
			
		||||
		copy_from_user (&plistargs, param,
 | 
			
		||||
				sizeof (struct proclist_args));
 | 
			
		||||
		break;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* Main function dispatcher */
 | 
			
		||||
 | 
			
		||||
	switch (type) {
 | 
			
		||||
	case TABLE_PROCLIST:
 | 
			
		||||
		tsk = task [0];
 | 
			
		||||
		read_lock (&tasklist_lock);
 | 
			
		||||
		for (index = tindex = 0; index < nr_tasks;
 | 
			
		||||
		     index++, tsk = tsk->next_task) {
 | 
			
		||||
			if (tsk->pid == 0) continue;
 | 
			
		||||
			switch (plistargs.which & TABLE_KERN_PROC_MASK) {
 | 
			
		||||
			case TABLE_KERN_PROC_PID:
 | 
			
		||||
				if (tsk->pid != plistargs.arg) continue;
 | 
			
		||||
				break;
 | 
			
		||||
			case TABLE_KERN_PROC_PGRP:
 | 
			
		||||
				if (tsk->pgrp != plistargs.arg) continue;
 | 
			
		||||
				break;
 | 
			
		||||
			case TABLE_KERN_PROC_SESSION:
 | 
			
		||||
				if (tsk->session != plistargs.arg) continue;
 | 
			
		||||
			case TABLE_KERN_PROC_TTY:
 | 
			
		||||
				tty = tsk->tty ?
 | 
			
		||||
					kdev_t_to_nr (tsk->tty->device) : 0;
 | 
			
		||||
				if (tty != plistargs.arg) continue;
 | 
			
		||||
				break;
 | 
			
		||||
			case TABLE_KERN_PROC_UID:
 | 
			
		||||
				if (tsk->uid != plistargs.arg) continue;
 | 
			
		||||
				break;
 | 
			
		||||
			case TABLE_KERN_PROC_RUID:
 | 
			
		||||
				if (tsk->euid != plistargs.arg) continue;
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			if ((plistargs.which & TABLE_EXCLUDE_IDLE) &&
 | 
			
		||||
			    (tsk->state != 0))
 | 
			
		||||
				continue;
 | 
			
		||||
 | 
			
		||||
			if ((plistargs.which & TABLE_EXCLUDE_NOTTY) &&
 | 
			
		||||
			    (tsk->tty == NULL))
 | 
			
		||||
				continue;
 | 
			
		||||
			
 | 
			
		||||
			tbl.proclist.pids [tindex++] = tsk->pid;
 | 
			
		||||
		}
 | 
			
		||||
		tbl.proclist.nr_running = nr_running;
 | 
			
		||||
		tbl.proclist.last_pid = last_pid;
 | 
			
		||||
		tbl.proclist.nr_tasks = tindex;
 | 
			
		||||
		read_unlock(&tasklist_lock);
 | 
			
		||||
		break;
 | 
			
		||||
	case TABLE_CPU:
 | 
			
		||||
		tbl.cpu.total = jiffies;    
 | 
			
		||||
		tbl.cpu.user  = kstat.cpu_user;
 | 
			
		||||
		tbl.cpu.nice  = kstat.cpu_nice;
 | 
			
		||||
		tbl.cpu.sys   = kstat.cpu_system;
 | 
			
		||||
		tbl.cpu.idle  = tbl.cpu.total -
 | 
			
		||||
			(tbl.cpu.user + tbl.cpu.nice + tbl.cpu.sys);
 | 
			
		||||
		tbl.cpu.frequency = HZ;
 | 
			
		||||
		break;
 | 
			
		||||
	case TABLE_MEM:
 | 
			
		||||
		si_meminfo (&i);
 | 
			
		||||
		tbl.mem.total  = i.totalram;
 | 
			
		||||
		tbl.mem.used   = i.totalram - i.freeram;
 | 
			
		||||
		tbl.mem.free   = i.freeram;
 | 
			
		||||
		tbl.mem.shared = i.sharedram;
 | 
			
		||||
		tbl.mem.buffer = i.bufferram;
 | 
			
		||||
		tbl.mem.cached = page_cache_size << PAGE_SHIFT;
 | 
			
		||||
		break;
 | 
			
		||||
	case TABLE_SWAP:
 | 
			
		||||
		si_swapinfo (&i);
 | 
			
		||||
		tbl.swap.total = i.totalswap;
 | 
			
		||||
		tbl.swap.used  = i.totalswap - i.freeswap;
 | 
			
		||||
		tbl.swap.free  = i.freeswap;
 | 
			
		||||
		break;
 | 
			
		||||
	case TABLE_LOADAVG:
 | 
			
		||||
		tbl.loadavg.loadavg [0] = (double) avenrun [0] / (1 << FSHIFT);
 | 
			
		||||
		tbl.loadavg.loadavg [1] = (double) avenrun [1] / (1 << FSHIFT);
 | 
			
		||||
		tbl.loadavg.loadavg [2] = (double) avenrun [2] / (1 << FSHIFT);
 | 
			
		||||
		tbl.loadavg.nr_running = nr_running;
 | 
			
		||||
		tbl.loadavg.nr_tasks = nr_tasks;
 | 
			
		||||
		tbl.loadavg.last_pid = last_pid;
 | 
			
		||||
		break;
 | 
			
		||||
	case TABLE_UPTIME:
 | 
			
		||||
		tbl.uptime.uptime = jiffies;
 | 
			
		||||
		tbl.uptime.idle   = task[0]->times.tms_utime +
 | 
			
		||||
			task[0]->times.tms_stime;
 | 
			
		||||
		break;
 | 
			
		||||
	case TABLE_PROC_STATE:
 | 
			
		||||
		tbl.proc_state.uid = tsk->uid;
 | 
			
		||||
		tbl.proc_state.gid = tsk->gid;
 | 
			
		||||
		tbl.proc_state.state = tsk->state;
 | 
			
		||||
		tbl.proc_state.flags = tsk->flags;
 | 
			
		||||
		memcpy (tbl.proc_state.comm, tsk->comm,
 | 
			
		||||
			sizeof (tbl.proc_state.comm));
 | 
			
		||||
		break;
 | 
			
		||||
	case TABLE_PROC_UID:
 | 
			
		||||
		tbl.proc_uid.uid = tsk->uid;
 | 
			
		||||
		tbl.proc_uid.euid = tsk->euid;
 | 
			
		||||
		tbl.proc_uid.suid = tsk->suid;
 | 
			
		||||
		tbl.proc_uid.fsuid = tsk->fsuid;
 | 
			
		||||
		
 | 
			
		||||
		tbl.proc_uid.gid = tsk->gid;
 | 
			
		||||
		tbl.proc_uid.egid = tsk->egid;
 | 
			
		||||
		tbl.proc_uid.sgid = tsk->sgid;
 | 
			
		||||
		tbl.proc_uid.fsgid = tsk->fsgid;
 | 
			
		||||
		
 | 
			
		||||
		tbl.proc_uid.pid = tsk->pid;
 | 
			
		||||
		tbl.proc_uid.pgrp = tsk->pgrp;
 | 
			
		||||
		tbl.proc_uid.ppid = tsk->p_pptr->pid;
 | 
			
		||||
		
 | 
			
		||||
		tbl.proc_uid.session = tsk->session;
 | 
			
		||||
	        tbl.proc_uid.tty = tsk->tty ?
 | 
			
		||||
			kdev_t_to_nr (tsk->tty->device) : 0;
 | 
			
		||||
		tbl.proc_uid.tpgid = tsk->tty ? tsk->tty->pgrp : -1;
 | 
			
		||||
		
 | 
			
		||||
		tbl.proc_uid.priority = tsk->priority;
 | 
			
		||||
		tbl.proc_uid.counter = tsk->counter;
 | 
			
		||||
		tbl.proc_uid.def_priority = DEF_PRIORITY;
 | 
			
		||||
		break;
 | 
			
		||||
	case TABLE_PROC_SIGNAL:
 | 
			
		||||
		memcpy (&tbl.proc_signal.signal, &tsk->signal,
 | 
			
		||||
			sizeof (tbl.proc_signal.signal));
 | 
			
		||||
 | 
			
		||||
		memcpy (&tbl.proc_signal.blocked, &tsk->blocked,
 | 
			
		||||
			sizeof (tbl.proc_signal.blocked));
 | 
			
		||||
 | 
			
		||||
		collect_sigign_sigcatch (tsk, &sigign, &sigcatch);
 | 
			
		||||
 | 
			
		||||
		memcpy (&tbl.proc_signal.ignored, &sigign,
 | 
			
		||||
			sizeof (tbl.proc_signal.ignored));
 | 
			
		||||
 | 
			
		||||
		memcpy (&tbl.proc_signal.caught, &sigcatch,
 | 
			
		||||
			sizeof (tbl.proc_signal.caught));
 | 
			
		||||
 | 
			
		||||
#if 0
 | 
			
		||||
		printk ("PROC_SIGNAL: (%lu, %lu) - (%lu, %lu)\n",
 | 
			
		||||
			tbl.proc_signal.ignored.sig [0],
 | 
			
		||||
			tbl.proc_signal.ignored.sig [1],
 | 
			
		||||
			tbl.proc_signal.caught.sig [0],
 | 
			
		||||
			tbl.proc_signal.caught.sig [1]);
 | 
			
		||||
#endif
 | 
			
		||||
		break;
 | 
			
		||||
	case TABLE_PROC_MEM:
 | 
			
		||||
		if (tsk->mm && tsk->mm != &init_mm) {
 | 
			
		||||
			tbl.proc_mem.context = tsk->mm->context;
 | 
			
		||||
			tbl.proc_mem.start_code = tsk->mm->start_code;
 | 
			
		||||
			tbl.proc_mem.end_code = tsk->mm->end_code;
 | 
			
		||||
			tbl.proc_mem.start_data = tsk->mm-> start_data;
 | 
			
		||||
			tbl.proc_mem.end_data = tsk->mm->end_data;
 | 
			
		||||
			tbl.proc_mem.start_brk = tsk->mm->start_brk;
 | 
			
		||||
			tbl.proc_mem.brk = tsk->mm->brk;
 | 
			
		||||
			tbl.proc_mem.start_stack = tsk->mm->start_stack;
 | 
			
		||||
			tbl.proc_mem.start_mmap = tsk->mm->mmap ?
 | 
			
		||||
				tsk->mm->mmap->vm_start : 0;
 | 
			
		||||
			tbl.proc_mem.arg_start = tsk->mm->arg_start;
 | 
			
		||||
			tbl.proc_mem.arg_end = tsk->mm->arg_end;
 | 
			
		||||
			tbl.proc_mem.env_start = tsk->mm->env_start;
 | 
			
		||||
			tbl.proc_mem.env_end = tsk->mm->env_end;
 | 
			
		||||
			tbl.proc_mem.rss = tsk->mm->rss << PAGE_SHIFT;
 | 
			
		||||
			tbl.proc_mem.total_vm = tsk->mm->total_vm;
 | 
			
		||||
			tbl.proc_mem.locked_vm = tsk->mm->locked_vm;
 | 
			
		||||
		}
 | 
			
		||||
		tbl.proc_mem.rlim = tsk->rlim ? tsk->rlim[RLIMIT_RSS].rlim_cur : 0;
 | 
			
		||||
		break;
 | 
			
		||||
	case TABLE_PROC_SEGMENT:
 | 
			
		||||
		if (tsk->mm && tsk->mm != &init_mm) {
 | 
			
		||||
			unsigned long vsize = 0;
 | 
			
		||||
			int size = 0, resident = 0, share = 0;
 | 
			
		||||
			int trs = 0, lrs = 0, drs = 0, srs = 0, dt = 0;
 | 
			
		||||
			struct vm_area_struct * vma = tsk->mm->mmap;
 | 
			
		||||
 | 
			
		||||
			while (vma) {
 | 
			
		||||
				pgd_t *pgd = pgd_offset(tsk->mm, vma->vm_start);
 | 
			
		||||
				int pages = 0, shared = 0, dirty = 0, total = 0;
 | 
			
		||||
				
 | 
			
		||||
				vsize += vma->vm_end - vma->vm_start;
 | 
			
		||||
 | 
			
		||||
				statm_pgd_range (pgd, vma->vm_start, vma->vm_end,
 | 
			
		||||
 | 
			
		||||
						 &pages, &shared, &dirty, &total);
 | 
			
		||||
 | 
			
		||||
				resident += pages;
 | 
			
		||||
				share += shared;
 | 
			
		||||
				dt += dirty;
 | 
			
		||||
				size += total;
 | 
			
		||||
 | 
			
		||||
				/* Well, shared library seem to get mapped
 | 
			
		||||
				 * above 0x40000000 and are executable,
 | 
			
		||||
				 * so I use this hack to get their size.
 | 
			
		||||
				 */
 | 
			
		||||
 | 
			
		||||
				if (vma->vm_flags & VM_GROWSDOWN)
 | 
			
		||||
					srs += pages;	/* stack */
 | 
			
		||||
				else if ((vma->vm_flags & VM_EXEC) &&
 | 
			
		||||
					 (vma->vm_start > 0x40000000))
 | 
			
		||||
					lrs += pages;	/* library */
 | 
			
		||||
				else if (vma->vm_flags & VM_EXECUTABLE)
 | 
			
		||||
					trs += pages;	/* text */
 | 
			
		||||
				else
 | 
			
		||||
					drs += pages;
 | 
			
		||||
 | 
			
		||||
				vma = vma->vm_next;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			tbl.proc_segment.vsize = vsize;
 | 
			
		||||
			tbl.proc_segment.size = size << PAGE_SHIFT;
 | 
			
		||||
			tbl.proc_segment.resident = resident << PAGE_SHIFT;
 | 
			
		||||
			tbl.proc_segment.shared = share << PAGE_SHIFT;
 | 
			
		||||
			tbl.proc_segment.trs = trs << PAGE_SHIFT;
 | 
			
		||||
			tbl.proc_segment.lrs = lrs << PAGE_SHIFT;
 | 
			
		||||
			tbl.proc_segment.drs = drs << PAGE_SHIFT;
 | 
			
		||||
			tbl.proc_segment.srs = srs << PAGE_SHIFT;
 | 
			
		||||
			tbl.proc_segment.dt = dt << PAGE_SHIFT;
 | 
			
		||||
		}
 | 
			
		||||
		break;
 | 
			
		||||
	case TABLE_PROC_TIME:
 | 
			
		||||
		tbl.proc_time.utime = tsk->times.tms_utime;
 | 
			
		||||
		tbl.proc_time.stime = tsk->times.tms_stime;
 | 
			
		||||
		tbl.proc_time.cutime = tsk->times.tms_cutime;
 | 
			
		||||
		tbl.proc_time.cstime = tsk->times.tms_cstime;
 | 
			
		||||
 | 
			
		||||
		tbl.proc_time.start_time = tsk->start_time;
 | 
			
		||||
		tbl.proc_time.timeout = tsk->timeout;
 | 
			
		||||
		tbl.proc_time.policy = tsk->policy;
 | 
			
		||||
		tbl.proc_time.rt_priority = tsk->rt_priority;
 | 
			
		||||
 | 
			
		||||
		tbl.proc_time.it_real_value = tsk->it_real_value;
 | 
			
		||||
		tbl.proc_time.it_prof_value = tsk->it_prof_value;
 | 
			
		||||
		tbl.proc_time.it_virt_value = tsk->it_virt_value;
 | 
			
		||||
		tbl.proc_time.it_real_incr = tsk->it_real_incr;
 | 
			
		||||
		tbl.proc_time.it_prof_incr = tsk->it_prof_incr;
 | 
			
		||||
		tbl.proc_time.it_virt_incr = tsk->it_virt_incr;
 | 
			
		||||
		break;
 | 
			
		||||
	case TABLE_PROC_KERNEL:
 | 
			
		||||
		tbl.proc_kernel.min_flt = tsk->min_flt;
 | 
			
		||||
		tbl.proc_kernel.cmin_flt = tsk->cmin_flt;
 | 
			
		||||
		tbl.proc_kernel.maj_flt = tsk->maj_flt;
 | 
			
		||||
		tbl.proc_kernel.cmaj_flt = tsk->cmaj_flt;
 | 
			
		||||
		
 | 
			
		||||
		tbl.proc_kernel.kesp = KSTK_ESP(tsk);
 | 
			
		||||
		tbl.proc_kernel.keip = KSTK_EIP(tsk);
 | 
			
		||||
		
 | 
			
		||||
		tbl.proc_kernel.nswap = tsk->nswap;
 | 
			
		||||
		tbl.proc_kernel.cnswap = tsk->cnswap;
 | 
			
		||||
 | 
			
		||||
		tbl.proc_kernel.wchan = get_wchan (tsk);
 | 
			
		||||
		break;
 | 
			
		||||
	default:
 | 
			
		||||
		return -EINVAL;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	err = verify_area (VERIFY_WRITE, buf, sizeof (struct table));
 | 
			
		||||
	if (err)
 | 
			
		||||
		return err;
 | 
			
		||||
 | 
			
		||||
	copy_to_user (buf, &tbl, sizeof (union table));
 | 
			
		||||
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										344
									
								
								kernel/table21/unistd-i386.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										344
									
								
								kernel/table21/unistd-i386.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,344 @@
 | 
			
		||||
#ifndef _ASM_I386_UNISTD_H_
 | 
			
		||||
#define _ASM_I386_UNISTD_H_
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * This file contains the system call numbers.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define __NR_setup		  0	/* used only by init, to get system going */
 | 
			
		||||
#define __NR_exit		  1
 | 
			
		||||
#define __NR_fork		  2
 | 
			
		||||
#define __NR_read		  3
 | 
			
		||||
#define __NR_write		  4
 | 
			
		||||
#define __NR_open		  5
 | 
			
		||||
#define __NR_close		  6
 | 
			
		||||
#define __NR_waitpid		  7
 | 
			
		||||
#define __NR_creat		  8
 | 
			
		||||
#define __NR_link		  9
 | 
			
		||||
#define __NR_unlink		 10
 | 
			
		||||
#define __NR_execve		 11
 | 
			
		||||
#define __NR_chdir		 12
 | 
			
		||||
#define __NR_time		 13
 | 
			
		||||
#define __NR_mknod		 14
 | 
			
		||||
#define __NR_chmod		 15
 | 
			
		||||
#define __NR_lchown		 16
 | 
			
		||||
#define __NR_break		 17
 | 
			
		||||
#define __NR_oldstat		 18
 | 
			
		||||
#define __NR_lseek		 19
 | 
			
		||||
#define __NR_getpid		 20
 | 
			
		||||
#define __NR_mount		 21
 | 
			
		||||
#define __NR_umount		 22
 | 
			
		||||
#define __NR_setuid		 23
 | 
			
		||||
#define __NR_getuid		 24
 | 
			
		||||
#define __NR_stime		 25
 | 
			
		||||
#define __NR_ptrace		 26
 | 
			
		||||
#define __NR_alarm		 27
 | 
			
		||||
#define __NR_oldfstat		 28
 | 
			
		||||
#define __NR_pause		 29
 | 
			
		||||
#define __NR_utime		 30
 | 
			
		||||
#define __NR_stty		 31
 | 
			
		||||
#define __NR_gtty		 32
 | 
			
		||||
#define __NR_access		 33
 | 
			
		||||
#define __NR_nice		 34
 | 
			
		||||
#define __NR_ftime		 35
 | 
			
		||||
#define __NR_sync		 36
 | 
			
		||||
#define __NR_kill		 37
 | 
			
		||||
#define __NR_rename		 38
 | 
			
		||||
#define __NR_mkdir		 39
 | 
			
		||||
#define __NR_rmdir		 40
 | 
			
		||||
#define __NR_dup		 41
 | 
			
		||||
#define __NR_pipe		 42
 | 
			
		||||
#define __NR_times		 43
 | 
			
		||||
#define __NR_prof		 44
 | 
			
		||||
#define __NR_brk		 45
 | 
			
		||||
#define __NR_setgid		 46
 | 
			
		||||
#define __NR_getgid		 47
 | 
			
		||||
#define __NR_signal		 48
 | 
			
		||||
#define __NR_geteuid		 49
 | 
			
		||||
#define __NR_getegid		 50
 | 
			
		||||
#define __NR_acct		 51
 | 
			
		||||
#define __NR_phys		 52
 | 
			
		||||
#define __NR_lock		 53
 | 
			
		||||
#define __NR_ioctl		 54
 | 
			
		||||
#define __NR_fcntl		 55
 | 
			
		||||
#define __NR_mpx		 56
 | 
			
		||||
#define __NR_setpgid		 57
 | 
			
		||||
#define __NR_ulimit		 58
 | 
			
		||||
#define __NR_oldolduname	 59
 | 
			
		||||
#define __NR_umask		 60
 | 
			
		||||
#define __NR_chroot		 61
 | 
			
		||||
#define __NR_ustat		 62
 | 
			
		||||
#define __NR_dup2		 63
 | 
			
		||||
#define __NR_getppid		 64
 | 
			
		||||
#define __NR_getpgrp		 65
 | 
			
		||||
#define __NR_setsid		 66
 | 
			
		||||
#define __NR_sigaction		 67
 | 
			
		||||
#define __NR_sgetmask		 68
 | 
			
		||||
#define __NR_ssetmask		 69
 | 
			
		||||
#define __NR_setreuid		 70
 | 
			
		||||
#define __NR_setregid		 71
 | 
			
		||||
#define __NR_sigsuspend		 72
 | 
			
		||||
#define __NR_sigpending		 73
 | 
			
		||||
#define __NR_sethostname	 74
 | 
			
		||||
#define __NR_setrlimit		 75
 | 
			
		||||
#define __NR_getrlimit		 76
 | 
			
		||||
#define __NR_getrusage		 77
 | 
			
		||||
#define __NR_gettimeofday	 78
 | 
			
		||||
#define __NR_settimeofday	 79
 | 
			
		||||
#define __NR_getgroups		 80
 | 
			
		||||
#define __NR_setgroups		 81
 | 
			
		||||
#define __NR_select		 82
 | 
			
		||||
#define __NR_symlink		 83
 | 
			
		||||
#define __NR_oldlstat		 84
 | 
			
		||||
#define __NR_readlink		 85
 | 
			
		||||
#define __NR_uselib		 86
 | 
			
		||||
#define __NR_swapon		 87
 | 
			
		||||
#define __NR_reboot		 88
 | 
			
		||||
#define __NR_readdir		 89
 | 
			
		||||
#define __NR_mmap		 90
 | 
			
		||||
#define __NR_munmap		 91
 | 
			
		||||
#define __NR_truncate		 92
 | 
			
		||||
#define __NR_ftruncate		 93
 | 
			
		||||
#define __NR_fchmod		 94
 | 
			
		||||
#define __NR_fchown		 95
 | 
			
		||||
#define __NR_getpriority	 96
 | 
			
		||||
#define __NR_setpriority	 97
 | 
			
		||||
#define __NR_profil		 98
 | 
			
		||||
#define __NR_statfs		 99
 | 
			
		||||
#define __NR_fstatfs		100
 | 
			
		||||
#define __NR_ioperm		101
 | 
			
		||||
#define __NR_socketcall		102
 | 
			
		||||
#define __NR_syslog		103
 | 
			
		||||
#define __NR_setitimer		104
 | 
			
		||||
#define __NR_getitimer		105
 | 
			
		||||
#define __NR_stat		106
 | 
			
		||||
#define __NR_lstat		107
 | 
			
		||||
#define __NR_fstat		108
 | 
			
		||||
#define __NR_olduname		109
 | 
			
		||||
#define __NR_iopl		110
 | 
			
		||||
#define __NR_vhangup		111
 | 
			
		||||
#define __NR_idle		112
 | 
			
		||||
#define __NR_vm86old		113
 | 
			
		||||
#define __NR_wait4		114
 | 
			
		||||
#define __NR_swapoff		115
 | 
			
		||||
#define __NR_sysinfo		116
 | 
			
		||||
#define __NR_ipc		117
 | 
			
		||||
#define __NR_fsync		118
 | 
			
		||||
#define __NR_sigreturn		119
 | 
			
		||||
#define __NR_clone		120
 | 
			
		||||
#define __NR_setdomainname	121
 | 
			
		||||
#define __NR_uname		122
 | 
			
		||||
#define __NR_modify_ldt		123
 | 
			
		||||
#define __NR_adjtimex		124
 | 
			
		||||
#define __NR_mprotect		125
 | 
			
		||||
#define __NR_sigprocmask	126
 | 
			
		||||
#define __NR_create_module	127
 | 
			
		||||
#define __NR_init_module	128
 | 
			
		||||
#define __NR_delete_module	129
 | 
			
		||||
#define __NR_get_kernel_syms	130
 | 
			
		||||
#define __NR_quotactl		131
 | 
			
		||||
#define __NR_getpgid		132
 | 
			
		||||
#define __NR_fchdir		133
 | 
			
		||||
#define __NR_bdflush		134
 | 
			
		||||
#define __NR_sysfs		135
 | 
			
		||||
#define __NR_personality	136
 | 
			
		||||
#define __NR_afs_syscall	137 /* Syscall for Andrew File System */
 | 
			
		||||
#define __NR_setfsuid		138
 | 
			
		||||
#define __NR_setfsgid		139
 | 
			
		||||
#define __NR__llseek		140
 | 
			
		||||
#define __NR_getdents		141
 | 
			
		||||
#define __NR__newselect		142
 | 
			
		||||
#define __NR_flock		143
 | 
			
		||||
#define __NR_msync		144
 | 
			
		||||
#define __NR_readv		145
 | 
			
		||||
#define __NR_writev		146
 | 
			
		||||
#define __NR_getsid		147
 | 
			
		||||
#define __NR_fdatasync		148
 | 
			
		||||
#define __NR__sysctl		149
 | 
			
		||||
#define __NR_mlock		150
 | 
			
		||||
#define __NR_munlock		151
 | 
			
		||||
#define __NR_mlockall		152
 | 
			
		||||
#define __NR_munlockall		153
 | 
			
		||||
#define __NR_sched_setparam		154
 | 
			
		||||
#define __NR_sched_getparam		155
 | 
			
		||||
#define __NR_sched_setscheduler		156
 | 
			
		||||
#define __NR_sched_getscheduler		157
 | 
			
		||||
#define __NR_sched_yield		158
 | 
			
		||||
#define __NR_sched_get_priority_max	159
 | 
			
		||||
#define __NR_sched_get_priority_min	160
 | 
			
		||||
#define __NR_sched_rr_get_interval	161
 | 
			
		||||
#define __NR_nanosleep		162
 | 
			
		||||
#define __NR_mremap		163
 | 
			
		||||
#define __NR_setresuid		164
 | 
			
		||||
#define __NR_getresuid		165
 | 
			
		||||
#define __NR_vm86		166
 | 
			
		||||
#define __NR_query_module	167
 | 
			
		||||
#define __NR_poll		168
 | 
			
		||||
#define __NR_nfsservctl		169
 | 
			
		||||
#define __NR_setresgid		170
 | 
			
		||||
#define __NR_getresgid		171
 | 
			
		||||
#define __NR_prctl              172
 | 
			
		||||
#define __NR_rt_sigreturn	173
 | 
			
		||||
#define __NR_rt_sigaction	174
 | 
			
		||||
#define __NR_rt_sigprocmask	175
 | 
			
		||||
#define __NR_rt_sigpending	176
 | 
			
		||||
#define __NR_rt_sigtimedwait	177
 | 
			
		||||
#define __NR_rt_sigqueueinfo	178
 | 
			
		||||
#define __NR_rt_sigsuspend	179
 | 
			
		||||
#define __NR_pread		180
 | 
			
		||||
#define __NR_pwrite		181
 | 
			
		||||
#define __NR_chown		182
 | 
			
		||||
#define __NR_getcwd		183
 | 
			
		||||
#define __NR_capget		184
 | 
			
		||||
#define __NR_capset		185
 | 
			
		||||
#define __NR_sigaltstack	186
 | 
			
		||||
#define __NR_sendfile		187
 | 
			
		||||
#define __NR_streams1		188	/* some people actually want it */
 | 
			
		||||
#define __NR_streams2		189	/* some people actually want it */
 | 
			
		||||
#define __NR_table		190
 | 
			
		||||
 | 
			
		||||
/* user-visible error numbers are in the range -1 - -122: see <asm-i386/errno.h> */
 | 
			
		||||
 | 
			
		||||
#define __syscall_return(type, res) \
 | 
			
		||||
do { \
 | 
			
		||||
	if ((unsigned long)(res) >= (unsigned long)(-125)) { \
 | 
			
		||||
		errno = -(res); \
 | 
			
		||||
		res = -1; \
 | 
			
		||||
	} \
 | 
			
		||||
	return (type) (res); \
 | 
			
		||||
} while (0)
 | 
			
		||||
 | 
			
		||||
/* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
 | 
			
		||||
#define _syscall0(type,name) \
 | 
			
		||||
type name(void) \
 | 
			
		||||
{ \
 | 
			
		||||
long __res; \
 | 
			
		||||
__asm__ volatile ("int $0x80" \
 | 
			
		||||
	: "=a" (__res) \
 | 
			
		||||
	: "0" (__NR_##name)); \
 | 
			
		||||
__syscall_return(type,__res); \
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define _syscall1(type,name,type1,arg1) \
 | 
			
		||||
type name(type1 arg1) \
 | 
			
		||||
{ \
 | 
			
		||||
long __res; \
 | 
			
		||||
__asm__ volatile ("int $0x80" \
 | 
			
		||||
	: "=a" (__res) \
 | 
			
		||||
	: "0" (__NR_##name),"b" ((long)(arg1))); \
 | 
			
		||||
__syscall_return(type,__res); \
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define _syscall2(type,name,type1,arg1,type2,arg2) \
 | 
			
		||||
type name(type1 arg1,type2 arg2) \
 | 
			
		||||
{ \
 | 
			
		||||
long __res; \
 | 
			
		||||
__asm__ volatile ("int $0x80" \
 | 
			
		||||
	: "=a" (__res) \
 | 
			
		||||
	: "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2))); \
 | 
			
		||||
__syscall_return(type,__res); \
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
 | 
			
		||||
type name(type1 arg1,type2 arg2,type3 arg3) \
 | 
			
		||||
{ \
 | 
			
		||||
long __res; \
 | 
			
		||||
__asm__ volatile ("int $0x80" \
 | 
			
		||||
	: "=a" (__res) \
 | 
			
		||||
	: "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2)), \
 | 
			
		||||
		  "d" ((long)(arg3))); \
 | 
			
		||||
__syscall_return(type,__res); \
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
 | 
			
		||||
type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
 | 
			
		||||
{ \
 | 
			
		||||
long __res; \
 | 
			
		||||
__asm__ volatile ("int $0x80" \
 | 
			
		||||
	: "=a" (__res) \
 | 
			
		||||
	: "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2)), \
 | 
			
		||||
	  "d" ((long)(arg3)),"S" ((long)(arg4))); \
 | 
			
		||||
__syscall_return(type,__res); \
 | 
			
		||||
} 
 | 
			
		||||
 | 
			
		||||
#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
 | 
			
		||||
	  type5,arg5) \
 | 
			
		||||
type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
 | 
			
		||||
{ \
 | 
			
		||||
long __res; \
 | 
			
		||||
__asm__ volatile ("int $0x80" \
 | 
			
		||||
	: "=a" (__res) \
 | 
			
		||||
	: "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2)), \
 | 
			
		||||
	  "d" ((long)(arg3)),"S" ((long)(arg4)),"D" ((long)(arg5))); \
 | 
			
		||||
__syscall_return(type,__res); \
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#ifdef __KERNEL_SYSCALLS__
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * we need this inline - forking from kernel space will result
 | 
			
		||||
 * in NO COPY ON WRITE (!!!), until an execve is executed. This
 | 
			
		||||
 * is no problem, but for the stack. This is handled by not letting
 | 
			
		||||
 * main() use the stack at all after fork(). Thus, no function
 | 
			
		||||
 * calls - which means inline code for fork too, as otherwise we
 | 
			
		||||
 * would use the stack upon exit from 'fork()'.
 | 
			
		||||
 *
 | 
			
		||||
 * Actually only pause and fork are needed inline, so that there
 | 
			
		||||
 * won't be any messing with the stack from main(), but we define
 | 
			
		||||
 * some others too.
 | 
			
		||||
 */
 | 
			
		||||
#define __NR__exit __NR_exit
 | 
			
		||||
static inline _syscall0(int,idle)
 | 
			
		||||
static inline _syscall0(int,pause)
 | 
			
		||||
static inline _syscall1(int,setup,int,magic)
 | 
			
		||||
static inline _syscall0(int,sync)
 | 
			
		||||
static inline _syscall0(pid_t,setsid)
 | 
			
		||||
static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count)
 | 
			
		||||
static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
 | 
			
		||||
static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count)
 | 
			
		||||
static inline _syscall1(int,dup,int,fd)
 | 
			
		||||
static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
 | 
			
		||||
static inline _syscall3(int,open,const char *,file,int,flag,int,mode)
 | 
			
		||||
static inline _syscall1(int,close,int,fd)
 | 
			
		||||
static inline _syscall1(int,_exit,int,exitcode)
 | 
			
		||||
static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
 | 
			
		||||
static inline _syscall1(int,delete_module,const char *,name)
 | 
			
		||||
 | 
			
		||||
static inline pid_t wait(int * wait_stat)
 | 
			
		||||
{
 | 
			
		||||
	return waitpid(-1,wait_stat,0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * This is the mechanism for creating a new kernel thread.
 | 
			
		||||
 *
 | 
			
		||||
 * NOTE! Only a kernel-only process(ie the swapper or direct descendants
 | 
			
		||||
 * who haven't done an "execve()") should use this: it will work within
 | 
			
		||||
 * a system call from a "real" process, but the process memory space will
 | 
			
		||||
 * not be free'd until both the parent and the child have exited.
 | 
			
		||||
 */
 | 
			
		||||
static inline pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
 | 
			
		||||
{
 | 
			
		||||
	long retval;
 | 
			
		||||
 | 
			
		||||
	__asm__ __volatile__(
 | 
			
		||||
		"movl %%esp,%%esi\n\t"
 | 
			
		||||
		"int $0x80\n\t"		/* Linux/i386 system call */
 | 
			
		||||
		"cmpl %%esp,%%esi\n\t"	/* child or parent? */
 | 
			
		||||
		"je 1f\n\t"		/* parent - jump */
 | 
			
		||||
		"pushl %3\n\t"		/* push argument */
 | 
			
		||||
		"call *%4\n\t"		/* call fn */
 | 
			
		||||
		"movl %2,%0\n\t"	/* exit */
 | 
			
		||||
		"int $0x80\n"
 | 
			
		||||
		"1:\t"
 | 
			
		||||
		:"=a" (retval)
 | 
			
		||||
		:"0" (__NR_clone), "i" (__NR_exit),
 | 
			
		||||
		 "r" (arg), "r" (fn),
 | 
			
		||||
		 "b" (flags | CLONE_VM)
 | 
			
		||||
		:"si");
 | 
			
		||||
	return retval;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* _ASM_I386_UNISTD_H_ */
 | 
			
		||||
							
								
								
									
										1
									
								
								kernel/table21/version.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								kernel/table21/version.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
#define _TABLE_VERSION	1
 | 
			
		||||
@@ -1,85 +0,0 @@
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
#include <linux/unistd.h>
 | 
			
		||||
#include <linux/table.h>
 | 
			
		||||
 | 
			
		||||
#include <syscall.h>
 | 
			
		||||
 | 
			
		||||
static inline _syscall3 (int, table, int, type, union table *, tbl, const void *, param);
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
main (void)
 | 
			
		||||
{
 | 
			
		||||
	union table tbl;
 | 
			
		||||
	unsigned count;
 | 
			
		||||
	int ret;
 | 
			
		||||
 | 
			
		||||
	ret = table (TABLE_VERSION, NULL, NULL);
 | 
			
		||||
 | 
			
		||||
	if (ret == -1) {
 | 
			
		||||
		fprintf (stderr, "table(%u): %s\n", TABLE_VERSION, sys_errlist [errno]);
 | 
			
		||||
		exit (-errno);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	fprintf (stderr, "Table (%u) = %u\n", TABLE_VERSION, ret);
 | 
			
		||||
 | 
			
		||||
	for (count = 0; count < 5; count++) {
 | 
			
		||||
		ret = table (TABLE_CPU, &tbl, NULL);
 | 
			
		||||
 | 
			
		||||
		if (ret == -1) {
 | 
			
		||||
			fprintf (stderr, "table(%u): %s\n", TABLE_CPU, sys_errlist [errno]);
 | 
			
		||||
			exit (-errno);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		fprintf (stderr, "Table (%u) = %lu, %lu, %lu, %lu, %lu, %lu\n",
 | 
			
		||||
			 TABLE_CPU, tbl.cpu.total, tbl.cpu.user, tbl.cpu.nice,
 | 
			
		||||
			 tbl.cpu.sys, tbl.cpu.idle, tbl.cpu.frequency);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	ret = table (TABLE_MEM, &tbl, NULL);
 | 
			
		||||
 | 
			
		||||
	if (ret == -1) {
 | 
			
		||||
		fprintf (stderr, "table(%u): %s\n", TABLE_MEM, sys_errlist [errno]);
 | 
			
		||||
		exit (-errno);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	fprintf (stderr, "Table (%u) = %lu, %lu, %lu, %lu, %lu, %lu\n",
 | 
			
		||||
		 TABLE_MEM, tbl.mem.total, tbl.mem.used, tbl.mem.free,
 | 
			
		||||
		 tbl.mem.shared, tbl.mem.buffer, tbl.mem.cached);
 | 
			
		||||
 | 
			
		||||
	ret = table (TABLE_SWAP, &tbl, NULL);
 | 
			
		||||
 | 
			
		||||
	if (ret == -1) {
 | 
			
		||||
		fprintf (stderr, "table(%u): %s\n", TABLE_SWAP, sys_errlist [errno]);
 | 
			
		||||
		exit (-errno);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	fprintf (stderr, "Table (%u) = %lu, %lu, %lu\n",
 | 
			
		||||
		 TABLE_SWAP, tbl.swap.total, tbl.swap.used, tbl.swap.free);
 | 
			
		||||
	
 | 
			
		||||
	ret = table (TABLE_LOADAVG, &tbl, NULL);
 | 
			
		||||
 | 
			
		||||
	if (ret == -1) {
 | 
			
		||||
		fprintf (stderr, "table(%u): %s\n", TABLE_LOADAVG, sys_errlist [errno]);
 | 
			
		||||
		exit (-errno);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	fprintf (stderr, "Table (%u) = (%lu, %lu, %lu) - %u, %u, %u\n",
 | 
			
		||||
		 TABLE_LOADAVG, tbl.loadavg.loadavg [0], tbl.loadavg.loadavg [1],
 | 
			
		||||
		 tbl.loadavg.loadavg [2], tbl.loadavg.nr_running,
 | 
			
		||||
		 tbl.loadavg.nr_tasks, tbl.loadavg.last_pid);
 | 
			
		||||
	
 | 
			
		||||
	ret = table (TABLE_UPTIME, &tbl, NULL);
 | 
			
		||||
 | 
			
		||||
	if (ret == -1) {
 | 
			
		||||
		fprintf (stderr, "table(%u): %s\n", TABLE_UPTIME, sys_errlist [errno]);
 | 
			
		||||
		exit (-errno);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	fprintf (stderr, "Table (%u) = %lu, %lu\n",
 | 
			
		||||
		 TABLE_UPTIME, tbl.uptime.uptime, tbl.uptime.idle);
 | 
			
		||||
	
 | 
			
		||||
	exit (0);
 | 
			
		||||
}
 | 
			
		||||
@@ -2,34 +2,6 @@
 | 
			
		||||
.libs
 | 
			
		||||
Makefile
 | 
			
		||||
Makefile.in
 | 
			
		||||
close.lo
 | 
			
		||||
command.lo
 | 
			
		||||
cpu.lo
 | 
			
		||||
error.lo
 | 
			
		||||
init.lo
 | 
			
		||||
ipc_limits.lo
 | 
			
		||||
libgtop.la
 | 
			
		||||
loadavg.lo
 | 
			
		||||
mem.lo
 | 
			
		||||
msg_limits.lo
 | 
			
		||||
open.lo
 | 
			
		||||
procdata.lo
 | 
			
		||||
prockernel.lo
 | 
			
		||||
proclist.lo
 | 
			
		||||
procmem.lo
 | 
			
		||||
procsegment.lo
 | 
			
		||||
procsignal.lo
 | 
			
		||||
procstate.lo
 | 
			
		||||
proctime.lo
 | 
			
		||||
procuid.lo
 | 
			
		||||
read.lo
 | 
			
		||||
read_data.lo
 | 
			
		||||
sem_limits.lo
 | 
			
		||||
shm_limits.lo
 | 
			
		||||
so_locations
 | 
			
		||||
swap.lo
 | 
			
		||||
sysinfo.lo
 | 
			
		||||
uptime.lo
 | 
			
		||||
write.lo
 | 
			
		||||
xmalloc.lo
 | 
			
		||||
*.lo
 | 
			
		||||
lib.c
 | 
			
		||||
 
 | 
			
		||||
@@ -1,15 +1,14 @@
 | 
			
		||||
LINK				= $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
 | 
			
		||||
 | 
			
		||||
INCLUDES			= -I$(top_builddir) -I$(top_srcdir) @machine_incs@ \
 | 
			
		||||
				  -I$(top_srcdir)/include -I$(top_srcdir)/intl @GUILE_INCS@ \
 | 
			
		||||
				  -DGTOPLOCALEDIR=\"$(datadir)/locale\" -D_GNU_SOURCE
 | 
			
		||||
 | 
			
		||||
CFLAGS				= -Wall -W @CFLAGS@ -DGTOP_SERVER=\""@LIBGTOP_SERVER@"\"
 | 
			
		||||
CFLAGS				= -Wall -W @CFLAGS@
 | 
			
		||||
 | 
			
		||||
lib_LTLIBRARIES			= libgtop.la
 | 
			
		||||
 | 
			
		||||
libgtop_la_SOURCES		= init.c open.c close.c command.c read.c read_data.c \
 | 
			
		||||
				  write.c lib.c parameter.c
 | 
			
		||||
libgtop_la_SOURCES		= init.c open.c close.c command.c read.c \
 | 
			
		||||
				  read_data.c write.c lib.c parameter.c \
 | 
			
		||||
				  sysdeps.c
 | 
			
		||||
 | 
			
		||||
libgtop_la_LDFLAGS		= $(LT_VERSION_INFO)
 | 
			
		||||
 | 
			
		||||
BUILT_SOURCES			= lib.c
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -28,7 +28,7 @@
 | 
			
		||||
 | 
			
		||||
void *
 | 
			
		||||
glibtop_call_l (glibtop *server, unsigned command, size_t send_size,
 | 
			
		||||
		void *send_buf, size_t recv_size, void *recv_buf)
 | 
			
		||||
		const void *send_buf, size_t recv_size, void *recv_buf)
 | 
			
		||||
{
 | 
			
		||||
	glibtop_command cmnd;
 | 
			
		||||
	glibtop_response response;
 | 
			
		||||
@@ -37,8 +37,6 @@ glibtop_call_l (glibtop *server, unsigned command, size_t send_size,
 | 
			
		||||
 | 
			
		||||
	memset (&cmnd, 0, sizeof (glibtop_command));
 | 
			
		||||
 | 
			
		||||
	memcpy (&cmnd.server, server, sizeof (glibtop));
 | 
			
		||||
	
 | 
			
		||||
	cmnd.command = command;
 | 
			
		||||
 | 
			
		||||
	/* If send_size is less than _GLIBTOP_PARAM_SIZE (normally 16 Bytes), we
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										73
									
								
								lib/init.c
									
									
									
									
									
								
							
							
						
						
									
										73
									
								
								lib/init.c
									
									
									
									
									
								
							@@ -21,6 +21,7 @@
 | 
			
		||||
 | 
			
		||||
#include <glibtop.h>
 | 
			
		||||
#include <glibtop/xmalloc.h>
 | 
			
		||||
#include <glibtop/sysdeps.h>
 | 
			
		||||
#include <glibtop/parameter.h>
 | 
			
		||||
 | 
			
		||||
#ifndef DEFAULT_PORT
 | 
			
		||||
@@ -30,8 +31,7 @@
 | 
			
		||||
static glibtop _glibtop_global_server;
 | 
			
		||||
glibtop *glibtop_global_server = &_glibtop_global_server;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
static void
 | 
			
		||||
_init_server (glibtop *server, const unsigned features)
 | 
			
		||||
{
 | 
			
		||||
	char *command, *temp;
 | 
			
		||||
@@ -41,7 +41,7 @@ _init_server (glibtop *server, const unsigned features)
 | 
			
		||||
 | 
			
		||||
	if (server->server_command == NULL) {
 | 
			
		||||
		const char *temp = getenv ("LIBGTOP_SERVER") ?
 | 
			
		||||
			getenv ("LIBGTOP_SERVER") : GTOP_SERVER;
 | 
			
		||||
			getenv ("LIBGTOP_SERVER") : LIBGTOP_SERVER;
 | 
			
		||||
 | 
			
		||||
		server->server_command = glibtop_strdup_r (server, temp);
 | 
			
		||||
	}
 | 
			
		||||
@@ -109,7 +109,8 @@ _init_server (glibtop *server, const unsigned features)
 | 
			
		||||
					
 | 
			
		||||
			/* Override default. */
 | 
			
		||||
			if (server->server_host)
 | 
			
		||||
				glibtop_free_r (server, (char *) server->server_host);
 | 
			
		||||
				glibtop_free_r (server,
 | 
			
		||||
						(char *) server->server_host);
 | 
			
		||||
 | 
			
		||||
			server->server_host = glibtop_strdup_r
 | 
			
		||||
				(server, temp+1);
 | 
			
		||||
@@ -136,6 +137,11 @@ _init_server (glibtop *server, const unsigned features)
 | 
			
		||||
		/* Connect to unix domain socket. */
 | 
			
		||||
		server->method = GLIBTOP_METHOD_UNIX;
 | 
			
		||||
 | 
			
		||||
	} else if (!strcmp (command, "pipe")) {
 | 
			
		||||
 | 
			
		||||
		/* Open pipe to server. */
 | 
			
		||||
		server->method = GLIBTOP_METHOD_PIPE;
 | 
			
		||||
 | 
			
		||||
	} else {
 | 
			
		||||
 | 
			
		||||
		glibtop_error_r (server, "Unknown server method '%s'",
 | 
			
		||||
@@ -147,8 +153,7 @@ _init_server (glibtop *server, const unsigned features)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
glibtop *
 | 
			
		||||
glibtop_init_r (glibtop **server_ptr, const unsigned long features,
 | 
			
		||||
		const unsigned flags)
 | 
			
		||||
glibtop_init_r (glibtop **server_ptr, unsigned long features, unsigned flags)
 | 
			
		||||
{
 | 
			
		||||
	glibtop *server;
 | 
			
		||||
 | 
			
		||||
@@ -168,9 +173,32 @@ glibtop_init_r (glibtop **server_ptr, const unsigned long features,
 | 
			
		||||
	/* Do the initialization, but only if not already initialized. */
 | 
			
		||||
 | 
			
		||||
	if ((server->flags & _GLIBTOP_INIT_STATE_INIT) == 0) {
 | 
			
		||||
		if (flags & GLIBTOP_FEATURES_EXCEPT)
 | 
			
		||||
			features = ~features & GLIBTOP_SYSDEPS_ALL;
 | 
			
		||||
		
 | 
			
		||||
		if (features == 0)
 | 
			
		||||
			features = GLIBTOP_SYSDEPS_ALL;
 | 
			
		||||
		
 | 
			
		||||
		if (flags & GLIBTOP_FEATURES_NO_SERVER) {
 | 
			
		||||
			server->method = GLIBTOP_METHOD_DIRECT;
 | 
			
		||||
			features = 0;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		server->features = features;
 | 
			
		||||
		
 | 
			
		||||
		_init_server (server, features);
 | 
			
		||||
		
 | 
			
		||||
		server->flags |= _GLIBTOP_INIT_STATE_INIT;
 | 
			
		||||
		
 | 
			
		||||
		switch (server->method) {
 | 
			
		||||
		case GLIBTOP_METHOD_PIPE:
 | 
			
		||||
		case GLIBTOP_METHOD_UNIX:
 | 
			
		||||
			if (glibtop_server_features & features)
 | 
			
		||||
				break;
 | 
			
		||||
			
 | 
			
		||||
			server->method = GLIBTOP_METHOD_DIRECT;
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* Should we open the server? */
 | 
			
		||||
@@ -186,3 +214,36 @@ glibtop_init_r (glibtop **server_ptr, const unsigned long features,
 | 
			
		||||
	
 | 
			
		||||
	return server;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
glibtop *
 | 
			
		||||
glibtop_init_s (glibtop **server_ptr, unsigned long features, unsigned flags)
 | 
			
		||||
{
 | 
			
		||||
	glibtop *server;
 | 
			
		||||
	glibtop_init_func_t *init_fkt;
 | 
			
		||||
	
 | 
			
		||||
	if (server_ptr == NULL)
 | 
			
		||||
		return NULL;
 | 
			
		||||
 | 
			
		||||
	if (*server_ptr == NULL)
 | 
			
		||||
		*server_ptr = glibtop_global_server;
 | 
			
		||||
 | 
			
		||||
	server = *server_ptr;
 | 
			
		||||
 | 
			
		||||
	/* Should we do the initialization? */
 | 
			
		||||
 | 
			
		||||
	if (flags & GLIBTOP_INIT_NO_INIT)
 | 
			
		||||
		return server;
 | 
			
		||||
 | 
			
		||||
	/* Do the initialization, but only if not already initialized. */
 | 
			
		||||
 | 
			
		||||
	if ((server->flags & _GLIBTOP_INIT_STATE_SYSDEPS) == 0) {
 | 
			
		||||
		glibtop_open_s (server, "glibtop", features, flags);
 | 
			
		||||
 | 
			
		||||
		for (init_fkt = _glibtop_init_hook_s; *init_fkt; init_fkt++)
 | 
			
		||||
			(*init_fkt) (server);
 | 
			
		||||
		
 | 
			
		||||
		server->flags |= _GLIBTOP_INIT_STATE_SYSDEPS;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return server;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										115
									
								
								lib/inodedb.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										115
									
								
								lib/inodedb.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,115 @@
 | 
			
		||||
/* $Id$ */
 | 
			
		||||
 | 
			
		||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
 | 
			
		||||
   This file is part of the Gnome Top Library.
 | 
			
		||||
   Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is free software; you can redistribute it and/or
 | 
			
		||||
   modify it under the terms of the GNU Library General Public License as
 | 
			
		||||
   published by the Free Software Foundation; either version 2 of the
 | 
			
		||||
   License, or (at your option) any later version.
 | 
			
		||||
 | 
			
		||||
   The Gnome Top Library is distributed in the hope that it will be useful,
 | 
			
		||||
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
   Library General Public License for more details.
 | 
			
		||||
 | 
			
		||||
   You should have received a copy of the GNU Library General Public
 | 
			
		||||
   License along with the GNU C Library; see the file COPYING.LIB.  If not,
 | 
			
		||||
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 | 
			
		||||
   Boston, MA 02111-1307, USA.  */
 | 
			
		||||
 | 
			
		||||
#include <glibtop.h>
 | 
			
		||||
#include <glibtop/error.h>
 | 
			
		||||
#include <glibtop/xmalloc.h>
 | 
			
		||||
#include <glibtop/inodedb.h>
 | 
			
		||||
 | 
			
		||||
#include <pwd.h>
 | 
			
		||||
#include <gdbm.h>
 | 
			
		||||
 | 
			
		||||
#ifndef SYSTEM_INODEDB
 | 
			
		||||
#define SYSTEM_INODEDB "/usr/var/libgtop/inodedb.db"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
glibtop_inodedb *
 | 
			
		||||
glibtop_inodedb_open_s (glibtop *server, unsigned databases,
 | 
			
		||||
			unsigned long cachesize)
 | 
			
		||||
{
 | 
			
		||||
	glibtop_inodedb *inodedb;
 | 
			
		||||
	char filename [BUFSIZ];
 | 
			
		||||
	struct passwd *pwd;
 | 
			
		||||
	struct stat statb;
 | 
			
		||||
 | 
			
		||||
	if (!databases)
 | 
			
		||||
		databases = GLIBTOP_INODEDB_ALL;
 | 
			
		||||
 | 
			
		||||
	inodedb = glibtop_calloc_r (server, 1, sizeof (glibtop_inodedb));
 | 
			
		||||
 | 
			
		||||
	if (stat (SYSTEM_INODEDB, &statb))
 | 
			
		||||
		databases &= ~GLIBTOP_INODEDB_SYSTEM;
 | 
			
		||||
 | 
			
		||||
	if (databases & GLIBTOP_INODEDB_SYSTEM) {
 | 
			
		||||
		inodedb->system_dbf = gdbm_open
 | 
			
		||||
			(SYSTEM_INODEDB, 0, GDBM_READER, 0, 0);
 | 
			
		||||
		if (!inodedb->system_dbf)
 | 
			
		||||
			glibtop_error_io_r
 | 
			
		||||
				(server, "gdbm_open (%s)", SYSTEM_INODEDB);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	pwd = getpwuid (getuid ());
 | 
			
		||||
	if (!pwd) glibtop_error_io_r (server, "getpwuid");
 | 
			
		||||
	
 | 
			
		||||
	sprintf (filename, "%s/var/libgtop/inodedb.db", pwd->pw_dir);
 | 
			
		||||
	
 | 
			
		||||
	if (stat (filename, &statb))
 | 
			
		||||
		databases &= ~GLIBTOP_INODEDB_USER;
 | 
			
		||||
 | 
			
		||||
	if (databases & GLIBTOP_INODEDB_USER) {
 | 
			
		||||
		inodedb->user_dbf = gdbm_open
 | 
			
		||||
			(filename, 0, GDBM_READER, 0, 0);
 | 
			
		||||
		if (!inodedb->user_dbf)
 | 
			
		||||
			glibtop_error_io_r
 | 
			
		||||
				(server, "gdbm_open (%s)", filename);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return inodedb;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const char *
 | 
			
		||||
glibtop_inodedb_lookup_s (glibtop *server,
 | 
			
		||||
			  glibtop_inodedb *inodedb,
 | 
			
		||||
			  u_int64_t device, u_int64_t inode)
 | 
			
		||||
{
 | 
			
		||||
	glibtop_inodedb_key key;
 | 
			
		||||
	datum d_key, d_content;
 | 
			
		||||
 | 
			
		||||
	d_key.dptr = (void *) &key;
 | 
			
		||||
	d_key.dsize = sizeof (key);
 | 
			
		||||
 | 
			
		||||
	key.device = device;
 | 
			
		||||
	key.inode = inode;
 | 
			
		||||
 | 
			
		||||
	if (inodedb->system_dbf) {
 | 
			
		||||
		d_content = gdbm_fetch (inodedb->system_dbf, d_key);
 | 
			
		||||
		if (d_content.dptr) return d_content.dptr;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (inodedb->user_dbf) {
 | 
			
		||||
		d_content = gdbm_fetch (inodedb->user_dbf, d_key);
 | 
			
		||||
		if (d_content.dptr) return d_content.dptr;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
glibtop_inodedb_close_s (glibtop *server, glibtop_inodedb *inodedb)
 | 
			
		||||
{
 | 
			
		||||
	if (inodedb->system_dbf)
 | 
			
		||||
		gdbm_close (inodedb->system_dbf);
 | 
			
		||||
	
 | 
			
		||||
	if (inodedb->user_dbf)
 | 
			
		||||
		gdbm_close (inodedb->user_dbf);
 | 
			
		||||
 | 
			
		||||
	glibtop_free_r (server, inodedb);
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										170
									
								
								lib/lib.awk
									
									
									
									
									
								
							
							
						
						
									
										170
									
								
								lib/lib.awk
									
									
									
									
									
								
							@@ -2,54 +2,166 @@ BEGIN {
 | 
			
		||||
  print "/* lib.c */";
 | 
			
		||||
  print "/* This is a generated file.  Please modify `lib.awk' */";
 | 
			
		||||
  print "";
 | 
			
		||||
 | 
			
		||||
  
 | 
			
		||||
  print "#include <glibtop.h>";
 | 
			
		||||
  print "#include <glibtop/open.h>";
 | 
			
		||||
  print "";
 | 
			
		||||
  print "#include <glibtop/sysdeps.h>";
 | 
			
		||||
  print "#include <glibtop/union.h>";
 | 
			
		||||
  print "";
 | 
			
		||||
  print "#include <glibtop/command.h>";
 | 
			
		||||
 | 
			
		||||
  
 | 
			
		||||
  print "";
 | 
			
		||||
  print "/* Some required fields are missing. */";
 | 
			
		||||
  print "";
 | 
			
		||||
 | 
			
		||||
  print "static void";
 | 
			
		||||
  print "_glibtop_missing_feature (glibtop *server, const char *feature,";
 | 
			
		||||
  print "\t\t\t  const u_int64_t present, u_int64_t *required)";
 | 
			
		||||
  print "{";
 | 
			
		||||
  print "\tswitch (server->error_method) {";
 | 
			
		||||
  print "\tcase GLIBTOP_ERROR_METHOD_WARN_ONCE:";
 | 
			
		||||
  print "\t\t*required &= present;";
 | 
			
		||||
  print "\tcase GLIBTOP_ERROR_METHOD_WARN:";
 | 
			
		||||
  print "\t\tglibtop_warn_r (server,";
 | 
			
		||||
  print "\t\t\t\t_(\"glibtop_get_%s (): Client requested \"";
 | 
			
		||||
  print "\t\t\t\t  \"field mask %05Lx, but only have %05Lx.\"),";
 | 
			
		||||
  print "\t\t\t\t feature, required, present);";
 | 
			
		||||
  print "\t\tbreak;";
 | 
			
		||||
  print "\tcase GLIBTOP_ERROR_METHOD_ABORT:";
 | 
			
		||||
  print "\t\tglibtop_error_r (server,";
 | 
			
		||||
  print "\t\t\t\t _(\"glibtop_get_%s (): Client requested \"";
 | 
			
		||||
  print "\t\t\t\t   \"field mask %05x, but only have %05x.\"),";
 | 
			
		||||
  print "\t\t\t\t feature, required, present);";
 | 
			
		||||
  print "\t\tbreak;";
 | 
			
		||||
  print "\t}";
 | 
			
		||||
  print "}";
 | 
			
		||||
 | 
			
		||||
  print "";
 | 
			
		||||
  print "/* Library functions. */";
 | 
			
		||||
  print "";
 | 
			
		||||
 | 
			
		||||
  convert["long"]     = "int64_t";
 | 
			
		||||
  convert["ulong"]    = "u_int64_t";
 | 
			
		||||
  convert["pid_t"]    = "pid_t";
 | 
			
		||||
  convert["int"]      = "int";
 | 
			
		||||
  convert["ushort"]   = "unsigned short";
 | 
			
		||||
  convert["unsigned"] = "unsigned";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function output(feature) {
 | 
			
		||||
  if (feature ~ /^proclist$/) {
 | 
			
		||||
    print "unsigned *";
 | 
			
		||||
    prefix = "return ";
 | 
			
		||||
function output(line) {
 | 
			
		||||
  split (line, line_fields, /\|/);
 | 
			
		||||
  retval = line_fields[1];
 | 
			
		||||
  feature = line_fields[2];
 | 
			
		||||
  param_def = line_fields[4];
 | 
			
		||||
 | 
			
		||||
  orig = feature; sub(/^@/,"",feature);
 | 
			
		||||
  space = feature; gsub(/./," ",space);
 | 
			
		||||
 | 
			
		||||
  print retval;
 | 
			
		||||
  if (retval !~ /^void$/) {
 | 
			
		||||
    prefix = "retval = ";
 | 
			
		||||
    prefix_space = "         ";
 | 
			
		||||
  } else {
 | 
			
		||||
    prefix = "";
 | 
			
		||||
    print "void";
 | 
			
		||||
  }
 | 
			
		||||
  if (feature ~ /^proc_/) {
 | 
			
		||||
    param = ", pid_t pid";
 | 
			
		||||
  } else {
 | 
			
		||||
    param = "";
 | 
			
		||||
    prefix_space = "";
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  print "glibtop_get_"feature"_l (glibtop *server, glibtop_"feature" *buf"param")";
 | 
			
		||||
  print "{";
 | 
			
		||||
  print "\tglibtop_init_r (&server, GLIBTOP_SYSDEPS_"toupper(feature)", 0);";
 | 
			
		||||
  if (param_def == "string") {
 | 
			
		||||
    call_param = ", "line_fields[5];
 | 
			
		||||
    param_decl = ",\n            "space"    const char *"line_fields[5];
 | 
			
		||||
    send_ptr = "\n\tconst void *send_ptr = "line_fields[5]";";
 | 
			
		||||
    send_size = "\n\tconst size_t send_size =\n\t\tstrlen ("line_fields[5]") + 1;";
 | 
			
		||||
  } else {
 | 
			
		||||
    call_param = "";
 | 
			
		||||
    param_decl = "";
 | 
			
		||||
    send_size = "";
 | 
			
		||||
    send_ptr = "";
 | 
			
		||||
    nr_params = split (param_def, params, /:/);
 | 
			
		||||
    for (param = 1; param <= nr_params; param++) {
 | 
			
		||||
      list = params[param];
 | 
			
		||||
      type = params[param];
 | 
			
		||||
      sub(/\(.*/, "", type);
 | 
			
		||||
      sub(/^.*\(/, "", list); sub(/\)$/, "", list);
 | 
			
		||||
      count = split (list, fields, /,/);
 | 
			
		||||
      for (field = 1; field <= count; field++) {
 | 
			
		||||
	if (param_decl == "")
 | 
			
		||||
	  param_decl = ",\n            "space"    ";
 | 
			
		||||
	else
 | 
			
		||||
	  param_decl = param_decl", ";
 | 
			
		||||
	param_decl = param_decl""convert[type]" "fields[field];
 | 
			
		||||
	call_param = call_param", "fields[field];
 | 
			
		||||
	if (send_ptr == "")
 | 
			
		||||
	  send_ptr = "\n\tconst void *send_ptr = &"fields[field]";";
 | 
			
		||||
	if (send_size == "")
 | 
			
		||||
	  send_size = "\n\tconst size_t send_size =\n\t\t";
 | 
			
		||||
	else
 | 
			
		||||
	  send_size = send_size" + ";
 | 
			
		||||
	send_size = send_size"sizeof ("fields[field]")";
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    if (send_size != "")
 | 
			
		||||
      send_size = send_size";";
 | 
			
		||||
    else
 | 
			
		||||
      send_size = "\n\tconst size_t send_size = 0;";
 | 
			
		||||
    if (send_ptr == "")
 | 
			
		||||
      send_ptr = "\n\tconst void *send_ptr = NULL;";
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  print "glibtop_get_"feature"_l (glibtop *server, glibtop_"feature" *buf"param_decl")";
 | 
			
		||||
  
 | 
			
		||||
  print "{"send_ptr""send_size;
 | 
			
		||||
  if (retval !~ /^void$/)
 | 
			
		||||
    print "\t"retval" retval = ("retval") 0;";
 | 
			
		||||
  print "";
 | 
			
		||||
 | 
			
		||||
  print "\tglibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_"toupper(feature)"), 0);";
 | 
			
		||||
 | 
			
		||||
  print "";
 | 
			
		||||
  print "\t/* If neccessary, we ask the server for the requested";
 | 
			
		||||
  print "\t * feature. If not, we call the sysdeps function. */";
 | 
			
		||||
  print "";
 | 
			
		||||
 | 
			
		||||
  print "\tif ((server->flags & _GLIBTOP_INIT_STATE_SERVER) &&";
 | 
			
		||||
  print "\t    (server->features & GLIBTOP_SYSDEPS_"toupper(feature)"))";
 | 
			
		||||
  print "\t    (server->features & (1 << GLIBTOP_SYSDEPS_"toupper(feature)")))";
 | 
			
		||||
  print "\t{";
 | 
			
		||||
 | 
			
		||||
  if (feature ~ /^proc_/) {
 | 
			
		||||
    print "\t\t"prefix"glibtop_call_l (server, GLIBTOP_CMND_"toupper(feature)", sizeof (pid_t),";
 | 
			
		||||
    print "\t\t\t\t&pid, sizeof (glibtop_"feature"), buf);";
 | 
			
		||||
    print "\t} else {";
 | 
			
		||||
    print "\t\t"prefix"glibtop_get_"feature"_r (server, buf, pid);";
 | 
			
		||||
  } else {
 | 
			
		||||
    print "\t\t"prefix"glibtop_call_l (server, GLIBTOP_CMND_"toupper(feature)", 0, NULL,";
 | 
			
		||||
    print "\t\t\t  sizeof (glibtop_"feature"), buf);";
 | 
			
		||||
    print "\t} else {";
 | 
			
		||||
    print "\t\t"prefix"glibtop_get_"feature"_r (server, buf);";
 | 
			
		||||
  print "\t\t"prefix"glibtop_call_l (server, GLIBTOP_CMND_"toupper(feature)",";
 | 
			
		||||
  print "\t\t\t\t"prefix_space"send_size, send_ptr,";
 | 
			
		||||
  print "\t\t\t\t"prefix_space"sizeof (glibtop_"feature"), buf);";
 | 
			
		||||
  
 | 
			
		||||
  print "\t} else {";
 | 
			
		||||
 | 
			
		||||
  if (orig !~ /^@/)
 | 
			
		||||
    print "#if (!GLIBTOP_SUID_"toupper(feature)")";
 | 
			
		||||
 | 
			
		||||
  print "\t\t"prefix"glibtop_get_"feature"_s (server, buf"call_param");";
 | 
			
		||||
 | 
			
		||||
  if (orig !~ /^@/) {
 | 
			
		||||
    print "#else";
 | 
			
		||||
    print "\t\terrno = ENOSYS;";
 | 
			
		||||
    print "\t\tglibtop_error_io_r (server, \"glibtop_get_"feature"\");";
 | 
			
		||||
    print "#endif";
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  print "\t}";
 | 
			
		||||
 | 
			
		||||
  print "";
 | 
			
		||||
  print "\t/* Make sure that all required fields are present. */";
 | 
			
		||||
  print "";
 | 
			
		||||
 | 
			
		||||
  print "\tif (buf->flags & server->required."feature")";
 | 
			
		||||
  print "\t\t_glibtop_missing_feature (server, \""feature"\", buf->flags,";
 | 
			
		||||
  print "\t\t\t\t\t  &server->required."feature");";
 | 
			
		||||
 | 
			
		||||
  if (retval !~ /^void$/) {
 | 
			
		||||
    print "\n\t/* Now we can return. */";
 | 
			
		||||
    print "\n\treturn retval;";
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  print "}";
 | 
			
		||||
  print "";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/^(\w+)/	{ output($1) }
 | 
			
		||||
 | 
			
		||||
	
 | 
			
		||||
/^[^#]/		{ output($0) }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										101
									
								
								lib/open.c
									
									
									
									
									
								
							
							
						
						
									
										101
									
								
								lib/open.c
									
									
									
									
									
								
							@@ -21,6 +21,7 @@
 | 
			
		||||
 | 
			
		||||
#include <glibtop.h>
 | 
			
		||||
#include <glibtop/open.h>
 | 
			
		||||
#include <glibtop/version.h>
 | 
			
		||||
#include <glibtop/sysdeps.h>
 | 
			
		||||
#include <glibtop/command.h>
 | 
			
		||||
#include <glibtop/xmalloc.h>
 | 
			
		||||
@@ -42,37 +43,82 @@ glibtop_open_l (glibtop *server, const char *program_name,
 | 
			
		||||
 | 
			
		||||
	server->flags |= _GLIBTOP_INIT_STATE_OPEN;
 | 
			
		||||
 | 
			
		||||
	server->error_method = GLIBTOP_ERROR_METHOD_DEFAULT;
 | 
			
		||||
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
	fprintf (stderr, "SIZEOF: %u - %u - %u - %u - %u - %u\n",
 | 
			
		||||
		 sizeof (glibtop_command), sizeof (glibtop_response),
 | 
			
		||||
		 sizeof (glibtop_mountentry), sizeof (glibtop_union),
 | 
			
		||||
		 sizeof (glibtop_sysdeps), sizeof (glibtop_response_union));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	switch (server->method) {
 | 
			
		||||
	case GLIBTOP_METHOD_DIRECT:
 | 
			
		||||
		fprintf (stderr, "Calling sysdeps open function.\n");
 | 
			
		||||
 | 
			
		||||
		glibtop_open_r (server, program_name, features, flags);
 | 
			
		||||
 | 
			
		||||
		server->features = 0;
 | 
			
		||||
		break;
 | 
			
		||||
	case GLIBTOP_METHOD_INET:
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
		fprintf (stderr, "Connecting to '%s' port %ld.\n",
 | 
			
		||||
			 server->server_host, server->server_port);
 | 
			
		||||
#endif
 | 
			
		||||
		
 | 
			
		||||
		connect_type = glibtop_make_connection
 | 
			
		||||
			(server->server_host, server->server_port,
 | 
			
		||||
			 &server->socket);
 | 
			
		||||
 | 
			
		||||
		
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
		fprintf (stderr, "Connect Type is %d.\n", connect_type);
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
		
 | 
			
		||||
		server->flags |= _GLIBTOP_INIT_STATE_SERVER;
 | 
			
		||||
		
 | 
			
		||||
		server->features = -1;
 | 
			
		||||
		break;
 | 
			
		||||
	case GLIBTOP_METHOD_UNIX:
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
		fprintf (stderr, "Connecting to Unix Domain Socket.\n");
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
		connect_type = glibtop_make_connection
 | 
			
		||||
			("unix", 0, &server->socket);
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
#ifdef DEBUG		
 | 
			
		||||
		fprintf (stderr, "Connect Type is %d.\n", connect_type);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
		server->flags |= _GLIBTOP_INIT_STATE_SERVER;
 | 
			
		||||
 | 
			
		||||
		server->features = -1;
 | 
			
		||||
		break;
 | 
			
		||||
	case GLIBTOP_METHOD_PIPE:
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
		fprintf (stderr, "Opening pipe to server (%s).\n",
 | 
			
		||||
			 LIBGTOP_SERVER);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
		if (pipe (server->input) || pipe (server->output))
 | 
			
		||||
			glibtop_error_io_r (server, "cannot make a pipe");
 | 
			
		||||
 | 
			
		||||
		server->pid  = fork ();
 | 
			
		||||
		
 | 
			
		||||
		if (server->pid < 0) {
 | 
			
		||||
			glibtop_error_io_r (server, "fork failed");
 | 
			
		||||
		} else if (server->pid == 0) {
 | 
			
		||||
			close (0); close (1);
 | 
			
		||||
			close (server->input [0]); close (server->output [1]);
 | 
			
		||||
			dup2 (server->input [1], 1);
 | 
			
		||||
			dup2 (server->output [0], 0);
 | 
			
		||||
			execl (LIBGTOP_SERVER, "libgtop-server", NULL);
 | 
			
		||||
			glibtop_error_io_r (server, "execl (%s)",
 | 
			
		||||
					    LIBGTOP_SERVER);
 | 
			
		||||
			_exit (2);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		close (server->input [1]);
 | 
			
		||||
		close (server->output [0]);
 | 
			
		||||
 | 
			
		||||
		server->flags |= _GLIBTOP_INIT_STATE_SERVER;
 | 
			
		||||
		
 | 
			
		||||
		server->features = -1;
 | 
			
		||||
		break;
 | 
			
		||||
	}
 | 
			
		||||
@@ -80,14 +126,55 @@ glibtop_open_l (glibtop *server, const char *program_name,
 | 
			
		||||
	/* If the server has been started, ask it for its features. */
 | 
			
		||||
 | 
			
		||||
	if (server->flags & _GLIBTOP_INIT_STATE_SERVER) {
 | 
			
		||||
		char version [BUFSIZ], buffer [BUFSIZ];
 | 
			
		||||
		glibtop_sysdeps sysdeps;
 | 
			
		||||
		unsigned size, nbytes;
 | 
			
		||||
 | 
			
		||||
		/* First check whether the server version is correct. */
 | 
			
		||||
 | 
			
		||||
		sprintf (version, LIBGTOP_VERSION_STRING,
 | 
			
		||||
			 LIBGTOP_VERSION, LIBGTOP_SERVER_VERSION,
 | 
			
		||||
			 sizeof (glibtop_command),
 | 
			
		||||
			 sizeof (glibtop_response),
 | 
			
		||||
			 sizeof (glibtop_union),
 | 
			
		||||
			 sizeof (glibtop_sysdeps));
 | 
			
		||||
 | 
			
		||||
		size = strlen (version) + 1;
 | 
			
		||||
	
 | 
			
		||||
		glibtop_read_l (server, sizeof (nbytes), &nbytes);
 | 
			
		||||
 | 
			
		||||
		if (nbytes != size)
 | 
			
		||||
			glibtop_error_r (server,
 | 
			
		||||
					 "Requested %u bytes but got %u.",
 | 
			
		||||
					 size, nbytes);
 | 
			
		||||
		
 | 
			
		||||
		glibtop_read_l (server, nbytes, buffer);
 | 
			
		||||
		
 | 
			
		||||
		if (memcmp (version, buffer, size))
 | 
			
		||||
			glibtop_error_r (server, "server version is not %s",
 | 
			
		||||
					 LIBGTOP_VERSION);
 | 
			
		||||
 | 
			
		||||
		/* Now ask it for its features. */
 | 
			
		||||
		
 | 
			
		||||
		glibtop_call_l (server, GLIBTOP_CMND_SYSDEPS, 0, NULL,
 | 
			
		||||
				sizeof (glibtop_sysdeps), &sysdeps);
 | 
			
		||||
		
 | 
			
		||||
		server->features = sysdeps.features;
 | 
			
		||||
 | 
			
		||||
		memcpy (&server->sysdeps, &sysdeps, sizeof (glibtop_sysdeps));
 | 
			
		||||
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
		fprintf (stderr, "Server features are %lu.\n",
 | 
			
		||||
			 server->features);
 | 
			
		||||
#endif
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* In any case, we call the open functions of our own sysdeps
 | 
			
		||||
	 * directory. */
 | 
			
		||||
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
	fprintf (stderr, "Calling sysdeps open function.\n");
 | 
			
		||||
#endif
 | 
			
		||||
	
 | 
			
		||||
	glibtop_init_s (&server, features, flags);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user