Skip to content

Commit 20ead39

Browse files
committed
Add Win32 shmem/sema prototypes.
1 parent f690920 commit 20ead39

File tree

4 files changed

+59
-5
lines changed

4 files changed

+59
-5
lines changed

src/backend/port/sysv_shmem.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Portions Copyright (c) 1994, Regents of the University of California
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/port/sysv_shmem.c,v 1.5 2003/03/25 16:15:44 petere Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/port/sysv_shmem.c,v 1.6 2003/04/24 21:23:01 momjian Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -30,6 +30,10 @@
3030
#include <kernel/OS.h>
3131
#endif
3232

33+
#ifdef WIN32
34+
#include "win32/shmem.h"
35+
#endif
36+
3337
#include "miscadmin.h"
3438
#include "storage/ipc.h"
3539
#include "storage/pg_shmem.h"

src/backend/port/win32/sem.c renamed to src/backend/port/win32/sema.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*-------------------------------------------------------------------------
22
*
3-
* sem.c
3+
* sema.c
44
* Microsoft Windows Win32 Semaphores Emulation
55
*
66
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
@@ -10,6 +10,7 @@
1010

1111
#include "postgres.h"
1212
#include "storage/shmem.h"
13+
#include "sema.h"
1314

1415
#include <errno.h>
1516

src/backend/port/win32/shm.c renamed to src/backend/port/win32/shmem.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*-------------------------------------------------------------------------
22
*
3-
* shm.c
3+
* shmem.c
44
* Microsoft Windows Win32 Shared Memory Emulation
55
*
66
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
@@ -9,7 +9,6 @@
99
*/
1010

1111
#include "postgres.h"
12-
#include "windows.h"
1312

1413
#include <stdio.h>
1514
#include <errno.h>

src/include/port/win32.h

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Header: /cvsroot/pgsql/src/include/port/win32.h,v 1.7 2003/04/18 01:03:42 momjian Exp $ */
1+
/* $Header: /cvsroot/pgsql/src/include/port/win32.h,v 1.8 2003/04/24 21:23:01 momjian Exp $ */
22

33
#include <port/win32defs.h>
44

@@ -32,6 +32,56 @@
3232

3333
#endif
3434

35+
/*
36+
* IPC defines
37+
*/
38+
#define IPC_RMID 256
39+
#define IPC_CREAT 512
40+
#define IPC_EXCL 1024
41+
#define IPC_PRIVATE 234564
42+
#define IPC_NOWAIT 2048
43+
#define IPC_STAT 4096
44+
45+
46+
/*
47+
* Shared memory
48+
*/
49+
struct shmid_ds
50+
{
51+
int dummy;
52+
int shm_nattch;
53+
};
54+
55+
int shmdt(const void *shmaddr);
56+
void* shmat(int memId, void* shmaddr, int flag);
57+
int shmctl(int shmid, int flag, struct shmid_ds * dummy);
58+
int shmget(int memKey, int size, int flag);
59+
60+
61+
/*
62+
* Semaphores
63+
*/
64+
union semun
65+
{
66+
int val;
67+
struct semid_ds *buf;
68+
unsigned short *array;
69+
};
70+
71+
struct sembuf
72+
{
73+
int sem_flg;
74+
int sem_op;
75+
int sem_num;
76+
};
77+
78+
int semctl(int semId, int semNum, int flag, union semun);
79+
int semget(int semKey, int semNum, int flags);
80+
int semop(int semId, struct sembuf * sops, int flag);
81+
82+
83+
/* FROM SRA */
84+
3585
/*
3686
* Supplement to <sys/types.h>.
3787
*/

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy