Skip to content
Snippets Groups Projects
Commit 03783d27 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel :man_dancing:
Browse files

Replace `__hsunix_getpwent` wrapper with CApiFFI

parent cca358b8
No related branches found
No related tags found
No related merge requests found
......@@ -378,11 +378,11 @@ getAllUserEntries =
else do thisentry <- unpackUserEntry ppw
worker (thisentry : accum)
foreign import ccall unsafe "__hsunix_getpwent"
foreign import capi unsafe "HsUnix.h getpwent"
c_getpwent :: IO (Ptr CPasswd)
foreign import ccall unsafe "setpwent"
foreign import capi unsafe "HsUnix.h setpwent"
c_setpwent :: IO ()
foreign import ccall unsafe "endpwent"
foreign import capi unsafe "HsUnix.h endpwent"
c_endpwent :: IO ()
#else
getAllUserEntries = error "System.Posix.User.getAllUserEntries: not supported"
......
......@@ -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,
......
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment