1195972f6Sopenharmony_ciFrom 189022c0a2438f099caa6cbfcac1a7ca76cf1e71 Mon Sep 17 00:00:00 2001
2195972f6Sopenharmony_ciFrom: yangchen <yangchen145@huawei.com>
3195972f6Sopenharmony_ciDate: Fri, 3 Nov 2023 14:55:15 +0800
4195972f6Sopenharmony_ciSubject: [PATCH] posix_api: support select
5195972f6Sopenharmony_ci
6195972f6Sopenharmony_ci---
7195972f6Sopenharmony_ci src/api/posix_api.c     | 1 +
8195972f6Sopenharmony_ci src/include/posix_api.h | 1 +
9195972f6Sopenharmony_ci 2 files changed, 2 insertions(+)
10195972f6Sopenharmony_ci
11195972f6Sopenharmony_cidiff --git a/src/api/posix_api.c b/src/api/posix_api.c
12195972f6Sopenharmony_ciindex b7334da..0dc6ad1 100644
13195972f6Sopenharmony_ci--- a/src/api/posix_api.c
14195972f6Sopenharmony_ci+++ b/src/api/posix_api.c
15195972f6Sopenharmony_ci@@ -114,6 +114,7 @@ int posix_api_init(void)
16195972f6Sopenharmony_ci     CHECK_DLSYM_RET_RETURN(posix_api->sigaction_fn = dlsym(handle, "sigaction"));
17195972f6Sopenharmony_ci     CHECK_DLSYM_RET_RETURN(posix_api->poll_fn = dlsym(handle, "poll"));
18195972f6Sopenharmony_ci     CHECK_DLSYM_RET_RETURN(posix_api->ioctl_fn = dlsym(handle, "ioctl"));
19195972f6Sopenharmony_ci+    CHECK_DLSYM_RET_RETURN(posix_api->select_fn = dlsym(handle, "select"));
20195972f6Sopenharmony_ci 
21195972f6Sopenharmony_ci     /* lstack helper api */
22195972f6Sopenharmony_ci     posix_api->get_socket = get_socket;
23195972f6Sopenharmony_cidiff --git a/src/include/posix_api.h b/src/include/posix_api.h
24195972f6Sopenharmony_ciindex a73e2ec..cde37e3 100644
25195972f6Sopenharmony_ci--- a/src/include/posix_api.h
26195972f6Sopenharmony_ci+++ b/src/include/posix_api.h
27195972f6Sopenharmony_ci@@ -78,6 +78,7 @@ typedef struct {
28195972f6Sopenharmony_ci     int (*sigaction_fn)(int signum, const struct sigaction *act, struct sigaction *oldact);
29195972f6Sopenharmony_ci     int (*poll_fn)(struct pollfd *fds, nfds_t nfds, int timeout);
30195972f6Sopenharmony_ci     int (*ioctl_fn)(int fd, int cmd, ...);
31195972f6Sopenharmony_ci+    int (*select_fn)(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
32195972f6Sopenharmony_ci 
33195972f6Sopenharmony_ci     int ues_posix;
34195972f6Sopenharmony_ci } posix_api_t;
35195972f6Sopenharmony_ci-- 
36195972f6Sopenharmony_ci2.23.0
37195972f6Sopenharmony_ci
38