Home
last modified time | relevance | path

Searched refs:fd_ (Results 1 - 25 of 183) sorted by relevance

12345678

/foundation/filemanagement/file_api/interfaces/kits/js/src/common/file_helper/
H A Dfd_guard.cpp24 FDGuard::FDGuard(int fd) : fd_(fd) {} in FDGuard()
26 FDGuard::FDGuard(int fd, bool autoClose) : fd_(fd), autoClose_(autoClose) {} in FDGuard()
28 FDGuard::FDGuard(FDGuard &&fdg) : fd_(fdg.fd_), autoClose_(fdg.autoClose_) in FDGuard()
30 fdg.fd_ = -1; in FDGuard()
38 this->fd_ = fdg.fd_; in operator =()
40 fdg.fd_ = -1; in operator =()
46 if (fd_ >= 0 && fd_ < in ~FDGuard()
[all...]
/foundation/multimodalinput/input/service/event_dump/test/
H A Devent_dump_test.cpp47 fd_ = open(TEST_FILE_NAME.c_str(), O_WRONLY);
52 close(fd_); variable
53 fd_ = -1;
56 int32_t fd_; member in OHOS::MMI::EventDumpTest
70 MMIEventDump->CheckCount(fd_, args, count); in HWTEST_F()
85 MMIEventDump->CheckCount(fd_, args, count); in HWTEST_F()
86 MMIEventDump->ParseCommand(fd_, args); in HWTEST_F()
101 MMIEventDump->CheckCount(fd_, args, count); in HWTEST_F()
102 MMIEventDump->ParseCommand(fd_, args); in HWTEST_F()
117 MMIEventDump->CheckCount(fd_, arg in HWTEST_F()
[all...]
/foundation/multimedia/av_codec/services/media_engine/modules/muxer/
H A Ddata_sink_fd.cpp29 DataSinkFd::DataSinkFd(int32_t fd) : fd_(dup(fd)), pos_(0), end_(-1) in DataSinkFd()
31 MEDIA_LOG_I("dup fd is %{public}d", fd_); in DataSinkFd()
32 end_ = lseek(fd_, 0, SEEK_END); in DataSinkFd()
33 if (lseek(fd_, 0, SEEK_SET) < 0) { in DataSinkFd()
34 MEDIA_LOG_E("failed to construct, fd is %{public}d, error is %{public}s", fd_, strerror(errno)); in DataSinkFd()
36 uint32_t fdPermission = static_cast<uint32_t>(fcntl(fd_, F_GETFL, 0)); in DataSinkFd()
42 if (fd_ > 0) { in ~DataSinkFd()
43 MEDIA_LOG_I("close fd is %{public}d", fd_); in ~DataSinkFd()
44 close(fd_); in ~DataSinkFd()
45 fd_ in ~DataSinkFd()
56 strerror(errno), fd_); Read() local
67 strerror(errno), fd_); Write() local
[all...]
/foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/common/src/evloop/src/
H A Devent_fd.h37 EventFd() : fd_(INVALID_HANDLE) {} in EventFd()
38 explicit EventFd(Handle handle) : fd_(handle) {} in EventFd()
43 fd_ = INVALID_HANDLE; in ~EventFd()
48 return IS_VALID_HANDLE(fd_); in IsValid()
53 return fd_; in operator Handle()
58 return other.fd_ == fd_; in operator ==()
64 CLOSE_HANDLE(fd_); in Close()
65 fd_ = INVALID_HANDLE; in Close()
70 Handle fd_; member in DistributedDB::final
[all...]
/foundation/ability/idl_tool/util/
H A Dfile.cpp59 fd_ = fopen(pathTmp.string(), "r"); in File()
62 fd_ = fopen(path.string(), "w+"); in File()
64 fd_ = fopen(path.string(), "a+"); in File()
67 if (fd_ != nullptr) { in File()
130 size_t count = fread(buffer_, 1, BUFFER_SIZE - 1, fd_); in Read()
132 isError_ = ferror(fd_) != 0; in Read()
149 if (fd_ == nullptr) { in ReadData()
153 size_t count = fread(data, size, 1, fd_); in ReadData()
163 if (fd_ == nullptr || !(mode_ & (WRITE | APPEND))) { in WriteData()
167 size_t count = fwrite(data, size, 1, fd_); in WriteData()
[all...]
/foundation/filemanagement/dfs_service/utils/inner_api/
H A Dfdsan.h47 if (move.fd_ != -1) { in operator =()
48 fd_ = move.fd_; in operator =()
49 move.fd_ = -1; in operator =()
51 exchange_tag(fd_, move.tag(), tag()); in operator =()
58 return fd_; in get()
63 if (fd_ != -1) { in reset()
64 close(fd_, tag()); in reset()
65 fd_ = -1; in reset()
68 fd_ in reset()
75 int fd_ = -1; global() member
[all...]
/foundation/filemanagement/dfs_service/utils/system/src/
H A Ddfsu_fd_guard.cpp25 DfsuFDGuard::DfsuFDGuard(int fd) : fd_(fd) {} in DfsuFDGuard()
27 DfsuFDGuard::DfsuFDGuard(int fd, bool autoClose) : fd_(fd), autoClose_(autoClose) {} in DfsuFDGuard()
31 if (fd_ >= 0 && autoClose_) { in ~DfsuFDGuard()
32 LOGD("DfsuFDGuard Deconstruction, fd_ = %{public}d", fd_); in ~DfsuFDGuard()
33 close(fd_); in ~DfsuFDGuard()
39 return fd_ >= 0; in operator bool()
44 return fd_; in GetFD()
49 fd_ = fd; in SetFD()
55 fd_ in ClearFD()
[all...]
/foundation/multimodalinput/input/uinput/
H A Dvirtual_device.cpp53 if (fd_ >= 0) { in ~VirtualDevice()
54 ioctl(fd_, UI_DEV_DESTROY); in ~VirtualDevice()
55 close(fd_); in ~VirtualDevice()
56 fd_ = -1; in ~VirtualDevice()
62 fd_ = open("/dev/uinput", O_WRONLY | O_NONBLOCK); in SetUp()
63 if (fd_ < 0) { in SetUp()
68 if (!DoIoctl(fd_, UI_SET_EVBIT, item)) { in SetUp()
74 if (!DoIoctl(fd_, UI_SET_KEYBIT, item)) { in SetUp()
80 if (!DoIoctl(fd_, UI_SET_PROPBIT, item)) { in SetUp()
86 if (!DoIoctl(fd_, UI_SET_ABSBI in SetUp()
[all...]
/foundation/communication/bluetooth/frameworks/inner/src/
H A Dbluetooth_socket.cpp91 if (fd_ > 0) { in ~impl()
92 shutdown(fd_, SHUT_RD); in ~impl()
93 shutdown(fd_, SHUT_WR); in ~impl()
95 HiviewDFX::HiSysEvent::EventType::STATISTIC, "ACTION", "close", "ID", fd_, "ADDRESS", "empty", in ~impl()
99 "SCENE_CODE", fd_); in ~impl()
100 ReportDataToRss("close", fd_, "empty", IPCSkeleton::GetCallingPid(), IPCSkeleton::GetCallingUid()); in ~impl()
101 HILOGI("fd closed, fd_: %{public}d", fd_); in ~impl()
102 close(fd_); in ~impl()
103 fd_ in ~impl()
289 int fd_; global() member
801 int fd_; global() local
[all...]
/foundation/multimedia/media_foundation/src/buffer/avbuffer/
H A Dav_hardware_memory.cpp42 allocator->fd_ = dup(fd); in CreateHardwareAllocator()
50 : fd_(-1), in AVHardwareAllocator()
62 if (fd_ > 0 && (!isAllocated_ || isSecure_)) { in ~AVHardwareAllocator()
63 (void)::close(fd_); in ~AVHardwareAllocator()
64 fd_ = -1; in ~AVHardwareAllocator()
87 if (fd_ > 0) { in Free()
88 (void)::close(fd_); in Free()
89 fd_ = -1; in Free()
109 return fd_; in GetFileDescriptor()
124 capacity_, memFlag_, fd_); in MapMemoryAddr()
[all...]
H A Dav_shared_memory_ext.cpp75 AVSharedMemoryExt::AVSharedMemoryExt() : fd_(-1), isFirstFlag_(true), memFlag_(MemoryFlag::MEMORY_READ_ONLY) {} in AVSharedMemoryExt()
81 if (fd_ > 0) { in ~AVSharedMemoryExt()
82 (void)::close(fd_); in ~AVSharedMemoryExt()
83 fd_ = -1; in ~AVSharedMemoryExt()
87 bool ret = allocator_->Free(reinterpret_cast<void *>(fd_)); in ~AVSharedMemoryExt()
96 fd_ = reinterpret_cast<intptr_t>(allocator_->Alloc(allocSize)); in Init()
97 FALSE_RETURN_V_MSG_E(fd_ > 0, Status::ERROR_NO_MEMORY, "Alloc AVSharedMemoryExt failed"); in Init()
108 fd_ = parcel.ReadFileDescriptor(); in Init()
109 FALSE_RETURN_V_MSG_E(fd_ > 0, Status::ERROR_INVALID_DATA, "File descriptor is invalid"); in Init()
121 bool ret = bufferParcel.WriteFileDescriptor(fd_) in WriteToMessageParcel()
[all...]
/foundation/communication/ipc/ipc/native/src/core/source/
H A Dipc_file_descriptor.cpp37 IPCFileDescriptor::IPCFileDescriptor() : Parcelable(true), fd_(INVALID_FD) {} in IPCFileDescriptor()
41 fd_ = fd; in IPCFileDescriptor()
46 fd_ = INVALID_FD; in ~IPCFileDescriptor()
51 return fd_; in GetFd()
56 fd_ = fd; in SetFd()
61 if (fd_ < 0) { in Marshalling()
62 ZLOGE(LABEL, "fd:%{public}d is invalid", fd_); in Marshalling()
67 return invoker->WriteFileDescriptor(parcel, fd_, false); in Marshalling()
/foundation/multimodalinput/input/intention/ipc/socket/src/
H A Dsocket_session.cpp34 : fd_(fd), uid_(uid), pid_(pid), tokenType_(tokenType), programName_(programName) in SocketSession()
39 if ((fd_ >= 0) && (::close(fd_) != 0)) { in ~SocketSession()
40 FI_HILOGE("close(%{public}d) failed:%{public}s", fd_, ::strerror(errno)); in ~SocketSession()
66 if (fd_ < 0) { in SendMsg()
67 FI_HILOGE("The fd_ is less than 0"); in SendMsg()
78 FI_HILOGD("Send message to client (%{public}d, %{public}d)", fd_, pid_); in SendMsg()
79 ssize_t count = send(fd_, &buf[idx], remSize, MSG_DONTWAIT | MSG_NOSIGNAL); in SendMsg()
86 FI_HILOGE("Send return failed, error:%{public}d, fd:%{public}d, pid:%{public}d", errno, fd_, pid_); in SendMsg()
97 "pid:%{public}d", retryCount, SEND_RETRY_LIMIT, idx, bufSize, fd_, pid in SendMsg()
[all...]
/foundation/distributedhardware/distributed_input/services/source/inputinject/src/
H A Dvirtual_device.cpp44 if (fd_ >= 0) { in ~VirtualDevice()
45 ioctl(fd_, UI_DEV_DESTROY); in ~VirtualDevice()
46 close(fd_); in ~VirtualDevice()
47 fd_ = -1; in ~VirtualDevice()
65 if (!DoIoctl(fd_, uiSet, evt_type)) { in CreateKey()
119 if (ioctl(fd_, UI_SET_PHYS, phys.c_str()) < 0) { in SetPhys()
127 fd_ = open("/dev/uinput", O_WRONLY | O_NONBLOCK); in SetUp()
128 if (fd_ < 0) { in SetUp()
158 if (write(fd_, &dev_, sizeof(dev_)) < 0) { in SetUp()
162 int ret = ioctl(fd_, UI_DEV_CREAT in SetUp()
[all...]
/foundation/communication/bluetooth_service/services/bluetooth/service/src/hid_host/
H A Dhid_host_uhid.cpp26 fd_ = -1; in HidHostUhid()
42 if (fd_ < 0) { in Open()
44 fd_ = open(UHID_DEVICE_PATH, O_RDWR); in Open()
45 if (fd_ < 0) { in Open()
49 LOG_INFO("[UHID]%{public}s():uhid fd = %{public}d", __FUNCTION__, fd_); in Open()
63 LOG_INFO("[UHID]%{public}s():uhid fd is not null,fd = %{public}d", __FUNCTION__, fd_); in Open()
76 if (fd_ >= 0) { in SendData()
84 if ((fd_ >= 0) && readyForData_) { in SendData()
85 WritePackUhid(fd_, pRpt, len); in SendData()
87 LOG_ERROR("[UHID]%{public}s failed, fd_ in SendData()
[all...]
/foundation/multimedia/player_framework/services/utils/
H A Duri_helper.cpp118 UriHelper::UriHelper(int32_t fd, int64_t offset, int64_t size) : fd_(dup(fd)), offset_(offset), size_(size) in UriHelper()
125 if (fd_ >= 0) { in ~UriHelper()
126 (void)::close(fd_); in ~UriHelper()
127 fd_ = -1; in ~UriHelper()
169 MEDIA_LOGI("0x%{public}06" PRIXPTR " UriHelper FormatMeForFd fd is %{public}d", FAKE_POINTER(this), fd_);
178 int flags = fcntl(fd_, F_GETFL); in CorrectFdParam()
181 CHECK_AND_RETURN_RET_LOG(fstat64(fd_, &st) == 0, false, in CorrectFdParam()
187 ", stSec: %{public}" PRId64, fd_, fdSize, stIno, stSec); in CorrectFdParam()
194 formattedUri_ = std::string("fd://") + std::to_string(fd_) + "?offset=" + in CorrectFdParam()
221 CHECK_AND_RETURN_RET_LOG(fd_ > in AccessCheck()
[all...]
/foundation/multimedia/media_foundation/engine/plugin/plugins/sink/file_sink/
H A Dfile_fd_sink_plugin.cpp49 : OutputSinkPlugin(std::move(name)), fd_(-1), seekable_(Seekable::SEEKABLE) in FileFdSinkPlugin()
61 fd_ = sink.GetFd(); in SetSink()
72 FALSE_RETURN_V_MSG_E(fd_ != -1, Status::ERROR_WRONG_STATE, "no valid fd."); in SeekTo()
73 int64_t ret = lseek(fd_, offset, SEEK_SET); in SeekTo()
89 write(fd_, bufferData->GetReadOnlyData(), bufferData->GetSize()); in Write()
102 ftruncate(fd_, 0); in Reset()
103 lseek(fd_, 0, SEEK_SET); in Reset()
109 if (fd_ != -1) { in CloseFd()
111 close(fd_); in CloseFd()
112 fd_ in CloseFd()
[all...]
/foundation/ability/idl_tool/idl_tool_2/util/
H A Dfile.cpp49 fd_ = fopen(path.c_str(), "w+"); in File()
51 fd_ = fopen(path.c_str(), "a+"); in File()
54 if (fd_ == nullptr) { in File()
80 fd_ = fopen(realPath.c_str(), "r"); in OpenByRead()
81 if (fd_ == nullptr) { in OpenByRead()
131 size_t count = fread(buffer_, 1, BUFFER_SIZE - 1, fd_); in Read()
133 isError_ = ferror(fd_) != 0; in Read()
150 if (fd_ == nullptr) { in ReadData()
154 return fread(data, 1, size, fd_); in ReadData()
163 if (fd_ in WriteData()
[all...]
/foundation/multimedia/player_framework/frameworks/native/player/test/unittest/src/data_source/
H A Dmedia_data_source_test_seekable.cpp54 if (fd_ != nullptr) { in ~MediaDataSourceTestSeekable()
55 (void)fclose(fd_); in ~MediaDataSourceTestSeekable()
56 fd_ = nullptr; in ~MediaDataSourceTestSeekable()
62 fd_ = fopen(uri_.c_str(), "rb+"); in Init()
63 if (fd_ == nullptr) { in Init()
74 (void)fseek(fd_, 0, SEEK_SET); in Reset()
82 (void)fseek(fd_, static_cast<long>(pos), SEEK_SET); in ReadAt()
92 readRet = fread(mem->GetBase(), static_cast<size_t>(length), 1, fd_); in ReadAt()
93 if (ferror(fd_)) { in ReadAt()
H A Dmedia_data_source_test_noseek.cpp53 if (fd_ != nullptr) { in ~MediaDataSourceTestNoSeek()
54 (void)fclose(fd_); in ~MediaDataSourceTestNoSeek()
55 fd_ = nullptr; in ~MediaDataSourceTestNoSeek()
61 fd_ = fopen(uri_.c_str(), "rb+"); in Init()
62 if (fd_ == nullptr) { in Init()
73 (void)fseek(fd_, 0, SEEK_SET); in Reset()
87 readRet = fread(mem->GetBase(), static_cast<size_t>(length), 1, fd_); in ReadAt()
88 if (ferror(fd_)) { in ReadAt()
/foundation/multimedia/media_foundation/src/buffer/avsharedmemory/
H A Davsharedmemorybase.cpp64 : base_(nullptr), capacity_(size), flags_(flags), name_(name), fd_(-1), size_(0) in AVSharedMemoryBase()
71 : base_(nullptr), capacity_(size), flags_(flags), name_(name), fd_(dup(fd)), size_(0) in AVSharedMemoryBase()
89 name_.c_str(), capacity_, flags_, fd_); in Init()
97 if (fd_ > 0) { in Init()
98 int size = AshmemGetSize(fd_); in Init()
103 fd_ = AshmemCreate(name_.c_str(), static_cast<size_t>(capacity_)); in Init()
104 FALSE_RETURN_V_MSG_E(fd_ > 0, static_cast<int32_t>(Status::ERROR_INVALID_PARAMETER), in Init()
105 "fd is invalid, fd = %{public}d", fd_); in Init()
125 int result = AshmemSetProt(fd_, static_cast<int>(prot)); in MapMemory()
129 void *addr = ::mmap(nullptr, static_cast<size_t>(capacity_), static_cast<int>(prot), MAP_SHARED, fd_, in MapMemory()
[all...]
/foundation/multimedia/av_codec/test/unittest/avmuxer_test/
H A Davmuxer_unit_test.cpp58 if (fd_ >= 0) { in TearDown()
59 close(fd_); in TearDown()
60 fd_ = -1; in TearDown()
165 fd_ = open(outputFile.c_str(), O_CREAT | O_RDWR, S_IRUSR | S_IWUSR); in HWTEST_F()
167 bool isCreated = avmuxer_->CreateMuxer(fd_, outputFormat); in HWTEST_F()
179 fd_ = open(outputFile.c_str(), O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR); in HWTEST_F()
181 bool isCreated = avmuxer_->CreateMuxer(fd_, outputFormat); in HWTEST_F()
193 fd_ = open(outputFile.c_str(), O_CREAT | O_RDONLY, S_IRUSR | S_IWUSR); in HWTEST_F()
195 bool isCreated = avmuxer_->CreateMuxer(fd_, outputFormat); in HWTEST_F()
233 fd_ in HWTEST_F()
[all...]
/foundation/multimedia/image_framework/plugins/common/libs/image/libextplugin/src/hardware/imagecodec/
H A Dimage_codec_buffer.cpp50 ImageDmaBuffer::ImageDmaBuffer(int fd, int32_t capacity, int32_t stride): fd_(fd) in ImageDmaBuffer()
63 if (fd_ >= 0) { in ~ImageDmaBuffer()
64 close(fd_); in ~ImageDmaBuffer()
65 fd_ = -1; in ~ImageDmaBuffer()
72 IF_TRUE_RETURN_VAL_WITH_MSG(fd_ < 0, nullptr, "invalid fd=%{public}d", fd_); in GetAddr()
74 void *addr = ::mmap(nullptr, static_cast<size_t>(capacity_), static_cast<int>(prot), MAP_SHARED, fd_, 0); in GetAddr()
75 IF_TRUE_RETURN_VAL_WITH_MSG(addr == MAP_FAILED, nullptr, "mmap failed for fd=%{public}d", fd_); in GetAddr()
/foundation/distributeddatamgr/preferences/frameworks/native/platform/src/
H A Dpreferences_file_lock.cpp55 fd_ = open(path.c_str(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); in PreferencesFileLock()
56 if (fd_ == -1) { in PreferencesFileLock()
67 if (fcntl(fd_, F_SETLK, &fileLockInfo) != -1) { in PreferencesFileLock()
80 if (fd_ > 0) { in ~PreferencesFileLock()
86 if (fcntl(fd_, F_SETLK, &fileLockInfo) == -1) { in ~PreferencesFileLock()
89 close(fd_); in ~PreferencesFileLock()
90 fd_ = -1; in ~PreferencesFileLock()
98 fd_ = -1; in PreferencesFileLock()
/foundation/ability/ability_base/interfaces/kits/native/extractortool/src/
H A Dzip_file_reader.cpp46 if (fd_ >= 0 && closable_) { in ~ZipFileReader()
47 close(fd_); in ~ZipFileReader()
48 fd_ = -1; in ~ZipFileReader()
85 fd_ = open(resolvePath.c_str(), O_RDONLY); in init()
86 if (fd_ < 0) { in init()

Completed in 244 milliseconds

12345678