#else
#include <unistd.h> /* for lseek() */
#endif
+#ifdef NETWARE
+#include <nwsemaph.h>
+#endif
/*
};
datum nullitem = {NULL, 0};
+#ifdef NETWARE
+extern LONG locking_sem;
+#endif
DBM *
sdbm_open(file, flags, mode)
pagname = strcpy(dirname + strlen(dirname) + 1, file);
pagname = strcat(pagname, PAGFEXT);
+#ifdef NETWARE
+ locking_sem = OpenLocalSemaphore (1);
+#endif
+
db = sdbm_prep(dirname, pagname, flags, mode);
free((char *) dirname);
return db;
* open the files in sequence, and stat the dirfile.
* If we fail anywhere, undo everything, return NULL.
*/
-#if defined(OS2) || defined(MSDOS) || defined(WIN32)
+#if defined(OS2) || defined(MSDOS) || defined(WIN32) || defined(NETWARE)
flags |= O_BINARY;
#endif
if ((db->pagf = open(pagname, flags, mode)) > -1) {
(void) sdbm_fd_unlock(db->pagf);
(void) close(db->pagf);
free((char *) db);
+#ifdef NETWARE
+ CloseLocalSemaphore (locking_sem);
+#endif
}
}
#endif
#if !defined(USE_FCNTL) && !defined(USE_FLOCK)
#define USE_FLOCK 1
-#if !defined(MPE) && !defined(WIN32)
+#if !defined(MPE) && !defined(WIN32) && !defined(NETWARE)
#include <sys/file.h>
#endif
#ifndef LOCK_UN
#define USE_LOCKING
#include <sys/locking.h>
#endif
+#ifdef NETWARE
+#undef USE_FCNTL
+#define USE_SEM_LOCKING
+#include <nwsemaph.h>
+LONG locking_sem = 0;
+#endif
#ifdef USE_FCNTL
lseek(fd, 0, SEEK_SET);
rc = _locking(fd, _LK_LOCK, 1);
#endif
+#ifdef USE_SEM_LOCKING
+ if ((locking_sem != 0) && (TimedWaitOnLocalSemaphore (locking_sem, 10000) != 0))
+ rc = -1;
+ else
+ rc = 1;
+#endif
return rc;
}
lseek(fd, 0, SEEK_SET);
rc = _locking(fd, _LK_UNLCK, 1);
#endif
+#ifdef USE_SEM_LOCKING
+ if (locking_sem)
+ SignalLocalSemaphore (locking_sem);
+ rc = 1;
+#endif
return rc;
}
#include "http_core.h"
#include "http_log.h"
#include "http_protocol.h"
-#if defined(WIN32)
+#if (defined(WIN32) || defined(NETWARE))
#include <sdbm.h>
#define dbm_open sdbm_open
#define dbm_fetch sdbm_fetch