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
12799d0f
Commit
12799d0f
authored
9 years ago
by
Herbert Valerio Riedel
Browse files
Options
Downloads
Patches
Plain Diff
Have Autoconf test for _NSGetEnviron presence
parent
081376c3
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/Env.hsc
+2
-4
2 additions, 4 deletions
System/Posix/Env.hsc
System/Posix/Env/ByteString.hsc
+2
-2
2 additions, 2 deletions
System/Posix/Env/ByteString.hsc
configure.ac
+4
-0
4 additions, 0 deletions
configure.ac
with
8 additions
and
6 deletions
System/Posix/Env.hsc
+
2
−
4
View file @
12799d0f
...
@@ -78,9 +78,8 @@ getEnvironmentPrim = do
...
@@ -78,9 +78,8 @@ getEnvironmentPrim = do
mapM peekFilePath arr
mapM peekFilePath arr
getCEnviron :: IO (Ptr CString)
getCEnviron :: IO (Ptr CString)
#if HAVE__NSGETENVIRON
#if darwin_HOST_OS
-- You should not access @char **environ@ directly on Darwin in a bundle/shared library.
-- You should not access _environ directly on Darwin in a bundle/shared library.
-- See #2458 and http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man7/environ.7.html
-- See #2458 and http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man7/environ.7.html
getCEnviron = nsGetEnviron >>= peek
getCEnviron = nsGetEnviron >>= peek
...
@@ -88,7 +87,6 @@ foreign import ccall unsafe "_NSGetEnviron"
...
@@ -88,7 +87,6 @@ foreign import ccall unsafe "_NSGetEnviron"
nsGetEnviron :: IO (Ptr (Ptr CString))
nsGetEnviron :: IO (Ptr (Ptr CString))
#else
#else
getCEnviron = peek c_environ_p
getCEnviron = peek c_environ_p
foreign import ccall unsafe "&environ"
foreign import ccall unsafe "&environ"
c_environ_p :: Ptr (Ptr CString)
c_environ_p :: Ptr (Ptr CString)
#endif
#endif
...
...
This diff is collapsed.
Click to expand it.
System/Posix/Env/ByteString.hsc
+
2
−
2
View file @
12799d0f
...
@@ -69,8 +69,8 @@ getEnvironmentPrim = do
...
@@ -69,8 +69,8 @@ getEnvironmentPrim = do
mapM B.packCString arr
mapM B.packCString arr
getCEnviron :: IO (Ptr CString)
getCEnviron :: IO (Ptr CString)
#if
darwin_HOST_OS
#if
HAVE__NSGETENVIRON
-- You should not access
_
environ directly on Darwin in a bundle/shared library.
-- You should not access
@char **
environ
@
directly on Darwin in a bundle/shared library.
-- See #2458 and http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man7/environ.7.html
-- See #2458 and http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man7/environ.7.html
getCEnviron = nsGetEnviron >>= peek
getCEnviron = nsGetEnviron >>= peek
...
...
This diff is collapsed.
Click to expand it.
configure.ac
+
4
−
0
View file @
12799d0f
...
@@ -40,6 +40,10 @@ AC_CHECK_FUNCS([readdir_r])
...
@@ -40,6 +40,10 @@ AC_CHECK_FUNCS([readdir_r])
dnl not available on android so check for it
dnl not available on android so check for it
AC_CHECK_FUNCS([telldir seekdir])
AC_CHECK_FUNCS([telldir seekdir])
dnl When available, _NSGetEnviron() (defined in <crt_externs.h>) is
dnl the preferred way to access environ(7)
AC_CHECK_FUNCS([_NSGetEnviron])
dnl This is e.g. available as a GNU extension in glibc 2.11+
dnl This is e.g. available as a GNU extension in glibc 2.11+
AC_CHECK_DECLS([execvpe])
AC_CHECK_DECLS([execvpe])
AC_CHECK_FUNCS([execvpe])
AC_CHECK_FUNCS([execvpe])
...
...
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