Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!rlgvax!hadron!jsdy From: jsdy@hadron.UUCP (Joseph S. D. Yao) Newsgroups: net.unix-wizards Subject: Re: What does "no file" mean? Message-ID: <204@hadron.UUCP> Date: Sun, 26-Jan-86 15:26:08 EST Article-I.D.: hadron.204 Posted: Sun Jan 26 15:26:08 1986 Date-Received: Thu, 30-Jan-86 04:52:30 EST References: <526@rdin.UUCP> Reply-To: jsdy@hadron.UUCP (Joseph S. D. Yao) Organization: Hadron, Inc., Fairfax, VA Lines: 84 Summary: kernel: too many total open files. The message "no file" comes from having too many open files, total, among all your processes in the system. Or, depending on your point of view, too few compiled into the kernel. The message comes from the kernel. Common causes include programs that open files and then do not close them (aka sloppy programming), more users or programs running than were originally expected, and/or a too-low assumption of total #files available at system kernel compile time. The problem can be easily repeated by: /* ** Warning: viewers at home are cautioned that the following ** should only be attempted by experienced professionals. Any ** attempts to try this by children at home could result in a ** severely shortened life for either your system, your account, ** or you, depending on the penalties exacted by your system ** and Organization administration. */ #include #include #define ever (;;) #define DIRMODE 0755 #define FILMODE 0644 #define ERROR (-1) #define DUMPTIME 120 /* Max time this will run. */ char file[] = "tmp/00000000000000"; main() { register char *cp; register int i, j, k; char *efile; int w, pid; time_t t, lim; extern time_t time(); pid = getpid(); (void) time(&t); lim = t + DUMPTIME; mkdir("tmp", DIRMODE); /* left as a user exercise */ cp = efile = &file[strlen(file)-1]; for ever { (void) time(&t); if (t >= lim) break; for (i = 0; i < NOFILES; i++) (void) close(i); while (creat(file, FILMODE) >= 0) { while (*cp == 'z') *--cp = '0'; ++*cp; cp = efile; } switch (j = fork()) { case ERROR: perror("fork"); break; case 0: /* child -- go for more. */ break; default: while ((k = wait(&w)) != ERROR) if (k == j) break; break; } } for (i = 0; i < NOFILES; i++) (void) close(i); if (pid != getpid()) return(1); execl("/bin/rm", "rm", "-rf", "tmp", 0); /* NOT REACHED */ return(0); } -- Joe Yao hadron!jsdy@seismo.{CSS.GOV,ARPA,UUCP}