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
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
alexbiehl-gc
GHC
Commits
89d2a24f
Commit
89d2a24f
authored
24 years ago
by
Simon Marlow
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 2000-05-15 09:20:11 by simonmar]
back out previous misguided commit.
parent
ddf58515
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/lib/std/cbits/openFile.c
+6
-15
6 additions, 15 deletions
ghc/lib/std/cbits/openFile.c
with
6 additions
and
15 deletions
ghc/lib/std/cbits/openFile.c
+
6
−
15
View file @
89d2a24f
/*
* (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
*
* $Id: openFile.c,v 1.1
7
2000/05/1
1 13:15:38
simonmar Exp $
* $Id: openFile.c,v 1.1
8
2000/05/1
5 09:20:11
simonmar Exp $
*
* openFile Runtime Support
*/
...
...
@@ -94,22 +94,22 @@ openFile(StgByteArray file, StgInt how, StgInt binary)
switch
(
how
)
{
case
OPENFILE_APPEND
:
oflags
=
O_WRONLY
|
O_NOCTTY
|
O_APPEND
;
oflags
=
O_NONBLOCK
|
O_WRONLY
|
O_NOCTTY
|
O_APPEND
;
for_writing
=
1
;
flags
|=
FILEOBJ_WRITE
;
break
;
case
OPENFILE_WRITE
:
oflags
=
O_WRONLY
|
O_NOCTTY
;
oflags
=
O_NONBLOCK
|
O_WRONLY
|
O_NOCTTY
;
flags
|=
FILEOBJ_WRITE
;
for_writing
=
1
;
break
;
case
OPENFILE_READ_ONLY
:
oflags
=
O_RDONLY
|
O_NOCTTY
;
oflags
=
O_NONBLOCK
|
O_RDONLY
|
O_NOCTTY
;
flags
|=
FILEOBJ_READ
;
for_writing
=
0
;
break
;
case
OPENFILE_READ_WRITE
:
oflags
=
O_RDWR
|
O_NOCTTY
;
oflags
=
O_NONBLOCK
|
O_RDWR
|
O_NOCTTY
;
flags
|=
FILEOBJ_READ
|
FILEOBJ_WRITE
;
for_writing
=
1
;
break
;
...
...
@@ -191,17 +191,8 @@ openFile(StgByteArray file, StgInt how, StgInt binary)
}
}
/* Set non-blocking mode *after* the open. The reason is that
* when reading from a FIFO, if we open in non-blocking mode
* then any reads from the FIFO will return EOF straight away
* without waiting for a writing process. If we set O_NONBLOCK
* after doing the open, then we apparently get to wait for a
* writer. This broken behaviour has been observed on both Linux
* & Solaris. --SDM
*/
fcntl
(
fd
,
F_SETFL
,
oflags
|
O_NONBLOCK
);
/* Make sure that we aren't looking at a directory */
while
(
fstat
(
fd
,
&
sb
)
<
0
)
{
/* highly unlikely */
if
(
errno
!=
EINTR
)
{
...
...
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