Home
last modified time | relevance | path

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

12345678910>>...43

/base/security/access_token/interfaces/innerkits/token_setproc/src/
Dtoken_setproc.c39 int fd = open(TOKENID_DEVNODE, O_RDWR); in GetSelfTokenID() local
40 if (fd < 0) { in GetSelfTokenID()
43 int ret = ioctl(fd, ACCESS_TOKENID_GET_TOKENID, &token); in GetSelfTokenID()
45 close(fd); in GetSelfTokenID()
49 close(fd); in GetSelfTokenID()
55 int fd = open(TOKENID_DEVNODE, O_RDWR); in SetSelfTokenID() local
56 if (fd < 0) { in SetSelfTokenID()
59 int ret = ioctl(fd, ACCESS_TOKENID_SET_TOKENID, &tokenID); in SetSelfTokenID()
61 close(fd); in SetSelfTokenID()
65 close(fd); in SetSelfTokenID()
[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/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/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, END_LINE); in DumpDeviceDetails()
173 …dprintf(fd, "DEVICE_ONLINE_STATUS : %s" END_LINE, (info->onlineStatus != 0) ? "online" : "off… in DumpDeviceDetails()
174 …dprintf(fd, "DEVICE_ONLINE_TIME : %s" END_LINE, GetTimeStringFromTimeStamp(info->lastOnline… 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/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.c32 static int SetSocketTimeout(int fd) in SetSocketTimeout() argument
37 int ret = setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(timeout)); in SetSocketTimeout()
40 ret = setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout)); in SetSocketTimeout()
83 int fd = socket(PF_UNIX, SOCK_STREAM, 0); in CreatePipeSocket_() local
84 LE_CHECK(fd > 0, return fd, "Failed to create socket"); in CreatePipeSocket_()
85 SetNoBlock(fd); in CreatePipeSocket_()
88 int ret = setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)); in CreatePipeSocket_()
91 ret = SetSocketTimeout(fd); in CreatePipeSocket_()
96 LE_CHECK(ret == 0, close(fd); in CreatePipeSocket_()
100 LE_CHECK(ret == 0, close(fd); in CreatePipeSocket_()
[all …]
/base/update/updater/utils/
Dpartition_utils.cpp32 uint64_t PartitionUtils::GetBlockDeviceSize(int fd) const in GetBlockDeviceSize()
35 return (ioctl(fd, BLKGETSIZE64, &size) == 0) ? size : 0; in GetBlockDeviceSize()
40 auto fd = open(Updater::Utils::GetPartitionRealPath(devName_).c_str(), O_RDWR); in WipeBlockPartition() local
41 if (fd < 0) { in WipeBlockPartition()
46 uint64_t size = GetBlockDeviceSize(fd); in WipeBlockPartition()
48 if (ioctl(fd, BLKSECDISCARD, &range) >= 0) { in WipeBlockPartition()
49 close(fd); in WipeBlockPartition()
55 if (ioctl(fd, BLKDISCARD, &range) < 0) { in WipeBlockPartition()
56 close(fd); in WipeBlockPartition()
61 if (!Updater::Utils::WriteFully(fd, buffer.data(), buffer.size())) { in WipeBlockPartition()
[all …]
/base/hiviewdfx/faultloggerd/interfaces/innerkits/signal_handler/
Ddfx_signalhandler_exception.c52 int fd = -1; in ConnectSocket() local
53 if ((fd = socket(AF_LOCAL, SOCK_STREAM, 0)) < 0) { in ConnectSocket()
65 … if (setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (const void*)(pTimev), sizeof(timev)) != 0) { in ConnectSocket()
67 syscall(SYS_close, fd); in ConnectSocket()
68 fd = -1; in ConnectSocket()
77 int connected = connect(fd, (struct sockaddr*)(&server), len); in ConnectSocket()
80 syscall(SYS_close, fd); in ConnectSocket()
81 fd = -1; in ConnectSocket()
85 return fd; in ConnectSocket()
88 static bool CheckReadResp(int fd) in CheckReadResp() argument
[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()
162 auto fd = open(logPath.c_str(), O_CREAT | O_WRONLY | O_TRUNC, defaultLogFileMode); in StartCreate() local
163 if (fd < 0) { in StartCreate()
164 printf("Fail to create %s. fd == %d\n", logFile_.c_str(), fd); in StartCreate()
168 auto logTask = std::make_unique<EventLogTask>(fd, 1, event); in StartCreate()
173 close(fd); in StartCreate()
176 close(fd); in StartCreate()
205 auto fd = JudgmentsFileSize(minQuantity, "EventloggerCatcherTest001"); variable
206 if (fd < 0) {
[all …]
/base/sensors/miscdevice/test/unittest/vibrator/capi/
Dvibrator_test.cpp78 fd = open(path.c_str(), O_RDONLY); in FileDescriptor()
82 close(fd); in ~FileDescriptor()
84 int32_t fd; member
146 MISC_HILOGD("Test fd:%{public}d", fileDescriptor.fd);
148 if (fstat64(fileDescriptor.fd, &statbuf) == 0) {
150 .fd = fileDescriptor.fd,
169 MISC_HILOGD("Test fd:%{public}d", fileDescriptor.fd);
171 if (fstat64(fileDescriptor.fd, &statbuf) == 0) {
173 .fd = fileDescriptor.fd,
189 MISC_HILOGD("Test fd:%{public}d", fileDescriptor.fd);
[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/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/hiviewdfx/faultloggerd/frameworks/localhandler/
Ddfx_crash_local_handler.cpp60 static __attribute__((noinline)) void PrintLog(int fd, const char *format, ...) in PrintLog() argument
68 if (fd > 0) { in PrintLog()
70 (void)write(fd, error, strlen(error)); in PrintLog()
75 if (fd > 0) { in PrintLog()
76 (void)write(fd, buf, strlen(buf)); in PrintLog()
80 __attribute__((noinline)) void CrashLocalUnwind(const int fd, const ucontext_t* uc) in CrashLocalUnwind() argument
95 PrintLog(fd, "%s", logContext.substr(i, BUF_SZ_SMALL).c_str()); in CrashLocalUnwind()
98 if (fd >= 0) { in CrashLocalUnwind()
99 close(fd); in CrashLocalUnwind()
106 int fd = RequestOutputLogFile(request); in CrashLocalHandler() local
[all …]
/base/update/updater/services/flashd/
Dpartition.cpp44 auto fd = open(Updater::Utils::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/msdp/device_status/services/native/src/
Dstream_server.cpp63 int32_t StreamServer::GetClientPid(int32_t fd) const in GetClientPid()
65 auto it = sessionss_.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()
183 void StreamServer::ReleaseSession(int32_t fd, epoll_event &ev) in ReleaseSession() argument
185 auto secPtr = GetSession(fd); in ReleaseSession()
188 DelSession(fd); in ReleaseSession()
194 if (auto it = circleBufs_.find(fd); it != circleBufs_.end()) { in ReleaseSession()
[all …]
Ddevicestatus_dumper.cpp58 void DeviceStatusDumper::ParseCommand(int32_t fd, const std::vector<std::string> &args, const std::… in ParseCommand() argument
101 ExecutDump(fd, datas, opt); in ParseCommand()
105 void DeviceStatusDumper::ExecutDump(int32_t fd, const std::vector<Data> &datas, int32_t opt) in ExecutDump() argument
109 DumpHelpInfo(fd); in ExecutDump()
113 DumpDeviceStatusSubscriber(fd); in ExecutDump()
117 DumpDeviceStatusChanges(fd); in ExecutDump()
121 DumpDeviceStatusCurrentStatus(fd, datas); in ExecutDump()
127 COOR_SM->Dump(fd); in ExecutDump()
130 dprintf(fd, "device coordination is not supported\n"); in ExecutDump()
136 context_->GetDragManager().Dump(fd); in ExecutDump()
[all …]
/base/msdp/device_status/rust/modules/scheduler/sys/src/
Dscheduler.rs25 use std::os::fd::RawFd;
57 fn fd(&self) -> RawFd; in fd() method
63 fd: RawFd, field
86 fn fd(&self) -> RawFd in fd() method
88 self.raw.fd() in fd()
172 fn fd(&self) -> RawFd in fd() method
177 fn epoll_add(&self, fd: RawFd) -> FusionResult<()> in epoll_add()
182 u64: fd as u64, in epoll_add()
188 libc::epoll_ctl(self.epoll_fd, libc::EPOLL_CTL_ADD, fd, &mut ev) in epoll_add()
192 @public(self.epoll_fd), @public(fd), @public(Error::last_os_error())); in epoll_add()
[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/web/webview/ohos_adapter/flowbuffer_adapter/src/
Dflowbuffer_adapter_impl.cpp64 void* FlowbufferAdapterImpl::CreateAshmem(size_t size, int mapType, int& fd) in CreateAshmem() argument
66 fd = AshmemCreate(nullptr, size); in CreateAshmem()
67 if (fd < 0) { in CreateAshmem()
68 WVLOG_E("Create ashmem failed, fd: %{public}d", fd); in CreateAshmem()
72 int result = AshmemSetProt(fd, PROT_READ | PROT_WRITE); in CreateAshmem()
74 close(fd); in CreateAshmem()
79 void *startAddr = ::mmap(nullptr, size, mapType, MAP_SHARED, fd, 0); in CreateAshmem()
81 close(fd); in CreateAshmem()
90 void* FlowbufferAdapterImpl::CreateAshmemWithFd(const int fd, size_t size, int mapType) in CreateAshmemWithFd() argument
92 if (fd < 0) { in CreateAshmemWithFd()
[all …]
/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/sensors/sensor/services/src/
Dsensor_dump.cpp92 void SensorDump::RunSensorDump(int32_t fd, int32_t optionIndex, const std::vector<std::string> &arg… in RunSensorDump() argument
109 DumpSensorChannel(fd, clientInfo_); in RunSensorDump()
114 DumpSensorData(fd, clientInfo_); in RunSensorDump()
119 DumpOpeningSensor(fd, sensors_, clientInfo_); in RunSensorDump()
123 DumpHelp(fd); in RunSensorDump()
127 DumpSensorList(fd, sensors_); in RunSensorDump()
131 dprintf(fd, "Unrecognized option, More info with: \"hidumper -s 3601 -a -h\"\n"); in RunSensorDump()
138 void SensorDump::ParseCommand(int32_t fd, const std::vector<std::string> &args, const std::vector<S… in ParseCommand() argument
154 dprintf(fd, "Cmd param number not more than 32\n"); in ParseCommand()
177 RunSensorDump(fd, optionIndex, args, argv); in ParseCommand()
[all …]
/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/miscdevice/test/unittest/vibrator/native/
Dvibrator_agent_test.cpp82 fd = open(path.c_str(), O_RDONLY); in FileDescriptor()
86 close(fd); in ~FileDescriptor()
88 int32_t fd; member
260 MISC_HILOGD("Test fd:%{public}d", fileDescriptor.fd);
262 if (fstat64(fileDescriptor.fd, &statbuf) == 0) {
263 int32_t ret = PlayVibratorCustom(fileDescriptor.fd, 0, statbuf.st_size);
278 MISC_HILOGD("Test fd:%{public}d", fileDescriptor.fd);
280 if (fstat64(fileDescriptor.fd, &statbuf) == 0) {
281 int32_t ret = PlayVibratorCustom(fileDescriptor.fd, 0, statbuf.st_size);
300 MISC_HILOGD("Test fd:%{public}d", fileDescriptor.fd);
[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()

12345678910>>...43