• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From 189022c0a2438f099caa6cbfcac1a7ca76cf1e71 Mon Sep 17 00:00:00 2001
2From: yangchen <yangchen145@huawei.com>
3Date: Fri, 3 Nov 2023 14:55:15 +0800
4Subject: [PATCH] posix_api: support select
5
6---
7 src/api/posix_api.c     | 1 +
8 src/include/posix_api.h | 1 +
9 2 files changed, 2 insertions(+)
10
11diff --git a/src/api/posix_api.c b/src/api/posix_api.c
12index b7334da..0dc6ad1 100644
13--- a/src/api/posix_api.c
14+++ b/src/api/posix_api.c
15@@ -114,6 +114,7 @@ int posix_api_init(void)
16     CHECK_DLSYM_RET_RETURN(posix_api->sigaction_fn = dlsym(handle, "sigaction"));
17     CHECK_DLSYM_RET_RETURN(posix_api->poll_fn = dlsym(handle, "poll"));
18     CHECK_DLSYM_RET_RETURN(posix_api->ioctl_fn = dlsym(handle, "ioctl"));
19+    CHECK_DLSYM_RET_RETURN(posix_api->select_fn = dlsym(handle, "select"));
20
21     /* lstack helper api */
22     posix_api->get_socket = get_socket;
23diff --git a/src/include/posix_api.h b/src/include/posix_api.h
24index a73e2ec..cde37e3 100644
25--- a/src/include/posix_api.h
26+++ b/src/include/posix_api.h
27@@ -78,6 +78,7 @@ typedef struct {
28     int (*sigaction_fn)(int signum, const struct sigaction *act, struct sigaction *oldact);
29     int (*poll_fn)(struct pollfd *fds, nfds_t nfds, int timeout);
30     int (*ioctl_fn)(int fd, int cmd, ...);
31+    int (*select_fn)(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
32
33     int ues_posix;
34 } posix_api_t;
35--
362.23.0
37
38