From owner-freebsd-isp Thu Oct 9 03:12:35 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id DAA21988 for isp-outgoing; Thu, 9 Oct 1997 03:12:35 -0700 (PDT) (envelope-from owner-freebsd-isp) Received: from axe.cablenet.net (axe.cablenet.net [194.154.36.65]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id DAA21961 for ; Thu, 9 Oct 1997 03:12:09 -0700 (PDT) (envelope-from damian@axe.cablenet.net) Received: from axe (localhost [127.0.0.1]) by axe.cablenet.net (8.8.7/8.6.9) with SMTP id KAA06764; Thu, 9 Oct 1997 10:56:08 +0100 (BST) Message-ID: <343CAA37.586EAEC@cablenet.net> Date: Thu, 09 Oct 1997 10:56:07 +0100 From: Damian Hamill Organization: CableNet Ltd X-Mailer: Mozilla 3.0 (X11; I; SunOS 4.1.4 sun4m) MIME-Version: 1.0 To: xiyuan qian CC: freebsd-isp@freebsd.org Subject: Re: maximum file descriptors? References: <199710091337.NAA18634@npc.haplink.com.cn> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-isp@freebsd.org X-Loop: FreeBSD.org Precedence: bulk xiyuan qian wrote: > > Hi, Here I have a MUD game running on FreeBSD, when there are more than 59 > users connected in, it will get an error message with appending to a log > file. The source code is as followings: > > if (( fopen(fname,"a") == NULL){ > fprintf(stderr,"Error opening logfile\n") > } It looks like you are a PC windows programmer. Try fprintf(stderr,"Error opening logfile %s (%d)", fname, errno); Which will tell you why the open failed and on what file. The error number will appear in-between the parenthesis, simple type ; grep /usr/include/errno.h to get a textual description of the error. You can go further by (depending on OS) using fprintf(stderr,"Error %s (%s)", fname, sys_errlist[errno]); It is the windows programmers desease to display error messages without any context, rendering them totally useless. Once you know exactly what the error is then you can remedy it, rather than trying lots of things inthe dark hoping one of them is going to fix it. Sorry if it seems like I'm having a go at you but I have to use a lot of PC applications and it drives me up the wall when they pop up error boxes that give no helpful information whatsoever. > > Is there a maximum file descriptors limited? If so, how can I change it? > > My OS is FreeBSD2.1 and the memory is 16M. > > Best regaurds! > > --xiyuan regards damian -- * Damian Hamill M.D. damian@cablenet.net * CableNet & The Landscape Channel * http://www.cablenet.net/ http://www.landscapetv.com/