File tree Expand file tree Collapse file tree
clang/runtime/dpct-rt/include/dpct Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,25 +19,19 @@ namespace dpct {
1919namespace experimental {
2020
2121namespace detail {
22- // / System call number definitions for kernel compatibility.
23- // / SYS_pidfd_open: Process file descriptor opener (requires kernel 5.6+).
24- // / SYS_pidfd_getfd: Cross-process FD fetcher system call.
25- #ifndef SYS_pidfd_open
26- #define SYS_pidfd_open 434
27- #endif
28-
29- #ifndef SYS_pidfd_getfd
30- #define SYS_pidfd_getfd 438
31- #endif
3222
3323// / Covert remote fd to the local fd through IPC handle extension.
3424// / \param [in] ipc_ext_handle The extension of the IPC handle
3525// / \returns Local process file descriptor
3626template <class T > int convert_fd_from_handle (T ipc_ext_handle) {
37- int pidfd = syscall (SYS_pidfd_open, ipc_ext_handle.pid , 0 );
27+ int pidfd = syscall (434 , ipc_ext_handle.pid ,
28+ 0 ); // obtain a file descriptor that refers to a
29+ // process(requires kernel 5.6+).
3830 if (pidfd < 0 )
3931 return -1 ;
40- return syscall (SYS_pidfd_getfd, pidfd, *(int *)ipc_ext_handle.handle .data , 0 );
32+ return syscall (438 , pidfd, *(int *)ipc_ext_handle.handle .data ,
33+ 0 ); // obtain a duplicate of another process's file
34+ // descriptor(requires kernel 5.6+).
4135}
4236
4337} // namespace detail
You can’t perform that action at this time.
0 commit comments