Home
last modified time | relevance | path

Searched refs:fd (Results 1 – 25 of 781) sorted by relevance

12345678910>>...32

/base/security/access_token/interfaces/innerkits/token_setproc/src/
Dtoken_setproc.c53 int fd = open(TOKENID_DEVNODE, O_RDWR); in GetSelfTokenID() local
54 if (fd < 0) { in GetSelfTokenID()
57 int ret = ioctl(fd, ACCESS_TOKENID_GET_TOKENID, &token); in GetSelfTokenID()
59 close(fd); in GetSelfTokenID()
63 close(fd); in GetSelfTokenID()
69 int fd = open(TOKENID_DEVNODE, O_RDWR); in SetSelfTokenID() local
70 if (fd < 0) { in SetSelfTokenID()
73 int ret = ioctl(fd, ACCESS_TOKENID_SET_TOKENID, &tokenID); in SetSelfTokenID()
75 close(fd); in SetSelfTokenID()
79 close(fd); in SetSelfTokenID()
[all …]
/base/hiviewdfx/hidumper_lite/lite/
Dhidumper.c85 static void ExecAction(int fd, unsigned int cmd) in ExecAction() argument
87 if (fd < 0) { in ExecAction()
88 printf("Invalid fd: %d\n", fd); in ExecAction()
92 int ret = ioctl(fd, cmd, NULL); in ExecAction()
98 static void DumpALLInfo(int fd) in DumpALLInfo() argument
100 ExecAction(fd, HIDUMPER_DUMP_ALL); in DumpALLInfo()
103 static void DumpCpuUsage(int fd) in DumpCpuUsage() argument
105 ExecAction(fd, HIDUMPER_CPU_USAGE); in DumpCpuUsage()
108 static void DumpMemUsage(int fd) in DumpMemUsage() argument
110 ExecAction(fd, HIDUMPER_MEM_USAGE); in DumpMemUsage()
[all …]
/base/startup/init/services/param/liteos/
Dparam_hal.c50 static int ParamFileClose(int fd) in ParamFileClose() argument
53 return close(fd); in ParamFileClose()
55 return UtilsFileClose(fd); in ParamFileClose()
59 static int ParamFileRead(int fd, char* buf, unsigned int len) in ParamFileRead() argument
62 return read(fd, buf, len); in ParamFileRead()
64 return UtilsFileRead(fd, buf, len); in ParamFileRead()
68 static int ParamFileWrite(int fd, const char* buf, unsigned int len) in ParamFileWrite() argument
71 return write(fd, buf, len); in ParamFileWrite()
73 return UtilsFileWrite(fd, buf, len); in ParamFileWrite()
89 int fd = open(path, O_RDONLY); in ParamFileStat() local
[all …]
/base/security/device_security_level/services/dfx/
Ddslm_hidumper.c160 static void PrintBanner(int fd) in PrintBanner() argument
162 dprintf(fd, " ___ ___ _ __ __ ___ _ _ __ __ ___ ___ ___ " END_LINE); in PrintBanner()
163 dprintf(fd, "| \\/ __| | | \\/ | | \\| | | | \\/ | _ \\ __| _ \\" END_LINE); in PrintBanner()
164 dprintf(fd, "| |) \\__ \\ |__| |\\/| | | |) | |_| | |\\/| | _/ __| /" END_LINE); in PrintBanner()
165 dprintf(fd, "|___/|___/____|_| |_| |___/ \\___/|_| |_|_| |___|_|_\\" END_LINE); in PrintBanner()
168 static void DumpDeviceDetails(const DslmDeviceInfo *info, int32_t fd) in DumpDeviceDetails() argument
170 dprintf(fd, "DEVICE_ID : %x" END_LINE, info->machine.machineId); in DumpDeviceDetails()
171 dprintf(fd, "DEVICE_TYPE : %u" END_LINE, info->deviceType); in DumpDeviceDetails()
172 dprintf(fd, END_LINE); in DumpDeviceDetails()
174 …dprintf(fd, "DEVICE_ONLINE_STATUS : %s" END_LINE, (info->onlineStatus != 0) ? "online" : "off… in DumpDeviceDetails()
[all …]
/base/powermgr/battery_manager/services/native/src/
Dbattery_dump.cpp33 void BatteryDump::DumpBatteryHelp(int32_t fd) in DumpBatteryHelp() argument
35 dprintf(fd, "Usage:\n"); in DumpBatteryHelp()
36 dprintf(fd, " -h: dump help\n"); in DumpBatteryHelp()
37 dprintf(fd, " -i: dump battery info\n"); in DumpBatteryHelp()
38 dprintf(fd, " -u: unplug battery charging state\n"); in DumpBatteryHelp()
39 dprintf(fd, " -r: reset battery state\n"); in DumpBatteryHelp()
40 dprintf(fd, " --capacity <capacity>: set battery capacity, the capacity range [0, 100]\n"); in DumpBatteryHelp()
43 void BatteryDump::DumpCurrentTime(int32_t fd) in DumpCurrentTime() argument
53 …dprintf(fd, "Current time: %04d-%02d-%02d %02d:%02d:%02d.%03d\n", timeinfo->tm_year + 1900, timein… in DumpCurrentTime()
58 bool BatteryDump::GetBatteryInfo(int32_t fd, sptr<BatteryService> &service, const std::vector<std::… in GetBatteryInfo() argument
[all …]
/base/sensors/miscdevice/interfaces/native/vibrator/test/unittest/
Dvibrator_agent_test.cpp251 int32_t fd = open("/data/test/vibrator/coin_drop.json", O_RDONLY); variable
252 MISC_HILOGD("Test fd:%{public}d", fd);
254 if (fstat64(fd, &statbuf) == 0) {
255 int32_t ret = PlayVibratorCustom(fd, 0, statbuf.st_size);
258 close(fd);
270 int32_t fd = open("/data/test/vibrator/on_carpet.json", O_RDONLY); variable
271 MISC_HILOGD("Test fd:%{public}d", fd);
273 if (fstat64(fd, &statbuf) == 0) {
274 int32_t ret = PlayVibratorCustom(fd, 0, statbuf.st_size);
277 close(fd);
[all …]
/base/hiviewdfx/hiview/service/
Dhiview_service.cpp41 void HiviewService::DumpRequestDispatcher(int fd, const std::vector<std::string> &cmds) in DumpRequestDispatcher() argument
43 if (fd < 0) { in DumpRequestDispatcher()
49 DumpLoadedPluginInfo(fd); in DumpRequestDispatcher()
55 DumpDetailedInfo(fd); in DumpRequestDispatcher()
61 DumpPluginInfo(fd, cmds); in DumpRequestDispatcher()
65 PrintUsage(fd); in DumpRequestDispatcher()
69 void HiviewService::DumpPluginInfo(int fd, const std::vector<std::string> &cmds) const in DumpPluginInfo() argument
89 pluginPtr->Dump(fd, newCmd); in DumpPluginInfo()
94 pluginPtr->Dump(fd, newCmd); in DumpPluginInfo()
100 void HiviewService::DumpDetailedInfo(int fd) in DumpDetailedInfo() argument
[all …]
Dhiview_service.h33 void DumpRequestDispatcher(int fd, const std::vector<std::string>& cmds);
39 void DumpDetailedInfo(int fd);
40 void DumpPluginInfo(int fd, const std::vector<std::string>& cmds) const;
41 void DumpLoadedPluginInfo(int fd) const;
42 void DumpPluginUsageInfo(int fd);
43 void DumpPluginUsageInfo(int fd, const std::string& pluginName) const;
45 void DumpThreadUsageInfo(int fd) const;
46 void DumpThreadUsageInfo(int fd, const std::string& threadName) const;
48 void DumpPipelineUsageInfo(int fd) const;
49 void DumpPipelineUsageInfo(int fd, const std::string& pipelineName) const;
[all …]
/base/update/updater/services/applypatch/
Dpartition_record.cpp40 int fd = open(realPath, O_RDONLY | O_EXCL | O_CLOEXEC | O_BINARY); in IsPartitionUpdated() local
42 if (fd < 0) { in IsPartitionUpdated()
46 if (lseek(fd, PARTITION_RECORD_START, SEEK_CUR) < 0) { in IsPartitionUpdated()
48 close(fd); in IsPartitionUpdated()
51 … if (read(fd, buffer, PARTITION_UPDATER_RECORD_MSG_SIZE) != PARTITION_UPDATER_RECORD_MSG_SIZE) { in IsPartitionUpdated()
53 close(fd); in IsPartitionUpdated()
61 close(fd); in IsPartitionUpdated()
65 fsync(fd); in IsPartitionUpdated()
66 close(fd); in IsPartitionUpdated()
72 bool PartitionRecord::RecordPartitionSetOffset(int fd) in RecordPartitionSetOffset() argument
[all …]
/base/startup/init/services/loopevent/socket/
Dle_socket.c62 int fd = socket(PF_UNIX, SOCK_STREAM, 0); in CreatePipeSocket_() local
63 LE_CHECK(fd > 0, return fd, "Failed to create socket"); in CreatePipeSocket_()
64 SetNoBlock(fd); in CreatePipeSocket_()
67 int ret = setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)); in CreatePipeSocket_()
72 LE_CHECK(ret == 0, close(fd); in CreatePipeSocket_()
76 LE_CHECK(ret == 0, close(fd); in CreatePipeSocket_()
79 ret = connect(fd, (struct sockaddr *)&serverAddr, size); in CreatePipeSocket_()
80 LE_CHECK(ret >= 0, close(fd); in CreatePipeSocket_()
82 LE_LOGV("CreatePipeSocket connect fd: %d server: %s ", fd, serverAddr.sun_path); in CreatePipeSocket_()
83 return fd; in CreatePipeSocket_()
[all …]
/base/hiviewdfx/faultloggerd/interfaces/innerkits/signal_handler/
Ddfx_crash_local_handler.c60 __attribute__((noinline)) void PrintLog(int fd, const char *format, ...) in PrintLog() argument
69 if (fd > 0) { in PrintLog()
71 (void)write(fd, error, strlen(error)); in PrintLog()
76 if (fd > 0) { in PrintLog()
77 (void)write(fd, buf, strlen(buf)); in PrintLog()
82 __attribute__((noinline)) bool UnwindWithContext(const int fd, unw_context_t* context) in UnwindWithContext() argument
86 PrintLog(fd, "context is NULL.\n"); in UnwindWithContext()
93 PrintLog(fd, "Fail to mmap cursor, errno(%d).\n", errno); in UnwindWithContext()
98 PrintLog(fd, "Fail to init local unwind context.\n"); in UnwindWithContext()
111 PrintLog(fd, "reach max unwind frame count, stop.\n"); in UnwindWithContext()
[all …]
/base/hiviewdfx/hiview/plugins/eventlogger/log_catcher/test/unittest/common/
Devent_logger_catcher_test.cpp96 int EventloggerCatcherTest::GetFdSize(int32_t fd) in GetFdSize() argument
99 if (fstat(fd, &fileStat) == -1) { in GetFdSize()
161 auto fd = open(logPath.c_str(), O_CREAT | O_WRONLY | O_TRUNC, defaultLogFileMode); in StartCreate() local
162 if (fd < 0) { in StartCreate()
163 printf("Fail to create %s. fd == %d\n", logFile_.c_str(), fd); in StartCreate()
167 auto logTask = std::make_unique<EventLogTask>(fd, event); in StartCreate()
172 close(fd); in StartCreate()
175 close(fd); in StartCreate()
205 auto fd = JudgmentsFileSize(minQuantity, "EventloggerCatcherTest001"); variable
206 if (fd < 0) {
[all …]
/base/msdp/device_status/services/native/src/
Dstream_server.cpp63 int32_t StreamServer::GetClientPid(int32_t fd) const in GetClientPid()
65 auto it = sessionsMap_.find(fd); in GetClientPid()
72 bool StreamServer::SendMsg(int32_t fd, NetPacket& pkt) in SendMsg() argument
74 if (fd < 0) { in SendMsg()
78 auto ses = GetSession(fd); in SendMsg()
81 fd, SESSION_NOT_FOUND); in SendMsg()
170 void StreamServer::ReleaseSession(int32_t fd, epoll_event& ev) in ReleaseSession() argument
172 auto secPtr = GetSession(fd); in ReleaseSession()
175 DelSession(fd); in ReleaseSession()
181 if (auto it = circleBufMap_.find(fd); it != circleBufMap_.end()) { in ReleaseSession()
[all …]
Ddevicestatus_dumper.cpp57 void DeviceStatusDumper::ParseCommand(int32_t fd, const std::vector<std::string> &args, const std::… in ParseCommand() argument
100 ExecutDump(fd, datas, opt); in ParseCommand()
104 void DeviceStatusDumper::ExecutDump(int32_t fd, const std::vector<Data> &datas, int32_t opt) in ExecutDump() argument
108 DumpHelpInfo(fd); in ExecutDump()
112 DumpDeviceStatusSubscriber(fd); in ExecutDump()
116 DumpDeviceStatusChanges(fd); in ExecutDump()
120 DumpDeviceStatusCurrentStatus(fd, datas); in ExecutDump()
125 COOR_SM->Dump(fd); in ExecutDump()
127 dprintf(fd, "device coordination is not supported\n"); in ExecutDump()
133 context_->GetDragManager().Dump(fd); in ExecutDump()
[all …]
/base/sensors/medical_sensor/services/medical_sensor/src/
Dmedical_dump.cpp46 bool MedicalSensorDump::DumpSensorHelp(int32_t fd, const std::vector<std::u16string> &args) in DumpSensorHelp() argument
52 DumpHelp(fd); in DumpSensorHelp()
56 void MedicalSensorDump::DumpHelp(int32_t fd) in DumpHelp() argument
58 dprintf(fd, "Usage:\n"); in DumpHelp()
59 dprintf(fd, " -h: dump help\n"); in DumpHelp()
60 dprintf(fd, " -l: dump the sensor list\n"); in DumpHelp()
61 dprintf(fd, " -c: dump the sensor data channel info\n"); in DumpHelp()
62 dprintf(fd, " -o: dump the opening sensors\n"); in DumpHelp()
63 dprintf(fd, " -d: dump the last 10 packages sensor data\n"); in DumpHelp()
66 bool MedicalSensorDump::DumpSensorList(int32_t fd, in DumpSensorList() argument
[all …]
/base/startup/init/services/init/
Dinit_service_file.c43 if (file->fd >= 0) { in CreateFile()
44 close(file->fd); in CreateFile()
45 file->fd = -1; in CreateFile()
47 int fd = open(path, file->flags | O_CREAT, file->perm); in CreateFile() local
48 INIT_ERROR_CHECK(fd >= 0, return -1, "Failed open %s, err=%d ", path, errno); in CreateFile()
49 close(fd); in CreateFile()
52 file->fd = open(path, file->flags); in CreateFile()
53 return file->fd; in CreateFile()
56 static int SetFileEnv(int fd, const char *pathName) in SetFileEnv() argument
64 INIT_ERROR_CHECK(snprintf_s(val, sizeof(val), sizeof(val) - 1, "%d", fd) >= 0, return -1, in SetFileEnv()
[all …]
/base/powermgr/battery_manager/test/unittest/src/
Dbattery_dump_test.cpp48 int32_t fd = 1; variable
52 EXPECT_EQ(g_service->Dump(fd, args), ERR_OK);
63 int32_t fd = 1; variable
67 EXPECT_EQ(g_service->Dump(fd, args), ERR_OK);
78 int32_t fd = 1; variable
82 EXPECT_EQ(g_service->Dump(fd, args), ERR_OK);
93 int32_t fd = 1; variable
97 EXPECT_EQ(g_service->Dump(fd, args), ERR_NO_INIT);
108 int32_t fd = 1; variable
112 EXPECT_EQ(g_service->Dump(fd, args), ERR_NO_INIT);
[all …]
/base/update/updater/services/flashd/
Dpartition.cpp44 auto fd = open(GetPartitionRealPath(devName_).c_str(), O_RDWR); in DoErase() local
45 if (fd < 0) { in DoErase()
50 uint64_t size = GetBlockDeviceSize(fd); in DoErase()
52 if (ioctl(fd, BLKSECDISCARD, &range) >= 0) { in DoErase()
53 close(fd); in DoErase()
59 if (ioctl(fd, BLKDISCARD, &range) < 0) { in DoErase()
60 close(fd); in DoErase()
65 if (!Updater::Utils::WriteFully(fd, buffer.data(), buffer.size())) { in DoErase()
66 close(fd); in DoErase()
70 fsync(fd); in DoErase()
[all …]
/base/hiviewdfx/hilog/frameworks/libhilog/socket/
Ddgram_socket_client.cpp28 int fd = GenerateFD(); in CheckSocket() local
29 if (fd < 0) { in CheckSocket()
30 return fd; in CheckSocket()
35 fdHandler.compare_exchange_strong(defaultValue, fd); in CheckSocket()
38 close(fd); in CheckSocket()
40 ret = fd; in CheckSocket()
41 SetHandler(fd); in CheckSocket()
/base/startup/hvb/test/
Dhvb_main.c39 int fd; in hvb_read_partition() local
44 fd = open(partition, O_RDONLY); in hvb_read_partition()
45 if (fd == -1) { in hvb_read_partition()
53 if (ioctl(fd, BLKGETSIZE64, &partition_size) != 0) { in hvb_read_partition()
61 where = lseek(fd, offset, SEEK_SET); in hvb_read_partition()
72 num_read = read(fd, buffer, num_bytes); in hvb_read_partition()
84 if (fd != -1) { in hvb_read_partition()
85 if (close(fd) != 0) { in hvb_read_partition()
99 int fd; in hvb_write_partition() local
104 fd = open(partition, O_WRONLY); in hvb_write_partition()
[all …]
/base/hiviewdfx/faultloggerd/test/unittest/faultloggerd_client/
Dfaultloggerd_client_test.cpp70 int32_t fd = RequestFileDescriptor(FaultLoggerType::CPP_CRASH); variable
71 ASSERT_GT(fd, 0);
72 close(fd);
74 fd = RequestFileDescriptor(FaultLoggerType::JS_HEAP_SNAPSHOT);
75 ASSERT_GT(fd, 0);
76 close(fd);
93 int32_t fd = RequestFileDescriptor(FaultLoggerType::CPP_CRASH); variable
94 if (fd >= 0) {
95 close(fd);
99 fd = RequestFileDescriptor(FaultLoggerType::JS_HEAP_SNAPSHOT);
[all …]
/base/startup/init/services/loopevent/loop/
Dle_epoll.c25 static void GetEpollEvent_(int fd, int op, struct epoll_event *event) in GetEpollEvent_() argument
27 event->data.fd = fd; in GetEpollEvent_()
53 int fd = GetSocketFd((const TaskHandle)task); in AddEvent_() local
54 GetEpollEvent_(fd, op, &event); in AddEvent_()
55 if (IsValid_(epoll) && fd >= 0) { in AddEvent_()
56 ret = epoll_ctl(epoll->epollFd, EPOLL_CTL_ADD, fd, &event); in AddEvent_()
58 LE_CHECK(ret == 0, return LE_FAILURE, "Failed to add epoll_ctl %d ret %d", fd, errno); in AddEvent_()
69 int fd = GetSocketFd((const TaskHandle)task); in ModEvent_() local
70 GetEpollEvent_(fd, op, &event); in ModEvent_()
71 if (IsValid_(epoll) && fd >= 0) { in ModEvent_()
[all …]
/base/msdp/device_status/frameworks/native/src/
Dfd_listener.cpp33 void FdListener::OnReadable(int32_t fd) in OnReadable() argument
35 if (fd < 0) { in OnReadable()
36 FI_HILOGE("Invalid fd:%{public}d", fd); in OnReadable()
42 ssize_t size = recv(fd, szBuf, MAX_PACKET_BUF_SIZE, MSG_DONTWAIT | MSG_NOSIGNAL); in OnReadable()
64 void FdListener::OnShutdown(int32_t fd) in OnShutdown() argument
67 if (fd < 0) { in OnShutdown()
68 FI_HILOGE("Invalid fd:%{public}d", fd); in OnShutdown()
74 void FdListener::OnException(int32_t fd) in OnException() argument
77 if (fd < 0) { in OnException()
78 FI_HILOGE("Invalid fd:%{public}d", fd); in OnException()
/base/update/updater/test/unittest/applypatch_test/
Dall_cmd_unittest.cpp38 bool WriteTestBin(int fd, const uint8_t &data, size_t size) const;
40 int AllCmdUnitTestMove(int &fd, std::vector<std::string> &allCmd, TransferManager &tm);
67 int fd = open(transferFile.c_str(), O_RDONLY | O_CLOEXEC); in GetTransferContents() local
68 if (fd < 0) { in GetTransferContents()
72 bool rc = Updater::Utils::ReadFileToString(fd, contents); in GetTransferContents()
73 close(fd); in GetTransferContents()
77 bool AllCmdUnitTest::WriteTestBin(int fd, const uint8_t &data, size_t size) const in WriteTestBin() argument
86 written = write(fd, p, count); in WriteTestBin()
107 int fd = open(filename, O_RDWR); variable
108 if (fd == -1) {
[all …]
/base/sensors/sensor/services/sensor/src/
Dsensor_dump.cpp78 void SensorDump::ParseCommand(int32_t fd, const std::vector<std::string> &args, const std::vector<S… in ParseCommand() argument
94 dprintf(fd, "cmd param number not more than 32\n"); in ParseCommand()
129 DumpSensorChannel(fd, clientInfo); in ParseCommand()
133 DumpSensorData(fd, clientInfo); in ParseCommand()
137 DumpOpeningSensor(fd, sensors, clientInfo); in ParseCommand()
141 DumpHelp(fd); in ParseCommand()
145 DumpSensorList(fd, sensors); in ParseCommand()
149 …dprintf(fd, "Unrecognized option: %s\nMore info with: \"hidumper -s 3601 -a -h\"\n", argv[optind-1… in ParseCommand()
163 void SensorDump::DumpHelp(int32_t fd) in DumpHelp() argument
165 dprintf(fd, "Usage:\n"); in DumpHelp()
[all …]

12345678910>>...32