diff options
author | Jeremy Allison <jra@samba.org> | 1998-10-16 06:16:10 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1998-10-16 06:16:10 +0000 |
commit | 04d79a9ae515e7259277f9980552f1d61df239f1 (patch) | |
tree | 8d48ab9c72d2e6919192a757b56ac5d63708bfe1 /source/smbd/files.c | |
parent | f69cf05ff56dffb313304964d5bf5e5aee2f40a7 (diff) | |
download | samba-04d79a9ae515e7259277f9980552f1d61df239f1.tar.gz samba-04d79a9ae515e7259277f9980552f1d61df239f1.tar.xz samba-04d79a9ae515e7259277f9980552f1d61df239f1.zip |
Re-added code to tell the user how many open files they
have. Needed for server diagnosis purposes...
Jeremy.
Diffstat (limited to 'source/smbd/files.c')
-rw-r--r-- | source/smbd/files.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/source/smbd/files.c b/source/smbd/files.c index 4030ad4c498..c369a45bab3 100644 --- a/source/smbd/files.c +++ b/source/smbd/files.c @@ -202,13 +202,23 @@ initialise file structures void file_init(void) { - int lim; + int request_max_open_files = lp_max_open_files(); + int real_lim; - lim = set_maxfiles(); - lim = MIN(lim, lp_max_open_files()); + /* + * Set the max_open files to be the requested + * max plus a fudgefactor to allow for the extra + * fd's we need such as log files etc... + */ + real_lim = set_maxfiles(request_max_open_files + MAX_OPEN_FUDGEFACTOR); + + real_max_open_files = real_lim - MAX_OPEN_FUDGEFACTOR; + + if(real_max_open_files != request_max_open_files) { + DEBUG(1,("file_init: Information only: requested %d \ +open files, %d are available.\n", request_max_open_files, real_max_open_files)); + } - real_max_open_files = lim - MAX_OPEN_FUDGEFACTOR; - file_bmap = bitmap_allocate(real_max_open_files); if (!file_bmap) { |