/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 1997, 1998
* Sleepycat Software. All rights reserved.
*/
#include "config.h"
#ifndef lint
#endif /* not lint */
#ifndef NO_SYSTEM_INCLUDES
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <unistd.h>
#endif
#include "db_int.h"
#include "os_jump.h"
/*
* __db_open --
* Open a file descriptor.
*
* PUBLIC: int __db_open __P((const char *, u_int32_t, u_int32_t, int, int *));
*/
int
const char *name;
{
#if !defined(_WIN32) && defined(HAVE_SIGFILLSET)
#endif
return (EINVAL);
flags = 0;
/*
* DB requires the semantic that two files opened at the same time
* with O_CREAT and O_EXCL set will return failure in at least one.
*/
else
#ifdef _MSC_VER
if (arg_flags & DB_SEQUENTIAL)
flags |= _O_SEQUENTIAL;
else
if (arg_flags & DB_TEMPORARY)
flags |= _O_TEMPORARY;
#endif
#endif
if (arg_flags & DB_TRUNCATE)
#if !defined(_WIN32) && defined(HAVE_SIGFILLSET)
/*
* We block every signal we can get our hands on so that the temporary
* file isn't left around if we're interrupted at the wrong time. Of
* course, if we drop core in-between the calls we'll hang forever, but
* that's probably okay. ;-)
*/
if (arg_flags & DB_TEMPORARY) {
(void)sigfillset(&set);
}
#endif
/* Open the file. */
return (ret);
#if !defined(_WIN32)
/* Delete any temporary file; done for Win32 by _O_TEMPORARY. */
if (arg_flags & DB_TEMPORARY) {
(void)__os_unlink(name);
#if defined(HAVE_SIGFILLSET)
#endif
}
#endif
/*
* Deny access to any child process.
* VMS: does not have fd inheritance.
* Win32: done by O_NOINHERIT.
*/
(void)__os_close(*fdp);
return (ret);
}
#endif
return (0);
}
/*
* __os_open --
* Open a file.
*
* PUBLIC: int __os_open __P((const char *, int, int, int *));
*/
int
const char *name;
{
}
/*
* __os_close --
* Close a file descriptor.
*
* PUBLIC: int __os_close __P((int));
*/
int
int fd;
{
int ret;
}