Skip site navigation (1) Skip section navigation (2)

Re: palloc() under cygwin?

From: Reini Urban <rurban(at)x-ray(dot)at>
To: Helmut Hänsel <Helmut(dot)Haensel(at)uni-bayreuth(dot)de>
Cc: pgsql-cygwin(at)postgresql(dot)org
Subject: Re: palloc() under cygwin?
Date: 2004-10-19 20:01:35
Message-ID: 4175729F.9050501@x-ray.at (view raw or flat)
Thread:
Lists: pgsql-cygwin
Helmut Hänsel schrieb:
> 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

looks like another IPC problem, similar to the plperl problem.
increase shmem buffer size?

-- 
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/

In response to

Responses

pgsql-cygwin by date

Next:From: Marek LewczukDate: 2004-10-19 20:36:05
Subject: Re: Where is the link to cygwin?
Previous:From: Reini UrbanDate: 2004-10-19 19:59:55
Subject: Re: Where is the link to cygwin?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group