Home
last modified time | relevance | path

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

/bootable/recovery/tests/unit/
Ddirutil_test.cpp57 struct stat sb; in TEST() local
58 ASSERT_EQ(0, stat(path.c_str(), &sb)) << strerror(errno); in TEST()
59 ASSERT_TRUE(S_ISDIR(sb.st_mode)); in TEST()
61 ASSERT_EQ(mode, sb.st_mode & mask); in TEST()
75 struct stat sb; in TEST() local
76 ASSERT_EQ(0, stat((prefix + "/a").c_str(), &sb)) << strerror(errno); in TEST()
77 ASSERT_TRUE(S_ISDIR(sb.st_mode)); in TEST()
79 ASSERT_EQ(-1, stat(path.c_str(), &sb)); in TEST()
96 struct stat sb; in TEST() local
97 ASSERT_EQ(0, stat(path.c_str(), &sb)) << strerror(errno); in TEST()
[all …]
/bootable/recovery/uncrypt/
Duncrypt.cpp267 struct stat sb; in produce_block_map() local
268 if (stat(path, &sb) != 0) { in produce_block_map()
273 LOG(INFO) << " block size: " << sb.st_blksize << " bytes"; in produce_block_map()
275 int blocks = ((sb.st_size-1) / sb.st_blksize) + 1; in produce_block_map()
276 LOG(INFO) << " file size: " << sb.st_size << " bytes, " << blocks << " blocks"; in produce_block_map()
281 blk_dev, static_cast<int64_t>(sb.st_size), in produce_block_map()
282 static_cast<int64_t>(sb.st_blksize)); in produce_block_map()
290 buffers.resize(WINDOW_SIZE, std::vector<unsigned char>(sb.st_blksize)); in produce_block_map()
312 while (pos < sb.st_size) { in produce_block_map()
314 int progress = static_cast<int>(100 * (double(pos) / double(sb.st_size))); in produce_block_map()
[all …]
/bootable/recovery/otautil/
DSysUtil.cpp34 struct stat sb; in MapFD() local
35 if (fstat(fd, &sb) == -1) { in MapFD()
40 void* memPtr = mmap(nullptr, sb.st_size, PROT_READ, MAP_PRIVATE, fd, 0); in MapFD()
42 PLOG(ERROR) << "mmap(" << sb.st_size << ", R, PRIVATE, " << fd << ", 0) failed"; in MapFD()
47 length = sb.st_size; in MapFD()
49 ranges_.emplace_back(MappedRange{ memPtr, static_cast<size_t>(sb.st_size) }); in MapFD()
/bootable/recovery/
Dfuse_sdcard_provider.cpp60 struct stat sb; in start_sdcard_fuse() local
61 if (stat(path, &sb) == -1) { in start_sdcard_fuse()
72 fd.file_size = sb.st_size; in start_sdcard_fuse()
Dwear_ui.cpp305 struct stat sb; in ShowFile() local
306 fstat(fileno(fp), &sb); in ShowFile()
312 static_cast<int>(100 * (double(ftello(fp)) / double(sb.st_size))), in ShowFile()
313 static_cast<int>(sb.st_size)); in ShowFile()
Drecovery.cpp517 struct stat sb; member
545 struct stat sb; in erase_volume() local
546 if (stat(path.c_str(), &sb) == 0) { in erase_volume()
548 if (sb.st_size > (1 << 19)) { in erase_volume()
549 sb.st_size = 1 << 19; in erase_volume()
552 std::string data(sb.st_size, '\0'); in erase_volume()
557 log_files.emplace_back(saved_log_file{ path, sb, data }); in erase_volume()
599 if (!android::base::WriteStringToFile(log.data, log.name, log.sb.st_mode, log.sb.st_uid, in erase_volume()
600 log.sb.st_gid)) { in erase_volume()
1068 struct stat sb; in apply_from_sdcard() local
[all …]
Dscreen_ui.cpp698 struct stat sb; in ShowFile() local
699 fstat(fileno(fp), &sb); in ShowFile()
705 static_cast<int>(100 * (double(ftello(fp)) / double(sb.st_size))), in ShowFile()
706 static_cast<int>(sb.st_size)); in ShowFile()
/bootable/recovery/tests/component/
Dinstall_test.cpp268 struct stat sb; in TEST()
269 ASSERT_EQ(0, stat(binary_path.c_str(), &sb)); in TEST()
270 ASSERT_EQ(static_cast<mode_t>(0755), sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO)); in TEST()
281 sb = {}; in TEST()
282 ASSERT_EQ(0, stat(binary_path.c_str(), &sb)); in TEST()
283 ASSERT_EQ(static_cast<mode_t>(0755), sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO)); in TEST()
/bootable/recovery/updater/
Dblockimg.cpp660 struct stat sb; in LoadStash() local
661 if (stat(fn.c_str(), &sb) == -1) { in LoadStash()
671 if ((sb.st_size % BLOCKSIZE) != 0) { in LoadStash()
672 LOG(ERROR) << fn << " size " << sb.st_size << " not multiple of block size " << BLOCKSIZE; in LoadStash()
682 allocate(sb.st_size, buffer); in LoadStash()
684 if (read_all(fd, buffer, sb.st_size) == -1) { in LoadStash()
688 *blocks = sb.st_size / BLOCKSIZE; in LoadStash()
721 struct stat sb; in WriteStash() local
722 int res = stat(cn.c_str(), &sb); in WriteStash()
801 struct stat sb; in CreateStash() local
[all …]