unix_io.c revision 7e7bd3dccbfe8f79e25e5c1554b5bc3a9aaca321
/**
* unix_io.c - Unix style disk io functions. Part of the Linux-NTFS project.
*
* Copyright (c) 2000-2006 Anton Altaparmakov
*
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (in the main directory of the Linux-NTFS
* distribution in the file COPYING); if not, write to the Free Software
* Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#endif
#ifdef HAVE_SYS_STAT_H
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
#endif
#ifdef HAVE_LINUX_FD_H
#endif
#include "types.h"
#include "mst.h"
#include "debug.h"
#include "device.h"
#include "logging.h"
/* Define to nothing if not present on this system. */
#ifndef O_EXCL
# define O_EXCL 0
#endif
/**
* ntfs_device_unix_io_open - Open a device and lock it exclusively
* @dev:
* @flags:
*
* Description...
*
* Returns:
*/
{
int err;
return -1;
}
return -1;
goto err_out;
}
/* Setup our read-only flag. */
/* Acquire exclusive (mandatory) lock on the whole device. */
if (NDevReadOnly(dev))
else
ntfs_log_debug("ntfs_device_unix_io_open: Could not lock %s "
"reading" : "writing");
ntfs_log_perror("ntfs_device_unix_io_open: Warning: "
goto err_out;
}
/* Determine if device is a block device or not, ignoring errors. */
/* Set our open flag. */
return 0;
return -1;
}
/**
* ntfs_device_unix_io_close - Close the device, releasing the lock
* @dev:
*
* Description...
*
* Returns:
*/
{
return -1;
}
/* Release exclusive (mandatory) lock on the whole device. */
ntfs_log_perror("ntfs_device_unix_io_close: Warning: Could not "
/* Close the file descriptor and clear our open flag. */
return -1;
return 0;
}
/**
* ntfs_device_unix_io_seek - Seek to a place on the device
* @dev:
* @offset:
* @whence:
*
* Description...
*
* Returns:
*/
int whence)
{
}
/**
* ntfs_device_unix_io_read - Read from the device, from the current location
* @dev:
* @buf:
* @count:
*
* Description...
*
* Returns:
*/
{
}
/**
* ntfs_device_unix_io_write - Write to the device, at the current location
* @dev:
* @buf:
* @count:
*
* Description...
*
* Returns:
*/
{
if (NDevReadOnly(dev)) {
return -1;
}
}
/**
* ntfs_device_unix_io_pread - Perform a positioned read from the device
* @dev:
* @buf:
* @count:
* @offset:
*
* Description...
*
* Returns:
*/
{
}
/**
* ntfs_device_unix_io_pwrite - Perform a positioned write to the device
* @dev:
* @buf:
* @count:
* @offset:
*
* Description...
*
* Returns:
*/
{
if (NDevReadOnly(dev)) {
return -1;
}
}
/**
* ntfs_device_unix_io_sync - Flush any buffered changes to the device
* @dev:
*
* Description...
*
* Returns:
*/
{
if (!res)
return res;
}
return 0;
}
/**
* ntfs_device_unix_io_stat - Get information about the device
* @dev:
* @buf:
*
* Description...
*
* Returns:
*/
{
}
/**
* ntfs_device_unix_io_ioctl - Perform an ioctl on the device
* @dev:
* @request:
* @argp:
*
* Description...
*
* Returns:
*/
void *argp)
{
}
/**
* Device operations for working with unix style devices and files.
*/
struct ntfs_device_operations ntfs_device_unix_io_ops = {
};