Sponsored Content
Top Forums Programming maximum number of times - a file can be opened Post 302068680 by matrixmadhan on Monday 20th of March 2006 09:39:26 AM
Old 03-20-2006
maximum number of times - a file can be opened

Hi All,

We can find the maximum of open file descriptors in hold with respect to a process.
As default size was 256 (with getrlimit) and the hard limt was 65536
I tried changing the limit to 1024(with setrlimit)
successfully changed the limit

but still I couldnt have as many open file descriptors as I had mentioned in the setrlimit, I am just pushed off with 256 file descriptors itself.

And one more,
Though the process has limitations on the number of file descriptors it can have, is there any limit imposed indirectly on a file that it can have only 'n' number of active open(s).
(virtually, I think it is not possible). say, File dum.c can be opened only 'Z' no of times.

Any ptrs for the above!!!

Thanks.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

maximum number of input on solaris

Hi, Can anyone tell me what the maximum amount of input characters is on solaris command line? (standard ksh I think) (1 Reply)
Discussion started by: marcello
1 Replies

2. Shell Programming and Scripting

Counting Number of times a File is accessed

Hi, I need to count the number of times a script is accessed from within the script. Is it possible ? Example: I have a script called lo.sh and i execute the script for the first time, then the counter variable declared inside the lo.sh should increment by 1. For every execution the... (1 Reply)
Discussion started by: pathanjalireddy
1 Replies

3. Shell Programming and Scripting

Will the output file be opened and closed several times?

Hi, there, I wrote a script like this: #!/bin/bash #put something into a LIST for item in $LIST do cat $item >> /tmp/output done My question is that if I have 5 items in that LIST, should it be opened and closed every time when the ">>" works? So that file will be opened and... (7 Replies)
Discussion started by: koifans
7 Replies

4. Shell Programming and Scripting

TO find the word which occurs maximum number of times

Hi Folks !!!!!!!!!!!!!!!!!!! My Requirement is............. i have a input file: 501,501.chan 502,502.anand 503,503.biji 504,504.raja 505,505.chan 506,506.anand 507,507.chan and my o/p should be chan->3 i.e. the word which occurs maximum number of times in a file should be... (5 Replies)
Discussion started by: aajan
5 Replies

5. UNIX and Linux Applications

handling maximum number characters in an input file

Hi, Can anyone help me? An input file has three lines. Each line should only be 2098 as number of characters however line 2 of the input file has more than the maximum number of characters, it exceeded up to 4098. What should I do so that could handle maximum number of characters? that it could... (1 Reply)
Discussion started by: chrysSty
1 Replies

6. UNIX for Dummies Questions & Answers

maximum number of arguments

Hi, What is the maximum number of arguments that could be passed to zsh ? To find out that I tried a simple script. And the maximum number of arguments that could be passed turned out to be 23394 #! /bin/zsh arg=1 i=1 subIndex=23000 while do arg=$arg" "$i i=$(($i + 1))... (9 Replies)
Discussion started by: matrixmadhan
9 Replies

7. UNIX for Dummies Questions & Answers

ls - maximum number of files

what is the maximum number ls can list down (6 Replies)
Discussion started by: karnan
6 Replies

8. UNIX for Advanced & Expert Users

Number of files currently opened in linux

Hello, How do i check number of files currently opening in the linux server? Your help is highly appreciated. Thank you ---------- Post updated at 02:43 PM ---------- Previous update was at 02:19 PM ---------- never mind!! I got it. ---------- Post updated at 02:44 PM ---------- Previous... (3 Replies)
Discussion started by: govindts
3 Replies

9. UNIX for Dummies Questions & Answers

how to count number of times each word exist in a file

I'm trying to count the number of times each word in the file exist for example if the file has: today I have a lot to write, but I will not go for it. The main thing is that today I am looking for a way to get each word in this file with a word count after it specifying that this word has... (4 Replies)
Discussion started by: shnkool
4 Replies

10. Shell Programming and Scripting

File exists, but cannot be opened.How to check- whether it could be opened to read when it exists

Hi #Testing for file existence if ; then echo 'SCHOOL data is available for processing' else echo 'SCHOOL DATA IS NOT AVAILABLE FOR PROCESSING' : i wrote a script, where it begins by checking if file exists or not. If it exists, it truncates the database... (2 Replies)
Discussion started by: rxg
2 Replies
getrlimit(2)							System Calls Manual						      getrlimit(2)

NAME
getrlimit(), setrlimit() - control maximum resource consumption SYNOPSIS
DESCRIPTION
Limits on the consumption of a variety of resources by the calling process may be obtained with and set with Each call to either or identi- fies a specific resource to be operated upon as well as a resource limit. A resource limit is represented by an structure, pointed to by the rlp argument and includes the following members: rlim_t rlim_cur; /* Current (soft) limit */ rlim_t rlim_max; /* Hard limit */ The member specifies the current or soft limit and the member specifies the maximum or hard limit. Soft limits may be changed by a process to any value that is less than or equal to the hard limit. A process may (irreversibly) lower its hard limit to any value that is greater than or equal to the soft limit. Only a process with appropriate privileges can raise a hard limit. Both hard and soft limits can be changed in a single call to subject to the constraints described above. The value defined in is considered to be larger than any other limit value. If a call to returns for a resource, it means the implementa- tion does not enforce limits on that resource. Specifying as any resource limit value on a successful call to inhibits enforcement of that resource limit. The following resources are defined: This is the maximum size of a core file in bytes that may be created by a process. A limit of 0 will prevent the creation of a core file. If this limit is exceeded, the writing of a core file will terminate at this size. This is the maximum amount of CPU time in seconds used by a process. If this limit is exceeded, is generated for the process. The default action is to kill the process and leave a core file. This is the maximum size of a process data segment in bytes. If this limit is exceeded, the and functions will fail with set to ENOMEM. The upper limit is enforced through the tunable However setting to will delay the upper limit enforcement until the resource is allocated for the applica- tion. This is the maximum size of a file in bytes that may be created by a process. A limit of 0 will prevent the creation of a file. If a write or truncate operation would cause this limit to be exceeded, is generated for the process. If the process is blocking, catching or ignoring continued attempts to increase the size of a file from end-of-file to beyond the limit will fail with set to This is a number one greater than the maximum value that the system may assign to a newly-created descriptor. If this limit is exceeded, functions that allocate new file descriptors may fail with set to This limit constrains the number of file descriptors that a process may allocate. This is the maximum size of a process stack in bytes. The implementation will not automatically grow the stack beyond this limit. If this limit is exceeded, is generated for the process. If the process is blocking or ignoring or is catching and has not made arrangements to use an alternate stack, the disposition of will be set to before it is generated. The upper limit is enforced through the tunable However setting to will delay the upper limit enforcement until the resource is allocated for the applica- tion. This is the maximum size of a process's total available memory, in bytes. If this limit is exceeded, the and functions will fail with set to In addition, the automatic stack growth will fail with the effects outlined above. This is the maximum number of POSIX Asynchronous I/O operations that a process can have enqueued simultaneously. If this limit is exceeded, the and functions will fail with set to This is the maximum number of bytes of memory that can be locked simultaneously by POSIX Asynchronous I/O requests from a single process. Security Restrictions Raising hard limits with the call requires the privilege (PRIV_LIMIT). Processes owned by the superuser have this privilege. Processes owned by other users may have this privilege, depending on system configuration. See privileges(5) for more information about privileged access on systems that support fine-grained privileges. RETURN VALUE
Upon successful completion, and return 0. Otherwise, these functions return -1 and set to indicate the error. ERRORS
The and functions will fail if: The address specified for rlp is invalid. Reliable detection of this error is implementation dependent. An invalid resource was specified; or in a call, the new rlim_cur exceeds the new rlim_max. The limit specified to would have raised the maximum limit value, and the calling process does not have appropriate privileges. The function may fail if: The limit specified cannot be lowered because current usage is already higher than the limit. A user with appropriate privileges has attempted to raise rlp->rlim_cur or rlp->rlim_max to a value greater than the system is capable of supporting. The value of rlp->rlim_cur is less than the number of file descriptors the process already has allocated. The value of rlp->rlim_max is less than the current soft limit. The rlp argument specified a hard or soft limit higher than the current hard limit value, and the caller does not have the appropriate privileges. WARNINGS
The maximum size of a file returned by is in terms of bytes. The maximum size of a file returned by (see ulimit(2)) with is in terms of blocks of size 512 bytes. The value returned by with may thus have to be rounded down to a multiple of 512. The total address space used by a process depends on the platform it is run on. When porting applications, limits set by with may need to be adjusted. For example, programs tend to use more memory on systems than on PA-RISC systems. AUTHOR
and were developed by HP, AT&T, and the University of California, Berkeley. SEE ALSO
brk(2), creat64(2), exec(2), fork(2), open(2), sigaltstack(2), sysconf(2), ulimit(2), malloc(3C), maxdsiz(5), maxssiz(5). getrlimit(2)
All times are GMT -4. The time now is 08:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy