Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
2de3d96f
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2de3d96f
编写于
1月 13, 1997
作者:
B
Bryan Henderson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add nextstep port, courtesy of Ovidiu Predescu.
上级
ef228cb1
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
194 addition
and
0 deletion
+194
-0
src/backend/port/nextstep/Makefile
src/backend/port/nextstep/Makefile
+31
-0
src/backend/port/nextstep/dynloader.c
src/backend/port/nextstep/dynloader.c
+72
-0
src/backend/port/nextstep/machine.h
src/backend/port/nextstep/machine.h
+6
-0
src/backend/port/nextstep/port-protos.h
src/backend/port/nextstep/port-protos.h
+27
-0
src/backend/port/nextstep/port.c
src/backend/port/nextstep/port.c
+58
-0
未找到文件。
src/backend/port/nextstep/Makefile
0 → 100644
浏览文件 @
2de3d96f
#-------------------------------------------------------------------------
#
# Makefile--
# Makefile for port/next (NeXTStep 3.3 specific stuff)
#
#-------------------------------------------------------------------------
SRCDIR
=
../../..
include
../../../Makefile.global
INCLUDE_OPT
=
-I
../..
\
-I
../../../include
CFLAGS
+=
$(INCLUDE_OPT)
OBJS
=
dynloader.o port.o
all
:
SUBSYS.o
SUBSYS.o
:
$(OBJS)
$(LD)
-r
-o
SUBSYS.o
$(OBJS)
depend dep
:
$(CC)
-MM
$(INCLUDE_OPT)
*
.c
>
depend
clean
:
rm
-f
SUBSYS.o
$(OBJS)
ifeq
(depend,$(wildcard depend))
include
depend
endif
src/backend/port/nextstep/dynloader.c
0 → 100644
浏览文件 @
2de3d96f
#include <mach-o/rld.h>
#include <streams/streams.h>
#include <stdlib.h>
static
char
*
lastError
=
NULL
;
static
NXStream
*
OpenError
()
{
return
NXOpenMemory
(
NULL
,
0
,
NX_WRITEONLY
);
}
static
void
CloseError
(
NXStream
*
s
)
{
if
(
s
)
NXCloseMemory
(
s
,
NX_FREEBUFFER
);
}
static
void
TransferError
(
NXStream
*
s
)
{
char
*
buffer
;
int
len
,
maxlen
;
if
(
lastError
)
free
(
lastError
);
NXGetMemoryBuffer
(
s
,
&
buffer
,
&
len
,
&
maxlen
);
lastError
=
malloc
(
len
+
1
);
strcpy
(
lastError
,
buffer
);
}
void
*
next_dlopen
(
char
*
name
)
{
int
rld_success
;
NXStream
*
errorStream
;
char
*
result
=
NULL
;
char
**
p
;
errorStream
=
OpenError
();
p
=
calloc
(
2
,
sizeof
(
void
*
));
p
[
0
]
=
name
;
rld_success
=
rld_load
(
errorStream
,
NULL
,
p
,
NULL
);
free
(
p
);
if
(
!
rld_success
)
{
TransferError
(
errorStream
);
result
=
(
char
*
)
1
;
}
CloseError
(
errorStream
);
return
result
;
}
int
next_dlclose
(
void
*
handle
)
{
return
0
;
}
void
*
next_dlsym
(
void
*
handle
,
char
*
symbol
)
{
NXStream
*
errorStream
=
OpenError
();
char
symbuf
[
1024
];
unsigned
long
symref
=
0
;
sprintf
(
symbuf
,
"_%s"
,
symbol
);
if
(
!
rld_lookup
(
errorStream
,
symbuf
,
&
symref
))
TransferError
(
errorStream
);
CloseError
(
errorStream
);
return
(
void
*
)
symref
;
}
char
*
next_dlerror
(
void
)
{
return
lastError
;
}
src/backend/port/nextstep/machine.h
0 → 100644
浏览文件 @
2de3d96f
#ifndef MACHINE_H
#define MACHINE_H
#define BLCKSZ 8192
#endif
src/backend/port/nextstep/port-protos.h
0 → 100644
浏览文件 @
2de3d96f
/*-------------------------------------------------------------------------
*
* port-protos.h--
* port-specific prototypes for NeXT
*
-------------------------------------------------------------------------
*/
#ifndef PORT_PROTOS_H
#define PORT_PROTOS_H
#include "fmgr.h"
/* for func_ptr */
#include "utils/dynamic_loader.h"
void
*
next_dlopen
(
char
*
name
);
int
next_dlclose
(
void
*
handle
);
void
*
next_dlsym
(
void
*
handle
,
char
*
symbol
);
char
*
next_dlerror
(
void
);
#define pg_dlopen(f) next_dlopen
#define pg_dlsym next_dlsym
#define pg_dlclose next_dlclose
#define pg_dlerror next_dlerror
/* port.c */
#endif
/* PORT_PROTOS_H */
src/backend/port/nextstep/port.c
0 → 100644
浏览文件 @
2de3d96f
#ifndef _POSIX_SOURCE
# include <libc.h>
#else
# include <unistd.h>
# include <stdlib.h>
#endif
#include <string.h>
#include <sys/signal.h>
void
putenv
(
char
*
name
)
{
extern
char
**
environ
;
static
int
was_mallocated
=
0
;
int
size
;
/* Compute the size of environ array including the final NULL */
for
(
size
=
1
;
environ
[
size
++
];)
/* nothing */
;
if
(
!
was_mallocated
)
{
char
**
tmp
=
environ
;
int
i
;
was_mallocated
=
1
;
environ
=
malloc
(
size
*
sizeof
(
char
*
));
for
(
i
=
0
;
i
<
size
;
i
++
)
environ
[
i
]
=
tmp
[
i
];
}
environ
=
realloc
(
environ
,
(
size
+
1
)
*
sizeof
(
char
*
));
environ
[
size
-
1
]
=
strcpy
(
malloc
(
strlen
(
name
)
+
1
),
name
);
environ
[
size
]
=
NULL
;
}
char
*
strdup
(
const
char
*
string
)
{
return
strcpy
(
malloc
(
strlen
(
string
)
+
1
),
string
);
}
#ifndef _POSIX_SOURCE
int
sigaddset
(
int
*
set
,
int
signo
)
{
*
set
|=
sigmask
(
signo
);
return
*
set
;
}
int
sigemptyset
(
int
*
set
)
{
return
(
*
set
=
0
);
}
char
*
getcwd
(
char
*
buf
,
size_t
size
)
{
return
getwd
(
buf
);
}
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录