Skip to content

Commit 515b916

Browse files
authored
Merge pull request #899 from liujinhui-job/add-select-support
Add select interface support
2 parents 2869cbf + 94cc487 commit 515b916

File tree

7 files changed

+400
-0
lines changed

7 files changed

+400
-0
lines changed

adapter/syscall/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ endif
2929
# like linux kernel.
3030
#FF_USE_THREAD_STRUCT_HANDLE=1
3131

32+
# If FF_PRELOAD_SUPPORT_SELECT is enabled, we can use select in LD_PRELOAD mode.
33+
# However, we need to set the value of FF_KERNEL_MAX_FD_SELECT based on our requirements to ensure file descriptors
34+
# (FDs) for the user-space protocol stack can be covered by the select interface.
35+
#FF_PRELOAD_SUPPORT_SELECT=1
36+
#FF_KERNEL_MAX_FD_SELECT=128
37+
3238
PKGCONF ?= pkg-config
3339

3440
ifndef DEBUG
@@ -57,6 +63,10 @@ ifdef FF_USE_THREAD_STRUCT_HANDLE
5763
CFLAGS+= -DFF_USE_THREAD_STRUCT_HANDLE
5864
endif
5965

66+
ifdef FF_PRELOAD_SUPPORT_SELECT
67+
CFLAGS+= -DFF_PRELOAD_SUPPORT_SELECT -DFF_KERNEL_MAX_FD_SELECT=$(FF_KERNEL_MAX_FD_SELECT) -DFF_USE_THREAD_STRUCT_HANDLE
68+
endif
69+
6070
CFLAGS += -fPIC -Wall -Werror $(shell $(PKGCONF) --cflags libdpdk)
6171

6272
INCLUDES= -I. -I${FF_PATH}/lib

adapter/syscall/ff_declare_syscalls.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ FF_SYSCALL_DECL(int, epoll_create, (int));
2828
FF_SYSCALL_DECL(int, epoll_ctl, (int, int, int, struct epoll_event *));
2929
FF_SYSCALL_DECL(int, epoll_wait, (int, struct epoll_event *, int, int));
3030
FF_SYSCALL_DECL(pid_t, fork, (void));
31+
FF_SYSCALL_DECL(int, select, (int , fd_set *, fd_set *, fd_set *, struct timeval *));
3132
#undef FF_SYSCALL_DECL

0 commit comments

Comments
 (0)