summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture')
-rwxr-xr-x[-rw-r--r--]source4/torture/util_smb.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source4/torture/util_smb.c b/source4/torture/util_smb.c
index 1c50694279..99b00d2329 100644..100755
--- a/source4/torture/util_smb.c
+++ b/source4/torture/util_smb.c
@@ -257,6 +257,23 @@ void *shm_setup(int size)
int shmid;
void *ret;
+#ifdef __QNXNTO__
+ shmid = shm_open("private", O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
+ if (shmid == -1) {
+ printf("can't get shared memory\n");
+ exit(1);
+ }
+ shm_unlink("private");
+ if (ftruncate(shmid, size) == -1) {
+ printf("can't set shared memory size\n");
+ exit(1);
+ }
+ ret = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, shmid, 0);
+ if (ret == MAP_FAILED) {
+ printf("can't map shared memory\n");
+ exit(1);
+ }
+#else
shmid = shmget(IPC_PRIVATE, size, SHM_R | SHM_W);
if (shmid == -1) {
printf("can't get shared memory\n");
@@ -275,6 +292,7 @@ void *shm_setup(int size)
See Stevens "advanced programming in unix env" for details
*/
shmctl(shmid, IPC_RMID, 0);
+#endif
return ret;
}