Ticket #1602 (closed bug: invalid)

Opened 6 years ago

Last modified 5 years ago

GHC.Handle.fdToHandle' locks regular files

Reported by: bos@… Owned by:
Priority: normal Milestone:
Component: Runtime System Version: 6.6.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

The code in GHC.Handle.fdToHandle' locks a regular file. This violates POSIX file semantics, because it means that a process can't open the same file twice simultaneously. The locking should be removed.

Change History

Changed 6 years ago by igloo

  • status changed from new to closed
  • resolution set to invalid

 http://haskell.org/onlinereport/io.html section "21.2.3 File locking" says

Implementations should enforce as far as possible, at least locally to the Haskell process, multiple-reader single-writer locking on files. That is, there may either be many handles on the same file which manage input, or just one handle on the file which manages output.

I'm not sure if this was done to combat problems with lazy IO, or in order to make the behaviour the same on all OSes, but GHC is just following the Haskell 98 report here.

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple
Note: See TracTickets for help on using tickets.