Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8203680

os::stat() on Posix platform does not need to copy input path

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 11
    • Fix Version/s: 11
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b19

      Backports

        Description

        1) os::stat() on all Posix platforms copies the input path into a fixed sized temp buffer, thereby risking truncation, only to call os::native_path() which is a noop on all Posix platforms.

        Just call ::stat() directly, no need for the buffer.

        Also, the coding can be unified in os_posix.cpp.

        2) os::native_path() exists for the sole purpose of making windows happy, this should be a windows only function (os::win32) and be removed from os.hpp. A comment would be helpful.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  stuefe Thomas Stuefe
                  Reporter:
                  stuefe Thomas Stuefe
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: