Home
last modified time | relevance | path

Searched refs:sb (Results 1 – 14 of 14) sorted by relevance

/bootable/recovery/tests/unit/
Ddirutil_test.cpp58 struct stat sb; in TEST() local
59 ASSERT_EQ(0, stat(path.c_str(), &sb)) << strerror(errno); in TEST()
60 ASSERT_TRUE(S_ISDIR(sb.st_mode)); in TEST()
62 ASSERT_EQ(mode, sb.st_mode & mask); in TEST()
76 struct stat sb; in TEST() local
77 ASSERT_EQ(0, stat((prefix + "/a").c_str(), &sb)) << strerror(errno); in TEST()
78 ASSERT_TRUE(S_ISDIR(sb.st_mode)); in TEST()
80 ASSERT_EQ(-1, stat(path.c_str(), &sb)); in TEST()
95 struct stat sb; in TEST() local
96 ASSERT_EQ(0, stat(path.c_str(), &sb)) << strerror(errno); in TEST()
[all …]
Dfuse_sideload_test.cpp89 struct stat sb; in TEST() local
90 if (stat(package.c_str(), &sb) == 0) { in TEST()
106 struct stat sb; in TEST() local
107 ASSERT_EQ(0, stat(exit_flag.c_str(), &sb)); in TEST()
Dinstall_test.cpp133 struct stat sb; in TEST() local
134 ASSERT_EQ(0, stat(binary_path.c_str(), &sb)); in TEST()
135 ASSERT_EQ(static_cast<mode_t>(0755), sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO)); in TEST()
146 sb = {}; in TEST()
147 ASSERT_EQ(0, stat(binary_path.c_str(), &sb)); in TEST()
148 ASSERT_EQ(static_cast<mode_t>(0755), sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO)); in TEST()
/bootable/recovery/uncrypt/
Duncrypt.cpp263 struct stat sb; in ProductBlockMap() local
264 if (stat(path.c_str(), &sb) != 0) { in ProductBlockMap()
269 LOG(INFO) << " block size: " << sb.st_blksize << " bytes"; in ProductBlockMap()
271 int blocks = ((sb.st_size - 1) / sb.st_blksize) + 1; in ProductBlockMap()
272 LOG(INFO) << " file size: " << sb.st_size << " bytes, " << blocks << " blocks"; in ProductBlockMap()
277 static_cast<int64_t>(sb.st_size), in ProductBlockMap()
278 static_cast<int64_t>(sb.st_blksize)); in ProductBlockMap()
286 buffers.resize(WINDOW_SIZE, std::vector<unsigned char>(sb.st_blksize)); in ProductBlockMap()
334 while (pos < sb.st_size) { in ProductBlockMap()
336 int progress = static_cast<int>(100 * (double(pos) / double(sb.st_size))); in ProductBlockMap()
[all …]
/bootable/recovery/minadbd/
Dminadbd_services_test.cpp79 struct stat sb; in WaitForFusePath() local
80 if (stat(package_path_.c_str(), &sb) == 0) { in WaitForFusePath()
93 struct stat sb; in StatExitFlagAndExitProcess() local
94 if (stat(exit_flag_.c_str(), &sb) != 0) { in StatExitFlagAndExitProcess()
152 struct stat sb; in TEST_F() local
153 ASSERT_EQ(0, stat(exit_flag_.c_str(), &sb)); in TEST_F()
/bootable/recovery/otautil/
Ddirutil.cpp34 struct stat sb; in dir_status() local
35 if (stat(path.c_str(), &sb) == 0) { in dir_status()
37 if (S_ISDIR(sb.st_mode)) { in dir_status()
Dsysutil.cpp106 struct stat sb; in MapFD() local
107 if (fstat(fd, &sb) == -1) { in MapFD()
112 void* memPtr = mmap(nullptr, sb.st_size, PROT_READ, MAP_PRIVATE, fd, 0); in MapFD()
114 PLOG(ERROR) << "mmap(" << sb.st_size << ", R, PRIVATE, " << fd << ", 0) failed"; in MapFD()
119 length = sb.st_size; in MapFD()
121 ranges_.emplace_back(MappedRange{ memPtr, static_cast<size_t>(sb.st_size) }); in MapFD()
/bootable/recovery/recovery_utils/
Dlogging.cpp276 struct stat sb; in ReadLogFilesToMemory() local
277 if (stat(path.c_str(), &sb) != 0) { in ReadLogFilesToMemory()
282 size_t read_size = std::min<size_t>(sb.st_size, 1 << 19); in ReadLogFilesToMemory()
291 log_files.emplace_back(saved_log_file{ path, sb, data }); in ReadLogFilesToMemory()
311 if (!android::base::WriteStringToFile(log.data, log.name, log.sb.st_mode, log.sb.st_uid, in RestoreLogFilesAfterFormat()
312 log.sb.st_gid)) { in RestoreLogFilesAfterFormat()
/bootable/recovery/install/
Dfuse_install.cpp171 struct stat sb; in InstallWithFuseFromPath() local
172 if (stat(FUSE_SIDELOAD_HOST_PATHNAME, &sb) == -1) { in InstallWithFuseFromPath()
194 struct stat sb; in InstallWithFuseFromPath() local
195 stat(FUSE_SIDELOAD_HOST_EXIT_PATHNAME, &sb); in InstallWithFuseFromPath()
/bootable/recovery/fuse_sideload/
Dfuse_provider.cpp37 struct stat sb; in FuseFileDataProvider() local
38 if (stat(path.c_str(), &sb) == -1) { in FuseFileDataProvider()
48 file_size_ = sb.st_size; in FuseFileDataProvider()
/bootable/recovery/recovery_utils/include/recovery_utils/
Dlogging.h35 struct stat sb; member
/bootable/recovery/updater/
Ddynamic_partitions.cpp107 struct stat sb; in UpdateDynamicPartitionsFn() local
108 int result = stat(updated_marker.c_str(), &sb); in UpdateDynamicPartitionsFn()
Dblockimg.cpp761 struct stat sb; in LoadStash() local
762 if (stat(fn.c_str(), &sb) == -1) { in LoadStash()
772 if ((sb.st_size % BLOCKSIZE) != 0) { in LoadStash()
773 LOG(ERROR) << fn << " size " << sb.st_size << " not multiple of block size " << BLOCKSIZE; in LoadStash()
784 allocate(sb.st_size, buffer); in LoadStash()
786 if (!android::base::ReadFully(fd, buffer->data(), sb.st_size)) { in LoadStash()
788 PLOG(ERROR) << "Failed to read " << sb.st_size << " bytes of data"; in LoadStash()
792 size_t blocks = sb.st_size / BLOCKSIZE; in LoadStash()
824 struct stat sb; in WriteStash() local
825 int res = stat(cn.c_str(), &sb); in WriteStash()
[all …]
/bootable/recovery/recovery_ui/
Dscreen_ui.cpp1110 struct stat sb; in ShowFile() local
1111 fstat(fileno(fp), &sb); in ShowFile()
1117 static_cast<int>(100 * (double(ftello(fp)) / double(sb.st_size))), in ShowFile()
1118 static_cast<int>(sb.st_size)); in ShowFile()