Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 09 Oct 1997 10:56:07 +0100
From:      Damian Hamill <damian@cablenet.net>
To:        xiyuan qian <xiyuan@npc.haplink.com.cn>
Cc:        freebsd-isp@freebsd.org
Subject:   Re: maximum file descriptors?
Message-ID:  <343CAA37.586EAEC@cablenet.net>
References:  <199710091337.NAA18634@npc.haplink.com.cn>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <the error number> /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/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?343CAA37.586EAEC>