-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path023.c
More file actions
27 lines (25 loc) · 1.17 KB
/
023.c
File metadata and controls
27 lines (25 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
..........................................................................................................................................
Name : 023.c
Author : SHRUTI VERMA
Description : Write a program to print the maximum number of files can be opened within a process and
size of a pipe (circular buffer).
Date : 17 Sep 2025
..........................................................................................................................................
*/
#include<unistd.h>
#include<stdlib.h>
#include<stdio.h>
int main() {
long PIPEBUF, OPENMAX;
PIPEBUF = sysconf(_PC_PIPE_BUF); //system configuration : PIPE_BUF
OPENMAX = sysconf(_SC_OPEN_MAX); //System configuration : OPEN_MAX
printf("Maximum size of pipe buffer : %ld\n", PIPEBUF);
printf("Maximum number of files that can be opened : %ld\n", OPENMAX);
}
/*-----------------------------------------OUTPUT-----------------------------------------------
vumma@vumma-VivoBook-15-ASUS-Laptop-X507UF:~/Desktop/SS/HOL2$ gcc 023.c -o 023.out
vumma@vumma-VivoBook-15-ASUS-Laptop-X507UF:~/Desktop/SS/HOL2$ ./023.out
Maximum size of pipe buffer : 16
Maximum number of files that can be opened : 1048576
*/