8
8
*
9
9
*
10
10
* 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 $
12
12
*
13
13
* NOTES
14
14
*
25
25
*
26
26
*-------------------------------------------------------------------------
27
27
*/
28
+ #include "postgres.h"
29
+
28
30
#include <sys/types.h>
29
31
#include <sys/file.h>
30
32
#include <errno.h>
31
33
32
- #include "postgres.h"
33
-
34
34
#include "storage/ipc.h"
35
35
#include "storage/s_lock.h"
36
36
/* In Ultrix, sem.h and shm.h must be included AFTER ipc.h */
@@ -65,7 +65,7 @@ static void IpcMemoryDetach(int status, char *shmaddr);
65
65
static struct ONEXIT
66
66
{
67
67
void (* function ) ();
68
- caddr_t arg ;
68
+ Datum arg ;
69
69
}on_proc_exit_list [MAX_ON_EXITS ],on_shmem_exit_list [MAX_ON_EXITS ];
70
70
71
71
static int on_proc_exit_index ,
@@ -182,7 +182,7 @@ shmem_exit(int code)
182
182
* ----------------------------------------------------------------
183
183
*/
184
184
int
185
- on_proc_exit (void (* function ) (),caddr_t arg )
185
+ on_proc_exit (void (* function ) (),Datum arg )
186
186
{
187
187
if (on_proc_exit_index >=MAX_ON_EXITS )
188
188
return -1 ;
203
203
* ----------------------------------------------------------------
204
204
*/
205
205
int
206
- on_shmem_exit (void (* function ) (),caddr_t arg )
206
+ on_shmem_exit (void (* function ) (),Datum arg )
207
207
{
208
208
if (on_shmem_exit_index >=MAX_ON_EXITS )
209
209
return -1 ;
@@ -234,8 +234,7 @@ on_exit_reset(void)
234
234
/**/
235
235
/****************************************************************************/
236
236
static void
237
- IPCPrivateSemaphoreKill (int status ,
238
- int semId )/* caddr_t */
237
+ IPCPrivateSemaphoreKill (int status ,int semId )
239
238
{
240
239
union semun semun ;
241
240
semun .val = 0 ;/* unused */
@@ -251,8 +250,7 @@ IPCPrivateSemaphoreKill(int status,
251
250
/**/
252
251
/****************************************************************************/
253
252
static void
254
- IPCPrivateMemoryKill (int status ,
255
- int shmId )/* caddr_t */
253
+ IPCPrivateMemoryKill (int status ,int shmId )
256
254
{
257
255
if (UsePrivateMemory )
258
256
{
@@ -343,7 +341,7 @@ IpcSemaphoreCreate(IpcSemaphoreKey semKey,
343
341
}
344
342
345
343
if (removeOnExit )
346
- on_shmem_exit (IPCPrivateSemaphoreKill , (caddr_t ) semId );
344
+ on_shmem_exit (IPCPrivateSemaphoreKill , (Datum ) semId );
347
345
}
348
346
349
347
#ifdef DEBUG_IPC
@@ -565,7 +563,7 @@ IpcMemoryCreate(IpcMemoryKey memKey, uint32 size, int permission)
565
563
}
566
564
567
565
/* if (memKey == PrivateIPCKey) */
568
- on_shmem_exit (IPCPrivateMemoryKill , (caddr_t )shmid );
566
+ on_shmem_exit (IPCPrivateMemoryKill , (Datum )shmid );
569
567
570
568
return shmid ;
571
569
}
@@ -629,7 +627,7 @@ IpcMemoryAttach(IpcMemoryId memId)
629
627
}
630
628
631
629
if (!UsePrivateMemory )
632
- on_shmem_exit (IpcMemoryDetach ,( caddr_t ) memAddress );
630
+ on_shmem_exit (IpcMemoryDetach ,PointerGetDatum ( memAddress ) );
633
631
634
632
return (char * )memAddress ;
635
633
}