Skip to content

Commit 7802385

Browse files
committed
Add some comments.
1 parent 55a84f3 commit 7802385

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

lib/ff_syscall_wrapper.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,6 +1122,7 @@ ff_close(int fd)
11221122
goto kern_fail;
11231123

11241124
#ifdef FF_KERNEL_COEXIST
1125+
/* Try to close the socket fd or epoll fd respectively */
11251126
if (ff_global_cfg.stack.kernel_coexist) {
11261127
int hfd = ff_native_map_get(fd);
11271128
if (hfd > 0) {
@@ -1571,6 +1572,11 @@ ff_accept(int s, struct linux_sockaddr * addr,
15711572

15721573
if ((rc = kern_accept(curthread, s, pf, &fp))) {
15731574
#ifdef FF_KERNEL_COEXIST
1575+
/*
1576+
* Here, we first attempt to accept the socket fd from the f-stack every time. If none is available,
1577+
* we will then attempt to accept the socket fd from the kernel. This is different from LD_PRELOAD,
1578+
* which obtains different fds by calling socket twice, but we cannot distinguish between them here?待定,开epoll是否可以区分
1579+
*/
15741580
if ((rc == EAGAIN || rc == EWOULDBLOCK) &&
15751581
ff_global_cfg.stack.kernel_coexist) {
15761582
int hfd = ff_native_map_get(s);

0 commit comments

Comments
 (0)