palloc() under cygwin? - Mailing list pgsql-cygwin

From Helmut Hänsel
Subject palloc() under cygwin?
Date
Msg-id 004d01c4b5fa$eec8b940$7d30b484@che.unibayreuth.de
Whole thread Raw
In response to Install postgreSql 8.0 beta1 without user interaction  ("M S" <sm_research@hotmail.com>)
Responses Re: palloc() under cygwin?  (Reini Urban <rurban@x-ray.at>)
List pgsql-cygwin
Hello,

I was trying to add a c-function to postgreSQL, running under cygwin.
I have installed and compiled the 8.0.0cvs from scratch, postmaster is
working fine :-)

#define _XOPEN_SOURCE
#include "postgres.h"
#include "fmgr.h"
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/wait.h>

PG_FUNCTION_INFO_V1(pg_crypt);
Datum
pg_crypt(PG_FUNCTION_ARGS)
{   int32 new_varchar_size=13+VARHDRSZ;
    VarChar     *new_t = (VarChar *) palloc(new_varchar_size);
/* ... */
    PG_RETURN_VARCHAR_P(new_t);
}

compiling is successful, but linking leads to

pg_func.o(.text+0x4f):pg_func.c: undefined reference to
`__imp__CurrentMemoryContext'

If I try using pgport_palloc() instead of palloc() ( in my despair;-)
the source is compiled and linked without error but as soon as the pg_crypt
is executed from within a psql session, the postmaster crashes with signal
11.

Any Help?
Would be really great !!!

Helmut

P.S.: The function is tested and works fine under a LINUX environment


pgsql-cygwin by date:

Previous
From: "M S"
Date:
Subject: Install postgreSql 8.0 beta1 without user interaction
Next
From: Reini Urban
Date:
Subject: Re: Where is the link to cygwin?