Consider I have a process called a.out
, In that process, i have opened the 10 files using a open()
function.
Consider that time I get the last descriptor is 13. So I need to know is there is any way to find the last opened descriptor in the process.
For that I am using a getrlimit
like this
if(getrlimit(RLIMIT_NOFILE,&r1)<0)
perror("error");
But when I am priting this I get 4096 in my system. SO Is there is any way to do this?