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
Niklas Hambüchen
GHC
Commits
76ac103f
Commit
76ac103f
authored
6 years ago
by
Niklas Hambüchen
Committed by
Marge Bot
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
base: Document errno behaviour in haddocks.
Also add an implementation comment for details.
parent
7833cf40
Loading
Loading
No related merge requests found
Pipeline
#2402
canceled
6 years ago
Stage: lint
Stage: build
Stage: full-build
Stage: cleanup
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/base/Foreign/C/Error.hs
+5
-1
5 additions, 1 deletion
libraries/base/Foreign/C/Error.hs
with
5 additions
and
1 deletion
libraries/base/Foreign/C/Error.hs
+
5
−
1
View file @
76ac103f
...
...
@@ -255,11 +255,15 @@ isValidErrno (Errno errno) = errno /= -1
-- | Get the current value of @errno@ in the current thread.
--
-- On GHC, the runtime will ensure that any Haskell thread will only see "its own"
-- @errno@, by saving and restoring the value when Haskell threads are scheduled
-- across OS threads.
getErrno
::
IO
Errno
-- We must call a C function to get the value of errno in general. On
-- threaded systems, errno is hidden behind a C macro so that each OS
-- thread gets its own copy.
-- thread gets its own copy (`saved_errno`, which `rts/Schedule.c` restores
-- back into the thread-local `errno` when a Haskell thread is rescheduled).
getErrno
=
do
e
<-
get_errno
;
return
(
Errno
e
)
foreign
import
ccall
unsafe
"HsBase.h __hscore_get_errno"
get_errno
::
IO
CInt
...
...
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