Examveda

What is the output of this program?
#include<stdio.h>
#include<sys/time.h>
#include<sys/resource.h>
 
int main()
{
    struct rlimit limit;
    if(getrlimit(RLIMIT_NOFILE,&limit) != 0)
        perror("getrlimit");
    printf("%lu\n",limit.rlim_max);
    return 0;
}

A. this program will print the maximum numbers of the file descriptors that can be opened by a process

B. this program will print the maximum numbers of the child processes of the current process

C. this program will give an error because RLIMIT_NOFILE does not exist

D. none of the mentioned

Answer: Option A


This Question Belongs to Computer Science >> Linux

Join The Discussion

Related Questions on Linux