Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
U
unix
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
Rinat Striungis
unix
Commits
03783d27
Commit
03783d27
authored
9 years ago
by
Herbert Valerio Riedel
Browse files
Options
Downloads
Patches
Plain Diff
Replace `__hsunix_getpwent` wrapper with CApiFFI
parent
cca358b8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
System/Posix/User.hsc
+3
-3
3 additions, 3 deletions
System/Posix/User.hsc
cbits/HsUnix.c
+0
-8
0 additions, 8 deletions
cbits/HsUnix.c
include/HsUnix.h
+0
-5
0 additions, 5 deletions
include/HsUnix.h
with
3 additions
and
16 deletions
System/Posix/User.hsc
+
3
−
3
View file @
03783d27
...
...
@@ -378,11 +378,11 @@ getAllUserEntries =
else do thisentry <- unpackUserEntry ppw
worker (thisentry : accum)
foreign import c
call
unsafe "
__hsunix_
getpwent"
foreign import c
api
unsafe "
HsUnix.h
getpwent"
c_getpwent :: IO (Ptr CPasswd)
foreign import c
call
unsafe "setpwent"
foreign import c
api
unsafe "
HsUnix.h
setpwent"
c_setpwent :: IO ()
foreign import c
call
unsafe "endpwent"
foreign import c
api
unsafe "
HsUnix.h
endpwent"
c_endpwent :: IO ()
#else
getAllUserEntries = error "System.Posix.User.getAllUserEntries: not supported"
...
...
This diff is collapsed.
Click to expand it.
cbits/HsUnix.c
+
0
−
8
View file @
03783d27
...
...
@@ -16,14 +16,6 @@ void *__hsunix_rtldNext (void) {return RTLD_NEXT;}
void
*
__hsunix_rtldDefault
(
void
)
{
return
RTLD_DEFAULT
;}
#endif
#ifdef HAVE_GETPWENT
// getpwent is a macro on some platforms, so we need a wrapper:
struct
passwd
*
__hsunix_getpwent
(
void
)
{
return
getpwent
();
}
#endif
#if HAVE_GETPWNAM_R
// getpwnam_r is a macro on some platforms, so we need a wrapper:
int
__hsunix_getpwnam_r
(
const
char
*
name
,
struct
passwd
*
pw
,
char
*
buffer
,
...
...
This diff is collapsed.
Click to expand it.
include/HsUnix.h
+
0
−
5
View file @
03783d27
...
...
@@ -113,11 +113,6 @@ fall back to O_FSYNC, which should be the same */
# define WCOREDUMP(s) 0
#endif
#ifdef HAVE_GETPWENT
// getpwent is a macro on some platforms, so we need a wrapper:
struct
passwd
*
__hsunix_getpwent
(
void
);
#endif
#if HAVE_GETPWNAM_R
// getpwnam_r is a macro on some platforms, so we need a wrapper:
int
__hsunix_getpwnam_r
(
const
char
*
,
struct
passwd
*
,
char
*
,
size_t
,
...
...
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