-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainmultifd.c
77 lines (75 loc) · 1.7 KB
/
mainmultifd.c
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#include "get_next_line.h"
#include "libft.h"
#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
int main(int ac, char **av)
{
int fd;
int fd2;
char *line;
int i;
fd = open(av[1], O_RDONLY);
fd2 = open(av[2], O_RDONLY);
i = get_next_line((int const)fd, &line);
ft_putendl(line);
free(line);
i = get_next_line((int const)fd2, &line);
ft_putendl(line);
free(line);
i = get_next_line((int const)fd2, &line);
ft_putendl(line);
free(line);
i = get_next_line((int const)fd, &line);
ft_putendl(line);
free(line);
i = get_next_line((int const)fd2, &line);
ft_putendl(line);
free(line);
i = get_next_line((int const)fd, &line);
ft_putendl(line);
free(line);
i = get_next_line((int const)fd2, &line);
ft_putendl(line);
free(line);
i = get_next_line((int const)fd, &line);
ft_putendl(line);
free(line);
i = get_next_line((int const)fd2, &line);
ft_putendl(line);
free(line);
i = get_next_line((int const)fd, &line);
ft_putendl(line);
free(line);
i = get_next_line((int const)fd2, &line);
ft_putendl(line);
free(line);
i = get_next_line((int const)fd, &line);
ft_putendl(line);
free(line);
i = get_next_line((int const)fd2, &line);
ft_putendl(line);
free(line);
i = get_next_line((int const)fd, &line);
ft_putendl(line);
free(line);
i = get_next_line((int const)fd2, &line);
ft_putendl(line);
free(line);
i = get_next_line((int const)fd, &line);
ft_putendl(line);
free(line);
i = get_next_line((int const)fd2, &line);
ft_putendl(line);
free(line);
i = get_next_line((int const)fd, &line);
ft_putendl(line);
free(line);
i = get_next_line((int const)fd2, &line);
ft_putendl(line);
free(line);
getchar();
return (1);
}