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
769c3b48
Commit
769c3b48
authored
26 years ago
by
sof
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1998-07-22 20:40:26 by sof]
IO.hInputReady: interval arg is millisecs, not secs
parent
9295c823
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ghc/lib/std/IO.lhs
+3
-3
3 additions, 3 deletions
ghc/lib/std/IO.lhs
ghc/lib/std/cbits/inputReady.lc
+4
-4
4 additions, 4 deletions
ghc/lib/std/cbits/inputReady.lc
with
7 additions
and
7 deletions
ghc/lib/std/IO.lhs
+
3
−
3
View file @
769c3b48
...
...
@@ -166,7 +166,7 @@ instance Read BufferMode where
Computation @hReady hdl@ indicates whether at least
one item is available for input from handle {\em hdl}.
@hWaitForInput@ is the generalisation, wait for \tr{n} seconds
@hWaitForInput@ is the generalisation, wait for \tr{n}
milli
seconds
before deciding whether the Handle has run dry or not.
\begin{code}
...
...
@@ -174,9 +174,9 @@ before deciding whether the Handle has run dry or not.
hReady h = hWaitForInput h 0
--hWaitForInput :: Handle -> Int -> IO Bool
hWaitForInput handle
n
secs = do
hWaitForInput handle
m
secs = do
hdl <- wantReadableHandle handle
rc <- _ccall_ inputReady (filePtr hdl)
n
secs
rc <- _ccall_ inputReady (filePtr hdl)
m
secs
writeHandle handle (markHandle hdl)
case rc of
0 -> return False
...
...
This diff is collapsed.
Click to expand it.
ghc/lib/std/cbits/inputReady.lc
+
4
−
4
View file @
769c3b48
...
...
@@ -36,9 +36,9 @@
#endif
StgInt
inputReady(fp,
n
secs)
inputReady(fp,
m
secs)
StgForeignObj fp;
StgInt
n
secs;
StgInt
m
secs;
{
int flags, c, fd, maxfd, ready;
fd_set rfd;
...
...
@@ -75,8 +75,8 @@ StgInt nsecs;
FD_SET(fd, &rfd);
/* select() will consider the descriptor set in the range of 0 to (maxfd-1) */
maxfd = fd + 1;
tv.tv_
u
sec = 0;
tv.tv_sec
=
n
secs;
tv.tv_sec
=
msecs / 100
0;
tv.tv_
u
sec =
m
secs
% 1000
;
while ((ready = select(maxfd, &rfd, NULL, NULL, &tv)) < 0 ) {
if (errno != EINTR ) {
cvtErrno();
...
...
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