about summary refs log tree commit diff
path: root/db2/os/os_config.c
diff options
context:
space:
mode:
Diffstat (limited to 'db2/os/os_config.c')
-rw-r--r--db2/os/os_config.c75
1 files changed, 19 insertions, 56 deletions
diff --git a/db2/os/os_config.c b/db2/os/os_config.c
index ecb4f1c2e7..7a89ba58ab 100644
--- a/db2/os/os_config.c
+++ b/db2/os/os_config.c
@@ -8,7 +8,7 @@
 #include "config.h"
 
 #ifndef lint
-static const char sccsid[] = "@(#)os_config.c	10.9 (Sleepycat) 11/28/97";
+static const char sccsid[] = "@(#)os_config.c	10.12 (Sleepycat) 1/8/98";
 #endif /* not lint */
 
 #ifndef NO_SYSTEM_INCLUDES
@@ -20,6 +20,22 @@ static const char sccsid[] = "@(#)os_config.c	10.9 (Sleepycat) 11/28/97";
 #include "db_int.h"
 
 /*
+ * __os_oldwin --
+ *	Return if Windows 95 (as opposed to Windows NT).
+ *
+ * PUBLIC: int __os_oldwin __P((void));
+ */
+int
+__os_oldwin()
+{
+#ifdef _WIN32
+	return ((GetVersion() & 0x80000000) != 0);
+#else
+	return (0);
+#endif
+}
+
+/*
  * XXX
  * We provide our own extern declarations so that we don't collide with
  * systems that get them wrong, e.g., SunOS.
@@ -41,7 +57,6 @@ imported extern char	*strdup __P((const char *));
 imported extern void    *realloc __P((void *, size_t));
 imported extern int	 unlink __P((const char *));
 imported extern ssize_t	 write __P((int, const void *, size_t));
-imported extern void	*memset __P((void *, int, size_t));
 
 /*
  * __db_jump --
@@ -110,8 +125,8 @@ db_jump_set(func, which)
 		__db_jump.db_fsync = (int (*) __P((int)))func;
 		break;
 	case DB_FUNC_IOINFO:
-		__db_jump.db_ioinfo =
-		    (int (*) __P((const char *, int, off_t *, off_t *)))func;
+		__db_jump.db_ioinfo = (int (*) __P((const char *,
+		    int, u_int32_t *, u_int32_t *, u_int32_t *)))func;
 		break;
 	case DB_FUNC_MALLOC:
 		__db_jump.db_malloc = (void *(*) __P((size_t)))func;
@@ -178,55 +193,3 @@ db_value_set(value, which)
 	}
 	return (0);
 }
-
-/*
- * XXX
- * Correct for systems that return NULL when you allocate 0 bytes of memory.
- * There are several places in DB where we allocate the number of bytes held
- * by the key/data item, and it can be 0.  Correct here so that malloc never
- * returns a NULL for that reason.
- */
-/*
- * __db_calloc --
- *	The calloc(3) function for DB.
- *
- * PUBLIC: void *__db_calloc __P((size_t, size_t));
- */
-void *
-__db_calloc(num, size)
-	size_t num, size;
-{
-	void *p;
-
-	size *= num;
-	if ((p = __db_jump.db_malloc(size == 0 ? 1 : size)) != NULL)
-		memset(p, 0, size);
-	return (p);
-}
-
-/*
- * __db_malloc --
- *	The malloc(3) function for DB.
- *
- * PUBLIC: void *__db_malloc __P((size_t));
- */
-void *
-__db_malloc(size)
-	size_t size;
-{
-	return (__db_jump.db_malloc(size == 0 ? 1 : size));
-}
-
-/*
- * __db_realloc --
- *	The realloc(3) function for DB.
- *
- * PUBLIC: void *__db_realloc __P((void *, size_t));
- */
-void *
-__db_realloc(ptr, size)
-	void *ptr;
-	size_t size;
-{
-	return (__db_jump.db_realloc(ptr, size == 0 ? 1 : size));
-}