#include<locale.h>
#include<string.h>
long __attribute__((stdcall)) myadd(long a, long b) //
{
return a + b;
}
char* __attribute__((stdcall)) mystr()
{
char buf[255];
return getcwd(buf, sizeof(buf)); //调用操作系统getcwd函数,获取当前工作目录
}
FUNCTION long myadd(long a,long b) LIBRARY "/opt/sybase/EAServer6/liblibmydll.so"
FUNCTION string mystr() LIBRARY "/opt/sybase/EAServer6/liblibmydll.so" ALIAS FOR "mystr;ansi"