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

FileChannel.map() throws IOException for size=0

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 1.4.0
    • Fix Version/s: 1.4.0
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      beta2
    • CPU:
      sparc
    • OS:
      solaris_7
    • Verification:
      Verified

      Description

      Per spec:
      size - The size of the region to be mapped; must be non-negative

      However,
      fc.map(FileChannel.MAP_RO, 0, 0) throws IOException.

      Implementation seems correct, and spec should say:
      size - The size of the region to be mapped; must be greater than 0.

      ------- results ------------
      On Solaris:
      ==========

      java.io.IOException: Invalid argument
              at sun.nio.ch.FileChannelImpl.map0(Native Method)
              at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:386)

      On Windows NT:
      =============
      java.io.IOException: The volume for a file has been externally altered such that the opened file is no longer valid
              at sun.nio.ch.FileChannelImpl.map0(Native Method)
              at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:386)

      -----------------

      Merlin Beta B-65

        Attachments

          Activity

            People

            • Assignee:
              mmcclosksunw Michael Mccloskey (Inactive)
              Reporter:
              hvilekar Harshad Vilekar
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: