usr.sbin/amd/amd/nfs_start.c
/*
 * Check that we are not burning resources
 */
Check that we are not burning resources
Check that we are not burning resources
static void checkup(P_void)
{
static int max_fd = 0;
static char *max_mem = 0;
	int next_fd = dup(0);
	extern caddr_t sbrk P((int));
	caddr_t next_mem = sbrk(0);
	close(next_fd);
	 if (max_fd < next_fd) {
		dlog("%d new fds allocated; total is %d",
			next_fd - max_fd, next_fd);
		max_fd = next_fd;
	}
	 if (max_mem < next_mem) {
		dlog("%#x bytes of memory allocated; total is %#x (%d pages)",
			next_mem - max_mem,
			next_mem,
			((int)next_mem+getpagesize()-1)/getpagesize());
		max_mem = next_mem;
	}
}
static void checkup ( P_void ) { static int max_fd = 0 ; static char * max_mem = 0 ; int next_fd = dup ( 0 ) ; extern caddr_t sbrk P ( ( int ) ) ; caddr_t next_mem = sbrk ( 0 ) ; close ( next_fd ) ; if ( max_fd < next_fd ) { dlog ( " " , next_fd - max_fd , next_fd ) ; max_fd = next_fd ; } if ( max_mem < next_mem ) { dlog ( " " , next_mem - max_mem , next_mem , ( ( int ) next_mem + getpagesize ( ) - 1 ) / getpagesize ( ) ) ; max_mem = next_mem ; } }
Check that we are not burning resources
Check that we are not burning resources
/*if (max_fd < 0) {
		max_fd = next_fd;
	} else*/ /*if (max_mem == 0) {
		max_mem = next_mem;
	} else*/