Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gesh
GHC
Commits
07e0ca96
Commit
07e0ca96
authored
26 years ago
by
sof
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1998-05-12 17:04:11 by sof]
fdToHandle: use openFd
parent
6ac8d6fd
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/lib/posix/PosixIO.lhs
+7
-3
7 additions, 3 deletions
ghc/lib/posix/PosixIO.lhs
with
7 additions
and
3 deletions
ghc/lib/posix/PosixIO.lhs
+
7
−
3
View file @
07e0ca96
...
...
@@ -4,6 +4,7 @@
\section[PosixIO]{Haskell 1.3 POSIX Input/Output Primitives}
\begin{code}
{-# OPTIONS -#include "../std/cbits/stgio.h" #-}
module PosixIO (
FdOption(..),
FileLock,
...
...
@@ -109,14 +110,17 @@ fdToHandle fd@(FD# fd#) =
else
("r",ReadHandle)
in
_ccall_
fd
open fd ft >>= \ file_struct@(A# ptr#) ->
_ccall_ open
Fd
fd ft >>= \ file_struct@(A# ptr#) ->
if file_struct /= (``NULL''::Addr) then
{-
A distinction is made here between std{Input,Output,Error} Fds
and all others. The standard descriptors have a finaliser
that will not close the underlying fd, the others have one
that will. Or rather, the closing of the standard descriptors is
delayed until the process exits.
that will.
Delaying the closing of the standard descriptors until the process
exits is necessary since the RTS is likely to require these after
(or as a result of) program termination.
-}
#ifndef __PARALLEL_HASKELL__
(if fd == stdInput || fd == stdOutput || fd == stdError then
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment