• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <unistd.h>
2 #include "syscall.h"
3 #ifdef OHOS_FDTRACK_HOOK_ENABLE
4 #include "musl_fdtrack_hook.h"
5 #endif
6 
7 
pipe(int fd[2])8 int pipe(int fd[2])
9 {
10 	int r = 0;
11 #ifdef SYS_pipe
12 	r = syscall(SYS_pipe, fd);
13 #else
14 	r = syscall(SYS_pipe2, fd, 0);
15 #endif
16 
17 #ifdef OHOS_FDTRACK_HOOK_ENABLE
18 	if (!r) {
19 		FDTRACK_START_HOOK(fd[0]);
20 		FDTRACK_START_HOOK(fd[1]);
21 	}
22 #endif
23 	return r;
24 }
25