Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
ff5456fe
Commit
ff5456fe
authored
Apr 13, 2003
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add code to provide useful dynamic-linking error messages on OS X.
parent
e1386302
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
8 deletions
+45
-8
src/backend/port/dynloader/darwin.c
src/backend/port/dynloader/darwin.c
+45
-8
No files found.
src/backend/port/dynloader/darwin.c
View file @
ff5456fe
...
@@ -3,31 +3,35 @@
...
@@ -3,31 +3,35 @@
* available with a PostgreSQL-compatible license. Kudos Wilfredo
* available with a PostgreSQL-compatible license. Kudos Wilfredo
* Snchez <wsanchez@apple.com>.
* Snchez <wsanchez@apple.com>.
*
*
* $Header: /cvsroot/pgsql/src/backend/port/dynloader/darwin.c,v 1.
6 2002/10/01 05:06:44
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/port/dynloader/darwin.c,v 1.
7 2003/04/13 01:19:06
tgl Exp $
*/
*/
#include "postgres.h"
#include "postgres.h"
#include <mach-o/dyld.h>
#include <mach-o/dyld.h>
#include "dynloader.h"
#include "dynloader.h"
static
NSObjectFileImageReturnCode
cofiff_result
=
NSObjectFileImageFailure
;
void
*
void
*
pg_dlopen
(
char
*
filename
)
pg_dlopen
(
char
*
filename
)
{
{
NSObjectFileImage
image
;
NSObjectFileImage
image
;
if
(
NSCreateObjectFileImageFromFile
(
filename
,
&
image
)
!=
cofiff_result
=
NSCreateObjectFileImageFromFile
(
filename
,
&
image
);
NSObjectFileImageSuccess
)
if
(
cofiff_result
!=
NSObjectFileImageSuccess
)
return
NULL
;
return
NULL
;
return
NSLinkModule
(
image
,
filename
,
return
NSLinkModule
(
image
,
filename
,
NSLINKMODULE_OPTION_BINDNOW
|
NSLINKMODULE_OPTION_BINDNOW
|
NSLINKMODULE_OPTION_RETURN_ON_ERROR
);
NSLINKMODULE_OPTION_RETURN_ON_ERROR
);
}
}
void
void
pg_dlclose
(
void
*
handle
)
pg_dlclose
(
void
*
handle
)
{
{
NSUnLinkModule
(
handle
,
FALSE
);
NSUnLinkModule
(
handle
,
FALSE
);
return
;
}
}
PGFunction
PGFunction
...
@@ -53,5 +57,38 @@ pg_dlsym(void *handle, char *funcname)
...
@@ -53,5 +57,38 @@ pg_dlsym(void *handle, char *funcname)
char
*
char
*
pg_dlerror
(
void
)
pg_dlerror
(
void
)
{
{
return
"no error message available"
;
NSLinkEditErrors
c
;
int
errorNumber
;
const
char
*
fileName
;
const
char
*
errorString
=
NULL
;
switch
(
cofiff_result
)
{
case
NSObjectFileImageSuccess
:
/* must have failed in NSLinkModule */
NSLinkEditError
(
&
c
,
&
errorNumber
,
&
fileName
,
&
errorString
);
if
(
errorString
==
NULL
||
*
errorString
==
'\0'
)
errorString
=
"unknown link-edit failure"
;
break
;
case
NSObjectFileImageFailure
:
errorString
=
"failed to open object file"
;
break
;
case
NSObjectFileImageInappropriateFile
:
errorString
=
"inappropriate object file"
;
break
;
case
NSObjectFileImageArch
:
errorString
=
"object file is for wrong architecture"
;
break
;
case
NSObjectFileImageFormat
:
errorString
=
"object file has wrong format"
;
break
;
case
NSObjectFileImageAccess
:
errorString
=
"insufficient permissions for object file"
;
break
;
default:
errorString
=
"unknown failure to open object file"
;
break
;
}
return
(
char
*
)
errorString
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment