no files can be opened in a C program
What is the Max no of files that can be opened simultaneously within a Single C program. i want this information for kenel compilation
On Mon, Jul 25, 2011 at 12:31 PM, Venkateswarlu P <p.venkatesh551@gmail.com>wrote:
What is the Max no of files that can be opened simultaneously within a Single C program.
i want this information for kenel compilation
See man 3 setrlimit
Total number of files that can be opened should depend on file system. And what this has to do with kernel compilation?
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
You can use command ulimit -a, there you can check the limit for a process. Thanks, Naveen On Mon, Jul 25, 2011 at 5:18 PM, Anuz Pratap Singh Tomar < chambilkethakur@gmail.com> wrote:
On Mon, Jul 25, 2011 at 12:31 PM, Venkateswarlu P < p.venkatesh551@gmail.com> wrote:
What is the Max no of files that can be opened simultaneously within a Single C program.
i want this information for kenel compilation
See man 3 setrlimit
Total number of files that can be opened should depend on file system. And what this has to do with kernel compilation?
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
On 07/25/2011 05:29 PM, Naveen Kumar wrote:
You can use command ulimit -a, there you can check the limit for a process.
Thanks, Naveen Ulimit gives 1024 as open file limit. In struct task_struct it has a member called struct files_struct *files;
I tried checking for this member and the limit however I am not able to decide correctly why the limit is 1024. Also, is there any distinction between 32 bit and 64 bit systems for this limit?
On Mon, Jul 25, 2011 at 5:18 PM, Anuz Pratap Singh Tomar <chambilkethakur@gmail.com <mailto:chambilkethakur@gmail.com>> wrote:
On Mon, Jul 25, 2011 at 12:31 PM, Venkateswarlu P <p.venkatesh551@gmail.com <mailto:p.venkatesh551@gmail.com>> wrote:
What is the Max no of files that can be opened simultaneously within a Single C program.
i want this information for kenel compilation
See man 3 setrlimit Total number of files that can be opened should depend on file system. And what this has to do with kernel compilation?
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org <mailto:Kernelnewbies@kernelnewbies.org> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org <mailto:Kernelnewbies@kernelnewbies.org> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies Regards, Abhijit
Hi Abhijit, On Mon, Jul 25, 2011 at 6:35 AM, Abhijit Pawar <apawar.linux@gmail.com> wrote:
On 07/25/2011 05:29 PM, Naveen Kumar wrote:
You can use command ulimit -a, there you can check the limit for a process.
Thanks, Naveen
Ulimit gives 1024 as open file limit. In struct task_struct it has a member called struct files_struct *files;
I tried checking for this member and the limit however I am not able to decide correctly why the limit is 1024. Also, is there any distinction between 32 bit and 64 bit systems for this limit?
My 64-bit system reports 1024 as well. I have no troubles compiling kernels. -- Dave Hylands Shuswap, BC, Canada http://www.davehylands.com
Hi Dave, On 07/25/2011 09:20 PM, Dave Hylands wrote:
Hi Abhijit,
On Mon, Jul 25, 2011 at 6:35 AM, Abhijit Pawar<apawar.linux@gmail.com> wrote:
On 07/25/2011 05:29 PM, Naveen Kumar wrote:
You can use command ulimit -a, there you can check the limit for a process.
Thanks, Naveen
Ulimit gives 1024 as open file limit. In struct task_struct it has a member called struct files_struct *files;
I tried checking for this member and the limit however I am not able to decide correctly why the limit is 1024. Also, is there any distinction between 32 bit and 64 bit systems for this limit? My 64-bit system reports 1024 as well.
I have no troubles compiling kernels.
Thanks. Yes, on my 64 bit Fedora 15 I get same value as yours. What I am interested in is knowing why the limit is on 1024 File Descriptors? That means 1024 Inodes. AFAIK there isnt anything written in filesystem code which will put this limit of 1024 inodes for a process. This means its very specific to the process. Unfortunately I am know having details on the process front. Is there anything which you or anyone aware in process area because of which this limit is there? Thanks again. Regards, Abhijit Pawar.
On Mon, Jul 25, 2011 at 9:29 PM, Abhijit Pawar <apawar.linux@gmail.com> wrote:
Hi Dave, On 07/25/2011 09:20 PM, Dave Hylands wrote:
Hi Abhijit,
On Mon, Jul 25, 2011 at 6:35 AM, Abhijit Pawar<apawar.linux@gmail.com> wrote:
On 07/25/2011 05:29 PM, Naveen Kumar wrote:
You can use command ulimit -a, there you can check the limit for a process.
Thanks, Naveen
Ulimit gives 1024 as open file limit. In struct task_struct it has a member called struct files_struct *files;
I tried checking for this member and the limit however I am not able to decide correctly why the limit is 1024. Also, is there any distinction between 32 bit and 64 bit systems for this limit? My 64-bit system reports 1024 as well.
I have no troubles compiling kernels.
Thanks. Yes, on my 64 bit Fedora 15 I get same value as yours.
What I am interested in is knowing why the limit is on 1024 File Descriptors? That means 1024 Inodes. AFAIK there isnt anything written in filesystem code which will put this limit of 1024 inodes for a process. This means its very specific to the process. Unfortunately I am know having details on the process front. Is there anything which you or anyone aware in process area because of which this limit is there?
man getdtablesize -- Thanks - Manish
On Mon, Jul 25, 2011 at 9:41 PM, Manish Katiyar <mkatiyar@gmail.com> wrote:
On Mon, Jul 25, 2011 at 9:29 PM, Abhijit Pawar <apawar.linux@gmail.com> wrote:
Hi Dave, On 07/25/2011 09:20 PM, Dave Hylands wrote:
Hi Abhijit,
On Mon, Jul 25, 2011 at 6:35 AM, Abhijit Pawar<apawar.linux@gmail.com> wrote:
On 07/25/2011 05:29 PM, Naveen Kumar wrote:
You can use command ulimit -a, there you can check the limit for a process.
Thanks, Naveen
Ulimit gives 1024 as open file limit. In struct task_struct it has a member called struct files_struct *files;
I tried checking for this member and the limit however I am not able to decide correctly why the limit is 1024. Also, is there any distinction between 32 bit and 64 bit systems for this limit? My 64-bit system reports 1024 as well.
I have no troubles compiling kernels.
Thanks. Yes, on my 64 bit Fedora 15 I get same value as yours.
What I am interested in is knowing why the limit is on 1024 File Descriptors? That means 1024 Inodes. AFAIK there isnt anything written in filesystem code which will put this limit of 1024 inodes for a process. This means its very specific to the process. Unfortunately I am know having details on the process front. Is there anything which you or anyone aware in process area because of which this limit is there?
man getdtablesize
and if you trace the kernel code, it comes from the limits of the init task, which is hard coded during creation. You can get/set these values using getrlimit/setrlimit. include/linux/init_task.h 33 #define INIT_SIGNALS(sig) { \ ................. ................. 41 .rlim = INIT_RLIMITS, .............. include/asm-generic/resource.h 72 #define INIT_RLIMITS \ 73 { \ 74 [RLIMIT_CPU] = { RLIM_INFINITY, RLIM_INFINITY }, \ 75 [RLIMIT_FSIZE] = { RLIM_INFINITY, RLIM_INFINITY }, \ 76 [RLIMIT_DATA] = { RLIM_INFINITY, RLIM_INFINITY }, \ 77 [RLIMIT_STACK] = { _STK_LIM, _STK_LIM_MAX }, \ 78 [RLIMIT_CORE] = { 0, RLIM_INFINITY }, \ 79 [RLIMIT_RSS] = { RLIM_INFINITY, RLIM_INFINITY }, \ 80 [RLIMIT_NPROC] = { 0, 0 }, \ 81 [RLIMIT_NOFILE] = { INR_OPEN_CUR, INR_OPEN_MAX }, \ ............... .............. include/linux/fs.h 25 #undef NR_OPEN 26 #define INR_OPEN_CUR 1024 /* Initial setting for nfile rlimits */ 27 #define INR_OPEN_MAX 4096 /* Hard limit for nfile rlimits */ HTH -- Thanks - Manish
Hi Manish, On 07/26/2011 10:22 AM, Manish Katiyar wrote:
On Mon, Jul 25, 2011 at 9:41 PM, Manish Katiyar<mkatiyar@gmail.com> wrote:
On Mon, Jul 25, 2011 at 9:29 PM, Abhijit Pawar<apawar.linux@gmail.com> wrote:
Hi Dave, On 07/25/2011 09:20 PM, Dave Hylands wrote:
Hi Abhijit,
On Mon, Jul 25, 2011 at 6:35 AM, Abhijit Pawar<apawar.linux@gmail.com> wrote:
On 07/25/2011 05:29 PM, Naveen Kumar wrote:
You can use command ulimit -a, there you can check the limit for a process.
Thanks, Naveen
Ulimit gives 1024 as open file limit. In struct task_struct it has a member called struct files_struct *files;
I tried checking for this member and the limit however I am not able to decide correctly why the limit is 1024. Also, is there any distinction between 32 bit and 64 bit systems for this limit? My 64-bit system reports 1024 as well.
I have no troubles compiling kernels.
Thanks. Yes, on my 64 bit Fedora 15 I get same value as yours.
What I am interested in is knowing why the limit is on 1024 File Descriptors? That means 1024 Inodes. AFAIK there isnt anything written in filesystem code which will put this limit of 1024 inodes for a process. This means its very specific to the process. Unfortunately I am know having details on the process front. Is there anything which you or anyone aware in process area because of which this limit is there? man getdtablesize and if you trace the kernel code, it comes from the limits of the init task, which is hard coded during creation. You can get/set these values using getrlimit/setrlimit.
include/linux/init_task.h 33 #define INIT_SIGNALS(sig) { \ ................. ................. 41 .rlim = INIT_RLIMITS, ..............
include/asm-generic/resource.h 72 #define INIT_RLIMITS \ 73 { \ 74 [RLIMIT_CPU] = { RLIM_INFINITY, RLIM_INFINITY }, \ 75 [RLIMIT_FSIZE] = { RLIM_INFINITY, RLIM_INFINITY }, \ 76 [RLIMIT_DATA] = { RLIM_INFINITY, RLIM_INFINITY }, \ 77 [RLIMIT_STACK] = { _STK_LIM, _STK_LIM_MAX }, \ 78 [RLIMIT_CORE] = { 0, RLIM_INFINITY }, \ 79 [RLIMIT_RSS] = { RLIM_INFINITY, RLIM_INFINITY }, \ 80 [RLIMIT_NPROC] = { 0, 0 }, \ 81 [RLIMIT_NOFILE] = { INR_OPEN_CUR, INR_OPEN_MAX }, \ ............... ..............
include/linux/fs.h 25 #undef NR_OPEN 26 #define INR_OPEN_CUR 1024 /* Initial setting for nfile rlimits */ 27 #define INR_OPEN_MAX 4096 /* Hard limit for nfile rlimits */
HTH This is really helpful. Thanks.
Regards, Abhijit Pawar
participants (6)
-
Abhijit Pawar -
Anuz Pratap Singh Tomar -
Dave Hylands -
Manish Katiyar -
Naveen Kumar -
Venkateswarlu P