fehQlibs
27
Qlibs
Loading...
Searching...
No Matches
fehQlibs-27
src
fd.c
Go to the documentation of this file.
1
#include <fcntl.h>
2
#include "
fd.h
"
3
10
11
int
close
(
int
__fd);
/* we won't use unistd.h here */
12
13
int
fd_copy
(
int
to,
int
from)
14
{
15
if
(to == from)
return
0;
16
if
(fcntl(from,F_GETFL,0) == -1)
return
-1;
17
close
(to);
18
if
(fcntl(from,F_DUPFD,to) == -1)
return
-1;
19
return
0;
20
}
21
22
int
fd_move
(
int
to,
int
from)
23
{
24
if
(to == from)
return
0;
25
if
(
fd_copy
(to,from) == -1)
return
-1;
26
close
(from);
27
return
0;
28
}
29
30
int
fd_coe
(
int
fd)
31
{
32
return
fcntl(fd,F_SETFD,1);
33
}
fd.h
close
int close(int __fd)
fd_move
int fd_move(int to, int from)
Definition
fd.c:22
fd_copy
int fd_copy(int to, int from)
Definition
fd.c:13
fd_coe
int fd_coe(int fd)
Definition
fd.c:30
Generated on Tue May 27 2025 21:48:00 for fehQlibs by
1.13.2