Home
last modified time | relevance | path

Searched refs:fds (Results 1 – 25 of 96) sorted by relevance

1234

/ohos5.0/base/notification/eventhandler/frameworks/test/moduletest/
H A Devent_handler_fd_listener_module_test.cpp152 int32_t fds[] = {-1, -1}; variable
206 int32_t fds[] = {-1, -1}; variable
231 int32_t fds[] = {-1, -1}; variable
255 int32_t fds[] = {-1, -1}; variable
279 int32_t fds[] = {-1, -1}; variable
313 int32_t fds[] = {-1, -1}; variable
347 int32_t fds[] = {-1, -1}; variable
363 auto f = [fds]() { close(fds[1]); }; in __anonacf6d8060302()
384 int32_t fds[] = {-1, -1}; variable
414 int32_t fds[] = {-1, -1}; variable
[all …]
/ohos5.0/base/startup/init/services/init/standard/
H A Dfd_holder_service.c28 static void FreeFds(int *fds) in FreeFds() argument
30 if (fds != NULL) { in FreeFds()
31 free(fds); in FreeFds()
110 if (fds == NULL) { in CloseFds()
114 close(fds[i]); in CloseFds()
135 CloseFds(fds, fdCount); in HandlerFdHolder()
136 FreeFds(fds); in HandlerFdHolder()
148 CloseFds(fds, fdCount); in HandlerFdHolder()
149 FreeFds(fds); in HandlerFdHolder()
160 CloseFds(fds, fdCount); in HandlerFdHolder()
[all …]
/ohos5.0/base/startup/init/interfaces/innerkits/fd_holder/
H A Dfd_holder.c94 if (BuildControlMessage(&msghdr, fds, fdCount, true) < 0) { in ServiceSendFds()
125 int ServiceSaveFd(const char *serviceName, int *fds, int fdCount) in ServiceSaveFd() argument
128 if (serviceName == NULL || fds == NULL || in ServiceSaveFd()
133 return ServiceSendFds(serviceName, fds, fdCount, false); in ServiceSaveFd()
139 if (serviceName == NULL || fds == NULL || in ServiceSaveFdWithPoll()
144 return ServiceSendFds(serviceName, fds, fdCount, true); in ServiceSaveFdWithPoll()
171 int *fds = calloc((size_t)fdCount, sizeof(int)); in ServiceGetFd() local
180 fds[i] = (int)strtol(fdList[i], NULL, DECIMAL_BASE); in ServiceGetFd()
186 free(fds); in ServiceGetFd()
187 fds = NULL; in ServiceGetFd()
[all …]
H A Dfd_holder_internal.c26 int BuildControlMessage(struct msghdr *msghdr, int *fds, int fdCount, bool sendUcred) in BuildControlMessage() argument
28 if (msghdr == NULL || (fdCount > 0 && fds == NULL)) { in BuildControlMessage()
54 int ret = memcpy_s(CMSG_DATA(cmsg), cmsg->cmsg_len, fds, sizeof(int) * fdCount); in BuildControlMessage()
87 int *fds = NULL; in GetFdsFromMsg() local
91 fds = (int*)CMSG_DATA(cmsg); in GetFdsFromMsg()
106 if (fds != NULL && fdCount > 0) { in GetFdsFromMsg()
109 … BEGET_ERROR_CHECK(memcpy_s(outFds, sizeof(int) * (fdCount + 1), fds, sizeof(int) * fdCount) == 0, in GetFdsFromMsg()
/ohos5.0/base/startup/init/test/exec_test/
H A Dfd_holder_test.c31 int fds[10]; in SaveFds() local
35fds[i] = open(argv[i], O_APPEND | O_RDWR | O_CREAT | O_TRUNC | O_CLOEXEC, S_IRUSR|S_IWUSR|S_IRGRP|… in SaveFds()
36 if (fds[i] < 0) { in SaveFds()
40 (void)write(fds[i], "hello", BUFFER_LENGTH); in SaveFds()
48 int ret = ServiceSaveFd(serviceName, fds, (size_t)fdCount); in SaveFds()
60 int *fds = ServiceGetFd("fd_holder_test", &outfdCount); in main() local
61 if (fds == NULL) { in main()
65 int fd = fds[i]; in main()
71 free(fds); in main()
/ohos5.0/base/time/time_service/services/timer/src/
H A Dtimer_handler.cpp43 TimerFds fds; in Create() local
45 epollfd = epoll_create(fds.size()); in Create()
48 static_cast<int>(fds.size()), strerror(errno)); in Create()
52 for (size_t i = 0; i < fds.size(); i++) { in Create()
53 fds[i] = timerfd_create(alarm_to_clock_id[i], 0); in Create()
54 if (fds[i] < 0) { in Create()
59 close(fds[j]); in Create()
66 for (size_t i = 0; i < fds.size(); i++) { in Create()
71 int err = epoll_ctl(epollfd, EPOLL_CTL_ADD, fds[i], &event); in Create()
88 TimerHandler::TimerHandler(const TimerFds &fds, int epollfd) in TimerHandler() argument
[all …]
/ohos5.0/foundation/ability/ability_runtime/interfaces/inner_api/app_manager/src/appmgr/
H A Dchild_process_args.cpp45 fds.emplace(key, fd); in ReadFromParcel()
64 WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(Int32, parcel, fds.size()); in Marshalling()
73 for (auto &item : fds) { in Marshalling()
88 TAG_LOGD(AAFwkTag::APPMGR, "CheckFdsSize: %{public}zu", fds.size()); in CheckFdsSize()
89 if (fds.size() > CHILD_PROCESS_ARGS_FDS_MAX_COUNT) { in CheckFdsSize()
98 for (auto iter = fds.begin(); iter != fds.end(); iter++) { in CheckFdsKeyLength()
/ohos5.0/base/msdp/device_status/rust/modules/scheduler/test/src/
H A Dlib.rs37 fds: [RawFd; 2], field
46 … libc::write(self.fds[1], std::ptr::addr_of!(data) as *const c_void, std::mem::size_of_val(&data)) in signal()
55 self.fds[0] in fd()
65 … libc::read(self.fds[0], std::ptr::addr_of!(data) as *mut c_void, std::mem::size_of_val(&data)) in dispatch()
70 … info!(LOG_LABEL, "EpollHandlerImpl::dispatch({}), data:{}", @public(self.fds[0]), @public(data)); in dispatch()
84 for fd in &mut self.fds { in drop()
101 let mut fds: [c_int; 2] = [-1; 2]; in new() localVariable
103 let ret = unsafe { libc::pipe2(fds.as_mut_ptr(), libc::O_CLOEXEC | libc::O_NONBLOCK) }; in new()
107 debug!(LOG_LABEL, "In EpollHandler::new, fds:({},{})", @public(fds[0]), @public(fds[1])); in new()
110 fds, in new()
/ohos5.0/base/hiviewdfx/hiview/framework/native/unified_collection/collector/
H A Dhilog_collector_impl.cpp66 int fds[2] = {-1, -1}; // 2: one read pipe, one write pipe in CollectLastLog() local
67 if (pipe(fds) != 0) { in CollectLastLog()
79 close(fds[0]); in CollectLastLog()
81 ExecuteHilog(pid, lineNum > MAX_LINE_NUM ? MAX_LINE_NUM : lineNum, fds[1]); in CollectLastLog()
83 close(fds[1]); in CollectLastLog()
84 ReadHilog(fds[0], result.data); in CollectLastLog()
/ohos5.0/base/notification/eventhandler/frameworks/eventhandler/test/unittest/
H A Dlib_event_handler_event_queue_test.cpp1017 close(fds[0]);
1018 close(fds[1]);
1076 close(fds[0]);
1077 close(fds[1]);
1150 close(fds[0]);
1151 close(fds[1]);
1185 close(fds[0]);
1186 close(fds[1]);
1222 close(fds[0]);
1223 close(fds[1]);
[all …]
/ohos5.0/foundation/graphic/graphic_surface/buffer_handle/test/unittest/
H A Dbuffer_handle_test.cpp46 uint32_t fds = 1025, ints = 1025; variable
48 ASSERT_EQ(nullptr, AllocateBufferHandle(fds, ints));
49 ASSERT_EQ(nullptr, AllocateBufferHandle(fds, buffer_handle_reserve_max_size));
65 uint32_t fds = 1025, ints = 1025; variable
67 auto test1 = AllocateBufferHandle(fds, ints);
70 auto test2 = AllocateBufferHandle(fds, testsize);
/ohos5.0/foundation/communication/dsoftbus/components/nstackx/nstackx_core/platform/liteos/dfile/
H A Dsys_dfile.c31 struct EpollDescStr fds; in CreateReceiverPipe() local
33 if (CreateEpollFdPair(&fds) != NSTACKX_EOK) { in CreateReceiverPipe()
36 session->receiverPipe[PIPE_OUT] = fds.recvFd; in CreateReceiverPipe()
37 session->receiverPipe[PIPE_IN] = fds.sendFd; in CreateReceiverPipe()
/ohos5.0/commonlibrary/rust/ylong_runtime/ylong_io/src/sys/unix/uds/
H A Dsocket.rs82 let mut fds = [-1; 2]; in pair() localVariable
83 syscall!(socketpair(AF_UNIX, socket_type, 0, fds.as_mut_ptr()))?; in pair()
87 set_non_block(fds[0])?; in pair()
88 set_non_block(fds[1])?; in pair()
91 Ok(unsafe { (T::from_raw_fd(fds[0]), T::from_raw_fd(fds[1])) }) in pair()
/ohos5.0/docs/zh-cn/application-dev/reference/apis-ability-kit/
H A Djs-apis-app-ability-childProcessArgs.md24fds | Record<string, number> | 否 | 文件描述符句柄集合,用于主进程和子进程通信,通过key-value的形式传入到子进程中,其中key为自定义…
40 fds: {
55 let fd = args?.fds?.key1;
/ohos5.0/base/startup/init/services/init/
H A Dinit_common_service.c325 int *fds = service->fds; in CloseServiceFds() local
328 if (fds[i] != -1) { in CloseServiceFds()
329 close(fds[i]); in CloseServiceFds()
330 fds[i] = -1; in CloseServiceFds()
336 free(service->fds); in CloseServiceFds()
337 service->fds = NULL; in CloseServiceFds()
885 if (memcpy_s(service->fds, sizeof(int) * (fdCount + 1), fds, sizeof(int) * fdCount) != 0) { in UpdaterServiceFds()
888 free(service->fds); in UpdaterServiceFds()
889 service->fds = NULL; in UpdaterServiceFds()
902 if (service->fds == NULL) { in UpdaterServiceFds()
[all …]
/ohos5.0/base/startup/init/test/unittest/innerkits/
H A Dinnerkits_unittest.cpp422 int *fds = nullptr; variable
435 EXPECT_NE(fds, nullptr);
443 BuildControlMessage(&msghdr, fds, -1, 0);
448 BuildControlMessage(&msghdr, fds, -1, 1);
453 if (fds != nullptr)
455 free(fds);
456 fds = nullptr;
463 int *fds = nullptr; variable
476 if (fds != nullptr)
478 free(fds);
[all …]
/ohos5.0/foundation/filemanagement/file_api/interfaces/kits/js/src/mod_fs/class_watcher/
H A Dwatcher_entity.cpp186 struct pollfd fds[2]; in GetNotifyEvent() local
187 fds[0].fd = eventFd_; in GetNotifyEvent()
188 fds[0].events = 0; in GetNotifyEvent()
189 fds[1].fd = notifyFd_; in GetNotifyEvent()
190 fds[1].events = POLLIN; in GetNotifyEvent()
193 ret = poll(fds, nfds, -1); in GetNotifyEvent()
195 if (static_cast<unsigned short>(fds[0].revents) & POLLNVAL) { in GetNotifyEvent()
199 if (static_cast<unsigned short>(fds[1].revents) & POLLIN) { in GetNotifyEvent()
/ohos5.0/foundation/ability/ability_runtime/frameworks/js/napi/inner/napi_common/
H A Dnapi_common_child_process_param.cpp46 if (!UnwrapChildProcessFds(env, jsFds, args.fds, errorMsg)) { in UnwrapChildProcessArgs()
122 auto &fds = args.fds; in WrapChildProcessArgs() local
123 for (auto iter = fds.begin(); iter != fds.end(); iter++) { in WrapChildProcessArgs()
/ohos5.0/base/security/security_guard/test/unittest/risk_collect/src/
H A Drisk_collect_test.cpp76 MOCK_METHOD3(Poll, int(struct pollfd* const fds, nfds_t fdCount, int timeout));
134 [] (struct pollfd* const fds, nfds_t fdCount, int timeout) -> int { in __anon8dea7afb0102() argument
135 fds->revents = -1; in __anon8dea7afb0102()
138 [] (struct pollfd* const fds, nfds_t fdCount, int timeout) -> int { in __anon8dea7afb0202() argument
139 fds->revents = 0; in __anon8dea7afb0202()
142 [] (struct pollfd* const fds, nfds_t fdCount, int timeout) -> int { in __anon8dea7afb0302() argument
143 fds->revents = 1; in __anon8dea7afb0302()
257 struct pollfd fds = {}; variable
258 int ret = adapter.Poll(&fds, 1, -1);
/ohos5.0/base/tee/tee_client/services/teecd/src/
H A Dtee_ca_auth.c87 fd_set fds; in RecvCaMsg() local
112 FD_ZERO(&fds); in RecvCaMsg()
113 FD_SET(socket, &fds); in RecvCaMsg()
114 ret = select(socket + 1, &fds, NULL, NULL, &timeout); in RecvCaMsg()
/ohos5.0/foundation/communication/netmanager_base/services/netmanagernative/src/netsys/
H A Dnetsys_tcp_client.c63 struct pollfd fds[1] = {{0}}; in Poll() local
64 fds[0].fd = sock; in Poll()
65 fds[0].events = event; in Poll()
67 int ret = poll(fds, num, DEFAULT_POLL_TIMEOUT); in Poll()
H A Dclatd.cpp127 pollfd fds[] = { in RunLoop() local
140 if (poll(fds, sizeof(fds) / sizeof((fds)[0]), -1) == -1) { in RunLoop()
145 if (fds[EVENT_STOP].revents) { in RunLoop()
153 if (fds[READ_V6].revents) { in RunLoop()
156 if (fds[READ_V4].revents) { in RunLoop()
/ohos5.0/foundation/ability/ability_runtime/frameworks/native/child_process/src/
H A Dnative_child_process.cpp125 std::map<std::string, int32_t> fds; in OH_Ability_StartNativeChildProcess() local
137 fds.emplace(key, cur->fd); in OH_Ability_StartNativeChildProcess()
140 if (fds.size() > MAX_FD_SIZE) { in OH_Ability_StartNativeChildProcess()
145 childArgs.fds = fds; in OH_Ability_StartNativeChildProcess()
/ohos5.0/foundation/communication/wifi/wifi/services/wifi_standard/wifi_framework/wifi_toolkit/net_helper/
H A Draw_socket.cpp145 pollfd fds[1]; in Recv() local
146 fds[0].fd = socketFd_; in Recv()
147 fds[0].events = POLLIN; in Recv()
148 if (poll(fds, 1, timeoutMillis) <= 0) { in Recv()
/ohos5.0/drivers/hdf_core/adapter/uhdf2/hdi/test/smq_test/
H A Dsmq_test.cpp117 static bool QueryOpendFdsByHostPid(int hostPid, std::set<int> &fds) in QueryOpendFdsByHostPid() argument
145 fds.insert(fd); in QueryOpendFdsByHostPid()
150 static bool QueryOpenedFdsByHostName(const std::string &hostName, std::set<int> &fds) in QueryOpenedFdsByHostName() argument
157 if (!QueryOpendFdsByHostPid(hostPid, fds)) { in QueryOpenedFdsByHostName()
164 static bool QueryOpenedFdsOfCurrentHost(std::set<int> &fds) in QueryOpenedFdsOfCurrentHost() argument
167 if (!QueryOpendFdsByHostPid(pid, fds)) { in QueryOpenedFdsOfCurrentHost()
173 static void PrintFds(const std::string &info, const std::set<int> &fds) in PrintFds() argument
176 for (const auto& fd: fds) { in PrintFds()

1234