Skip to content

Commit 3929458

Browse files
committed
sanitizer_common: Remove Fuchsia support for reading flags from files
This has never really been used in practice. Fuchsia is moving away from the support this requires, so don't use it. Reviewed By: phosek Differential Revision: https://reviews.llvm.org/D122500
1 parent 52fa1d1 commit 3929458

File tree

1 file changed

+2
-23
lines changed

1 file changed

+2
-23
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -386,29 +386,8 @@ void GetMemoryProfile(fill_profile_f cb, uptr *stats) {}
386386

387387
bool ReadFileToBuffer(const char *file_name, char **buff, uptr *buff_size,
388388
uptr *read_len, uptr max_len, error_t *errno_p) {
389-
zx_handle_t vmo;
390-
zx_status_t status = __sanitizer_get_configuration(file_name, &vmo);
391-
if (status == ZX_OK) {
392-
uint64_t vmo_size;
393-
status = _zx_vmo_get_size(vmo, &vmo_size);
394-
if (status == ZX_OK) {
395-
if (vmo_size < max_len)
396-
max_len = vmo_size;
397-
size_t map_size = RoundUpTo(max_len, GetPageSize());
398-
uintptr_t addr;
399-
status = _zx_vmar_map(_zx_vmar_root_self(), ZX_VM_PERM_READ, 0, vmo, 0,
400-
map_size, &addr);
401-
if (status == ZX_OK) {
402-
*buff = reinterpret_cast<char *>(addr);
403-
*buff_size = map_size;
404-
*read_len = max_len;
405-
}
406-
}
407-
_zx_handle_close(vmo);
408-
}
409-
if (status != ZX_OK && errno_p)
410-
*errno_p = status;
411-
return status == ZX_OK;
389+
*errno_p = ZX_ERR_NOT_SUPPORTED;
390+
return false;
412391
}
413392

414393
void RawWrite(const char *buffer) {

0 commit comments

Comments
 (0)