I don't have any more info since for some reason the kernel wasn't saved when my system dumped core, but yet again fincore.c causes evidence that -CURRENT has regressed again. I can't find the old thread I'm thinking of, but from a slightly different thread, bde knew what was going on. For further reference:
#include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <sys/types.h> #include <sys/mman.h> #include <fcntl.h> #include <sys/stat.h> #include <machine/param.h> #include <errno.h> /* ** print pages of file in core */ void usage(char *name) { printf("Usage: %s [-ns] files...\n",name); printf("\t-n\t\tDo not print filename\n"); printf("\t-o\t\tOnly print files with at least one page in core\n"); printf("\t-s\t\tDo not print file size in pages\n"); } main(int ac,char **av) { int c; int print_name = 1; int print_sizepages = 1; int only_nonzero = 0; int status = 0; while((c = getopt(ac,av,"nos")) != -1) { switch(c) { case 'n': print_name = 0; break; case 'o': only_nonzero = 1; break; case 's': print_sizepages = 0; break; default: usage(av[0]); exit(1); } } for(; optind < ac ; optind++) { int fd; int pind,pcount; caddr_t addr; struct stat statbuf; size_t len; size_t numpages; char *pvec; if (stat(av[optind],&statbuf)) { perror("stat"); status = 1; continue; } if (!S_ISREG(statbuf.st_mode)) { close(fd); continue; } if ((fd = open(av[optind],O_RDONLY)) < 0) { perror(av[optind]); status = 1; continue; } if (fstat(fd,&statbuf)) { perror("fstat"); close(fd); status = 1; continue; } if (!S_ISREG(statbuf.st_mode)) { close(fd); continue; } len = statbuf.st_size; numpages = len/PAGE_SIZE + ((len % PAGE_SIZE) != 0); if (! (statbuf.st_mode & (S_IFREG|S_IFCHR))) { pcount = 0; } else if (len) { if ((addr = mmap(0,len,PROT_READ,MAP_SHARED,fd,0)) == MAP_FAILED) { fprintf(stderr, "mmap (%s): %s\n", av[optind], strerror(errno)); close(fd); status = 1; continue; } pvec = malloc(numpages); if (mincore(addr,len,pvec)) { perror("mincore"); exit(1); } for(pcount = 0,pind = 0 ; pind < numpages ; pind++) { if (pvec[pind]) pcount++; } free(pvec); if (munmap(addr,len)) { perror("munmap"); exit(1); } } else { pcount = 0; } if (pcount || !only_nonzero) { if (print_name) printf("%s: ",av[optind]); printf("%d",pcount); if (print_sizepages) printf("/%d",numpages); printf("\n"); } close(fd); } exit(status); } -- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> [EMAIL PROTECTED] <> [EMAIL PROTECTED] \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\ To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message