[Lldb-commits] [lldb] [lldb] Remove support and workarounds for Android 4 and older (PR #124047)

Brad Smith via lldb-commits lldb-commits at lists.llvm.org
Thu Jan 23 11:33:49 PST 2025


================
@@ -25,13 +25,10 @@
 #include <sstream>
 
 #ifdef __ANDROID__
----------------
brad0 wrote:

```
std::optional<std::string> PosixUserIDResolver::DoGetGroupName(id_t gid) {
#ifndef __ANDROID__
  char group_buffer[PATH_MAX];
  size_t group_buffer_size = sizeof(group_buffer);
  struct group group_info;
  struct group *group_info_ptr = &group_info;
  // Try the threadsafe version first
  if (::getgrgid_r(gid, &group_info, group_buffer, group_buffer_size,
                   &group_info_ptr) == 0) {
    if (group_info_ptr)
      return std::string(group_info_ptr->gr_name);
  } else {
    // The threadsafe version isn't currently working for me on darwin, but the
    // non-threadsafe version is, so I am calling it below.
    group_info_ptr = ::getgrgid(gid);
    if (group_info_ptr)
      return std::string(group_info_ptr->gr_name);
  }
#endif
  return std::nullopt;
}
```

There is no comment and I do not immediately see what the issue is there.

https://github.com/llvm/llvm-project/pull/124047


More information about the lldb-commits mailing list