88 *
99 *
1010 * IDENTIFICATION
11- * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.49 2000/07/22 14:49:01 petere Exp $
11+ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipc.c,v 1.50 2000/10/02 19:42:48 petere Exp $
1212 *
1313 * NOTES
1414 *
2525 *
2626 *-------------------------------------------------------------------------
2727 */
28+ #include "postgres.h"
29+
2830#include <sys/types.h>
2931#include <sys/file.h>
3032#include <errno.h>
3133
32- #include "postgres.h"
33-
3434#include "storage/ipc.h"
3535#include "storage/s_lock.h"
3636/* In Ultrix, sem.h and shm.h must be included AFTER ipc.h */
@@ -65,7 +65,7 @@ static void IpcMemoryDetach(int status, char *shmaddr);
6565static struct ONEXIT
6666{
6767void (* function ) ();
68- caddr_t arg ;
68+ Datum arg ;
6969}on_proc_exit_list [MAX_ON_EXITS ],on_shmem_exit_list [MAX_ON_EXITS ];
7070
7171static int on_proc_exit_index ,
@@ -182,7 +182,7 @@ shmem_exit(int code)
182182 * ----------------------------------------------------------------
183183 */
184184int
185- on_proc_exit (void (* function ) (),caddr_t arg )
185+ on_proc_exit (void (* function ) (),Datum arg )
186186{
187187if (on_proc_exit_index >=MAX_ON_EXITS )
188188return -1 ;
203203 * ----------------------------------------------------------------
204204 */
205205int
206- on_shmem_exit (void (* function ) (),caddr_t arg )
206+ on_shmem_exit (void (* function ) (),Datum arg )
207207{
208208if (on_shmem_exit_index >=MAX_ON_EXITS )
209209return -1 ;
@@ -234,8 +234,7 @@ on_exit_reset(void)
234234/**/
235235/****************************************************************************/
236236static void
237- IPCPrivateSemaphoreKill (int status ,
238- int semId )/* caddr_t */
237+ IPCPrivateSemaphoreKill (int status ,int semId )
239238{
240239union semun semun ;
241240semun .val = 0 ;/* unused */
@@ -251,8 +250,7 @@ IPCPrivateSemaphoreKill(int status,
251250/**/
252251/****************************************************************************/
253252static void
254- IPCPrivateMemoryKill (int status ,
255- int shmId )/* caddr_t */
253+ IPCPrivateMemoryKill (int status ,int shmId )
256254{
257255if (UsePrivateMemory )
258256{
@@ -343,7 +341,7 @@ IpcSemaphoreCreate(IpcSemaphoreKey semKey,
343341}
344342
345343if (removeOnExit )
346- on_shmem_exit (IPCPrivateSemaphoreKill , (caddr_t ) semId );
344+ on_shmem_exit (IPCPrivateSemaphoreKill , (Datum ) semId );
347345}
348346
349347#ifdef DEBUG_IPC
@@ -565,7 +563,7 @@ IpcMemoryCreate(IpcMemoryKey memKey, uint32 size, int permission)
565563}
566564
567565/* if (memKey == PrivateIPCKey) */
568- on_shmem_exit (IPCPrivateMemoryKill , (caddr_t )shmid );
566+ on_shmem_exit (IPCPrivateMemoryKill , (Datum )shmid );
569567
570568return shmid ;
571569}
@@ -629,7 +627,7 @@ IpcMemoryAttach(IpcMemoryId memId)
629627}
630628
631629if (!UsePrivateMemory )
632- on_shmem_exit (IpcMemoryDetach ,( caddr_t ) memAddress );
630+ on_shmem_exit (IpcMemoryDetach ,PointerGetDatum ( memAddress ) );
633631
634632return (char * )memAddress ;
635633}