POSIX compliant program to check the following limits: (i) No. of clock ticks (ii) Max. no. of child processes (iii) Max. path length (iv) Max. no. of characters in a file name (v) Max. no. of open files/ process
#define _POSIX_SOURCE #define _POSIX_C_SOURCE 199309L #include<stdio.h> #include<unistd.h> int main() { int res; if((res = sysconf(_SC_OPEN_MAX)) == -1) perror(“sysconf”); else printf(“OPEN_MAX:%d\n”,res); if((res = pathconf(“/”, _PC_NAME_MAX)) == -1) perror(“pathconf”); else printf(“max_path name:%d\n”,res); if((res = sysconf(_SC_CLK_TCK))== -1) perror(“sysconf”); else printf(“clock ticks:%d\n”,res); if((res = sysconf (_SC_CHILD_MAX)) == -1) perror(“sysconf”); else printf(“max_childs:%d\n”,(res)); if((res = pathconf(“/”,_PC_PATH_MAX)) == -1) perror(“pathconf”); else printf(“max […]






