Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
4bd983bf
Commit
4bd983bf
authored
Mar 18, 2001
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patches from Cyril Velter to make shared-memory-conflict-detection code
work in BeOS port.
parent
5c1b0045
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
9 deletions
+40
-9
src/backend/port/beos/shm.c
src/backend/port/beos/shm.c
+26
-6
src/backend/port/beos/support.c
src/backend/port/beos/support.c
+3
-1
src/backend/utils/init/miscinit.c
src/backend/utils/init/miscinit.c
+9
-2
src/include/port/beos.h
src/include/port/beos.h
+2
-0
No files found.
src/backend/port/beos/shm.c
View file @
4bd983bf
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* shm.c
* shm.c
* BeOS System V Shared Memory Emulation
* BeOS System V Shared Memory Emulation
*
*
* Copyright (c) 1999-200
0
, Cyril VELTER
* Copyright (c) 1999-200
1
, Cyril VELTER
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
#include "postgres.h"
#include "postgres.h"
#include <stdio.h>
#include <stdio.h>
#include <OS.h>
#include <OS.h>
#include <errno.h>
/* Emulating SYS shared memory with beos areas. WARNING : fork clone
/* Emulating SYS shared memory with beos areas. WARNING : fork clone
areas in copy on write mode */
areas in copy on write mode */
...
@@ -68,11 +69,30 @@ int shmctl(int shmid, int flag, struct shmid_ds* dummy)
...
@@ -68,11 +69,30 @@ int shmctl(int shmid, int flag, struct shmid_ds* dummy)
}
}
if
(
flag
==
IPC_STAT
)
if
(
flag
==
IPC_STAT
)
{
{
/* Is there a way to check existence of an area given its ID?
/* Find any SYSV area with the shmid in its name */
* For now, punt and assume it does not exist.
*/
area_info
inf
;
errno
=
EINVAL
;
team_info
infteam
;
return
-
1
;
int32
cookteam
=
0
;
char
name
[
50
];
sprintf
(
name
,
"SYSV_IPC %d"
,
shmid
);
dummy
->
shm_nattch
=
0
;
while
(
get_next_team_info
(
&
cookteam
,
&
infteam
)
==
B_OK
)
{
int32
cook
=
0
;
while
(
get_next_area_info
(
infteam
.
team
,
&
cook
,
&
inf
)
==
B_OK
)
{
if
(
strcmp
(
name
,
inf
.
name
)
==
0
)
{
dummy
->
shm_nattch
++
;
}
}
}
errno
=
0
;
return
0
;
}
}
errno
=
EINVAL
;
errno
=
EINVAL
;
return
-
1
;
return
-
1
;
...
...
src/backend/port/beos/support.c
View file @
4bd983bf
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* support.c
* support.c
* BeOS Support functions
* BeOS Support functions
*
*
* Copyright (c) 1999-200
0
, Cyril VELTER
* Copyright (c) 1999-200
1
, Cyril VELTER
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -279,6 +279,8 @@ void beos_backend_startup(void)
...
@@ -279,6 +279,8 @@ void beos_backend_startup(void)
delete_area
(
inf
.
area
);
delete_area
(
inf
.
area
);
/* Find the postmaster area */
/* Find the postmaster area */
area_postmaster
=
find_area
(
inf
.
name
);
area_postmaster
=
find_area
(
inf
.
name
);
/* Compute new area name */
sprintf
(
nvnom
,
"SYSV_IPC %d"
,
area_postmaster
);
/* Clone it at the exact same address */
/* Clone it at the exact same address */
clone_area
(
nvnom
,
&
area_address
,
B_CLONE_ADDRESS
,
B_READ_AREA
|
B_WRITE_AREA
,
area_postmaster
);
clone_area
(
nvnom
,
&
area_address
,
B_CLONE_ADDRESS
,
B_READ_AREA
|
B_WRITE_AREA
,
area_postmaster
);
}
}
...
...
src/backend/utils/init/miscinit.c
View file @
4bd983bf
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.6
2 2001/03/13 01:17:06
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.6
3 2001/03/18 18:22:08
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -540,11 +540,18 @@ CreateLockFile(const char *filename, bool amPostmaster,
...
@@ -540,11 +540,18 @@ CreateLockFile(const char *filename, bool amPostmaster,
/*
/*
* Check to see if the other process still exists
* Check to see if the other process still exists
*
* Normally kill() will fail with ESRCH if the given PID doesn't
* exist. BeOS returns EINVAL for some silly reason, however.
*/
*/
if
(
other_pid
!=
my_pid
)
if
(
other_pid
!=
my_pid
)
{
{
if
(
kill
(
other_pid
,
0
)
==
0
||
if
(
kill
(
other_pid
,
0
)
==
0
||
errno
!=
ESRCH
)
(
errno
!=
ESRCH
#ifdef __BEOS__
&&
errno
!=
EINVAL
#endif
))
{
{
/* lockfile belongs to a live process */
/* lockfile belongs to a live process */
fprintf
(
stderr
,
"Lock file
\"
%s
\"
already exists.
\n
"
,
fprintf
(
stderr
,
"Lock file
\"
%s
\"
already exists.
\n
"
,
...
...
src/include/port/beos.h
View file @
4bd983bf
...
@@ -20,6 +20,7 @@ typedef unsigned char slock_t;
...
@@ -20,6 +20,7 @@ typedef unsigned char slock_t;
#define IPC_EXCL 1024
#define IPC_EXCL 1024
#define IPC_PRIVATE 234564
#define IPC_PRIVATE 234564
#define IPC_NOWAIT 2048
#define IPC_NOWAIT 2048
#define IPC_STAT 4096
#define EACCESS 2048
#define EACCESS 2048
#define EIDRM 4096
#define EIDRM 4096
...
@@ -47,6 +48,7 @@ struct sembuf
...
@@ -47,6 +48,7 @@ struct sembuf
struct
shmid_ds
struct
shmid_ds
{
{
int
dummy
;
int
dummy
;
int
shm_nattch
;
};
};
int
semctl
(
int
semId
,
int
semNum
,
int
flag
,
union
semun
);
int
semctl
(
int
semId
,
int
semNum
,
int
flag
,
union
semun
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment