aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils
diff options
context:
space:
mode:
authorfjoe <fjoe@FreeBSD.org>2006-12-06 06:15:46 +0800
committerfjoe <fjoe@FreeBSD.org>2006-12-06 06:15:46 +0800
commit11a55a7bbeb003523a5db7759b212ce216ab98c0 (patch)
tree8ce6e532ba42294dcbe0809b665b2788f366bd9f /sysutils
parentc3eb245bf1795ffbe737dbe9bca46e9d45c43807 (diff)
downloadfreebsd-ports-gnome-11a55a7bbeb003523a5db7759b212ce216ab98c0.tar.gz
freebsd-ports-gnome-11a55a7bbeb003523a5db7759b212ce216ab98c0.tar.zst
freebsd-ports-gnome-11a55a7bbeb003523a5db7759b212ce216ab98c0.zip
New port: The ntfs-3g driver is an open source, freely available read/write NTFS
driver, which provides safe and fast handling of the Windows XP, Windows Server 2003 and Windows 2000 filesystems. Almost the full POSIX filesystem functionality is supported, the major exceptions are changing the file ownerships and the access rights. WWW: http://www.linux-ntfs.org/
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/Makefile1
-rw-r--r--sysutils/fusefs-ntfs/Makefile37
-rw-r--r--sysutils/fusefs-ntfs/distinfo3
-rw-r--r--sysutils/fusefs-ntfs/files/patch-Makefile.in11
-rw-r--r--sysutils/fusefs-ntfs/files/patch-configure11
-rw-r--r--sysutils/fusefs-ntfs/files/patch-libntfs-3g-device_io.c14
-rw-r--r--sysutils/fusefs-ntfs/files/unix_io_raw.c593
-rw-r--r--sysutils/fusefs-ntfs/pkg-descr7
-rw-r--r--sysutils/fusefs-ntfs/pkg-plist35
9 files changed, 712 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile
index cb988e68baab..24f36937df2d 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -206,6 +206,7 @@
SUBDIR += fusefs-httpfs
SUBDIR += fusefs-kmod
SUBDIR += fusefs-libs
+ SUBDIR += fusefs-ntfs
SUBDIR += fusefs-smbnetfs
SUBDIR += fusefs-sqlfs
SUBDIR += fusefs-sshfs
diff --git a/sysutils/fusefs-ntfs/Makefile b/sysutils/fusefs-ntfs/Makefile
new file mode 100644
index 000000000000..c31a91213388
--- /dev/null
+++ b/sysutils/fusefs-ntfs/Makefile
@@ -0,0 +1,37 @@
+# New ports collection makefile for: fusefs-ntfs
+# Date created: 25 July 2006
+# Whom: Max Khon
+# $FreeBSD$
+#
+
+PORTNAME= ntfs
+PORTVERSION= 20061115.BETA
+CATEGORIES= sysutils
+MASTER_SITES= http://www.ntfs-3g.org/
+MASTER_SITE_SUBDIR= fuse
+PKGNAMEPREFIX= fusefs-
+DISTNAME= ${PORTNAME}-3g-0.${PORTVERSION:S,.,-,}
+EXTRACT_SUFX= .tgz
+
+MAINTAINER= fjoe@FreeBSD.org
+COMMENT= NTFS read-write driver for 32-bit, little-endian architectures
+
+LIB_DEPENDS= fuse.2:${PORTSDIR}/sysutils/fusefs-libs
+RUN_DEPENDS= ${LOCALBASE}/modules/fuse.ko:${PORTSDIR}/sysutils/fusefs-kmod
+BUILD_DEPENDS= fusefs-libs>=2.6.0:${PORTSDIR}/sysutils/fusefs-libs
+
+GNU_CONFIGURE= yes
+CONFIGURE_TARGET= --build=${ARCH}-portbld-freebsd${OSREL}
+ONLY_FOR_ARCH= i386
+INSTALLS_SHLIB= yes
+
+post-patch:
+ @${CP} ${FILESDIR}/unix_io_raw.c ${WRKSRC}/libntfs-3g
+
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} < 600000
+IGNORE= depends on kernel module that requires FreeBSD 6 or later
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/sysutils/fusefs-ntfs/distinfo b/sysutils/fusefs-ntfs/distinfo
new file mode 100644
index 000000000000..0d29177737af
--- /dev/null
+++ b/sysutils/fusefs-ntfs/distinfo
@@ -0,0 +1,3 @@
+MD5 (ntfs-3g-0.20061115-BETA.tgz) = 9a0c1a3d2a27deaeda6c39003e9f57c4
+SHA256 (ntfs-3g-0.20061115-BETA.tgz) = 07688def198062931fab960e3c44bfd083e109e5e15f4c9d429b824d7c83c2cb
+SIZE (ntfs-3g-0.20061115-BETA.tgz) = 559073
diff --git a/sysutils/fusefs-ntfs/files/patch-Makefile.in b/sysutils/fusefs-ntfs/files/patch-Makefile.in
new file mode 100644
index 000000000000..a8e9c7bb624c
--- /dev/null
+++ b/sysutils/fusefs-ntfs/files/patch-Makefile.in
@@ -0,0 +1,11 @@
+--- Makefile.in.orig Wed Dec 6 01:08:22 2006
++++ Makefile.in Wed Dec 6 01:08:30 2006
+@@ -18,7 +18,7 @@
+ VPATH = @srcdir@
+ pkgdatadir = $(datadir)/@PACKAGE@
+ pkglibdir = $(libdir)/@PACKAGE@
+-pkgincludedir = $(includedir)/@PACKAGE@
++pkgincludedir = $(includedir)/@PACKAGE@-3g
+ top_builddir = .
+ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+ INSTALL = @INSTALL@
diff --git a/sysutils/fusefs-ntfs/files/patch-configure b/sysutils/fusefs-ntfs/files/patch-configure
new file mode 100644
index 000000000000..038f6153aa27
--- /dev/null
+++ b/sysutils/fusefs-ntfs/files/patch-configure
@@ -0,0 +1,11 @@
+--- configure.orig Tue Jul 25 23:41:16 2006
++++ configure Tue Jul 25 23:40:37 2006
+@@ -19956,7 +19956,7 @@
+
+
+ case "$target_os" in
+-linux*)
++linux*|freebsd*)
+
+ succeeded=no
+
diff --git a/sysutils/fusefs-ntfs/files/patch-libntfs-3g-device_io.c b/sysutils/fusefs-ntfs/files/patch-libntfs-3g-device_io.c
new file mode 100644
index 000000000000..9dbb298d8228
--- /dev/null
+++ b/sysutils/fusefs-ntfs/files/patch-libntfs-3g-device_io.c
@@ -0,0 +1,14 @@
+--- libntfs-3g/device_io.c.orig Wed Dec 6 04:03:06 2006
++++ libntfs-3g/device_io.c Tue Dec 5 23:04:04 2006
+@@ -26,7 +26,11 @@
+ #ifndef __CYGWIN32__
+
+ /* Not on Cygwin; use standard Unix style low level device operations. */
++#if defined(__FreeBSD__)
++#include "unix_io_raw.c"
++#else
+ #include "unix_io.c"
++#endif
+
+ #else /* __CYGWIN32__ */
+
diff --git a/sysutils/fusefs-ntfs/files/unix_io_raw.c b/sysutils/fusefs-ntfs/files/unix_io_raw.c
new file mode 100644
index 000000000000..02ace1845c20
--- /dev/null
+++ b/sysutils/fusefs-ntfs/files/unix_io_raw.c
@@ -0,0 +1,593 @@
+/**
+ * unix_io.c - Unix style disk io functions. Originated from the Linux-NTFS project.
+ *
+ * Copyright (c) 2000-2006 Anton Altaparmakov
+ *
+ * This program/include file is free software; you can redistribute it and/or
+ * 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.
+ *
+ * This program/include file is distributed in the hope that it will be
+ * 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 NTFS-3G
+ * 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
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+#ifdef HAVE_LINUX_FD_H
+#include <linux/fd.h>
+#endif
+#include <sys/disk.h>
+
+#include "types.h"
+#include "mst.h"
+#include "debug.h"
+#include "device.h"
+#include "logging.h"
+
+typedef struct {
+ int fd;
+ s64 pos;
+ s32 block_size;
+ s64 media_size;
+} unix_raw_fd;
+
+#define DEV_FD(dev) (((unix_raw_fd *) dev->d_private))
+#define RAW_IO_ALIGNED(dev, offset, count) \
+ (DEV_FD(dev)->block_size == 0 || \
+ ((offset) % DEV_FD(dev)->block_size == 0 && \
+ (count) % DEV_FD(dev)->block_size == 0))
+#define RAW_IO_ALIGN(dev, offset) \
+ ((offset) / DEV_FD(dev)->block_size * DEV_FD(dev)->block_size)
+#define RAW_IO_MAX_SIZE (128 * 1024 * 1024)
+
+/* Define to nothing if not present on this system. */
+#ifndef O_EXCL
+# define O_EXCL 0
+#endif
+
+/**
+ * Get block_size and media_size
+ */
+static int
+raw_io_get_size(struct ntfs_device *dev)
+{
+ int bs;
+ off_t ms;
+ struct stat sb;
+
+ if (fstat(DEV_FD(dev)->fd, &sb) < 0) {
+ ntfs_log_perror("Failed to stat '%s'", dev->d_name);
+ return -1;
+ }
+
+ if (S_ISREG(sb.st_mode)) {
+ DEV_FD(dev)->media_size = sb.st_size;
+ ntfs_log_trace("%s: regular file (media_size %lld)\n",
+ dev->d_name, DEV_FD(dev)->media_size);
+ return 0;
+ }
+
+ if (ioctl(DEV_FD(dev)->fd, DIOCGSECTORSIZE, &bs) < 0) {
+ ntfs_log_perror("Failed to ioctl(DIOCGSECTORSIZE) '%s'",
+ dev->d_name);
+ return -1;
+ }
+ DEV_FD(dev)->block_size = bs;
+ ntfs_log_trace("%s: block size %d\n", dev->d_name, bs);
+
+ if (ioctl(DEV_FD(dev)->fd, DIOCGMEDIASIZE, &ms) < 0) {
+ ntfs_log_perror("Failed to ioctl(DIOCGMEDIASIZE) '%s'",
+ dev->d_name);
+ return -1;
+ }
+ DEV_FD(dev)->media_size = ms;
+ ntfs_log_trace("%s: media size %lld\n", dev->d_name, ms);
+ return 0;
+}
+
+/**
+ * Aligned read
+ */
+static ssize_t
+raw_io_pread(struct ntfs_device *dev, char *buf, size_t count, s64 offset)
+{
+ return pread(DEV_FD(dev)->fd, buf, count, offset);
+}
+
+/**
+ * Aligned write
+ */
+static ssize_t
+raw_io_pwrite(struct ntfs_device *dev, const char *buf, size_t count, s64 offset)
+{
+ return pwrite(DEV_FD(dev)->fd, buf, count, offset);
+}
+
+/**
+ * ntfs_device_unix_raw_io_open - Open a device and lock it exclusively
+ * @dev:
+ * @flags:
+ *
+ * Description...
+ *
+ * Returns:
+ */
+static int ntfs_device_unix_raw_io_open(struct ntfs_device *dev, int flags)
+{
+#if 0
+ struct flock flk;
+#endif
+ struct stat sbuf;
+ int err;
+
+ if (NDevOpen(dev)) {
+ errno = EBUSY;
+ return -1;
+ }
+ if (stat(dev->d_name, &sbuf)) {
+ ntfs_log_perror("Failed to access '%s'", dev->d_name);
+ return -1;
+ }
+ if (S_ISBLK(sbuf.st_mode) || S_ISCHR(sbuf.st_mode))
+ NDevSetBlock(dev);
+
+ dev->d_private = malloc(sizeof(unix_raw_fd));
+ if (!dev->d_private)
+ return -1;
+ DEV_FD(dev)->fd = -1;
+ DEV_FD(dev)->pos = 0;
+ DEV_FD(dev)->block_size = 0;
+ DEV_FD(dev)->media_size = 0;
+
+ /*
+ * Open file for exclusive access if mounting r/w.
+ * Fuseblk takes care about block devices.
+ */
+ if (!NDevBlock(dev) && (flags & O_RDWR) == O_RDWR)
+ flags |= O_EXCL;
+ DEV_FD(dev)->fd = open(dev->d_name, flags);
+ if (DEV_FD(dev)->fd == -1) {
+ err = errno;
+ goto err_out;
+ }
+
+ if ((flags & O_RDWR) != O_RDWR)
+ NDevSetReadOnly(dev);
+
+#if 0
+ memset(&flk, 0, sizeof(flk));
+ if (NDevReadOnly(dev))
+ flk.l_type = F_RDLCK;
+ else
+ flk.l_type = F_WRLCK;
+ flk.l_whence = SEEK_SET;
+ flk.l_start = flk.l_len = 0LL;
+ if (fcntl(DEV_FD(dev)->fd, F_SETLK, &flk)) {
+ err = errno;
+ ntfs_log_perror("Failed to %s lock '%s'", NDevReadOnly(dev) ?
+ "read" : "write", dev->d_name);
+ if (close(DEV_FD(dev)->fd))
+ ntfs_log_perror("Failed to close '%s'", dev->d_name);
+ goto err_out;
+ }
+#endif
+
+ if (raw_io_get_size(dev) < 0) {
+ err = errno;
+ close(DEV_FD(dev)->fd);
+ goto err_out;
+ }
+
+ NDevSetOpen(dev);
+ return 0;
+err_out:
+ free(dev->d_private);
+ dev->d_private = NULL;
+ errno = err;
+ return -1;
+}
+
+/**
+ * ntfs_device_unix_raw_io_close - Close the device, releasing the lock
+ * @dev:
+ *
+ * Description...
+ *
+ * Returns:
+ */
+static int ntfs_device_unix_raw_io_close(struct ntfs_device *dev)
+{
+#if 0
+ struct flock flk;
+#endif
+
+ if (!NDevOpen(dev)) {
+ errno = EBADF;
+ return -1;
+ }
+ if (NDevDirty(dev))
+ fsync(DEV_FD(dev)->fd);
+
+#if 0
+ /* Release exclusive (mandatory) lock on the whole device. */
+ memset(&flk, 0, sizeof(flk));
+ flk.l_type = F_UNLCK;
+ flk.l_whence = SEEK_SET;
+ flk.l_start = flk.l_len = 0LL;
+ if (fcntl(DEV_FD(dev)->fd, F_SETLK, &flk))
+ ntfs_log_perror("ntfs_device_unix_raw_io_close: Warning: Could not "
+ "unlock %s", dev->d_name);
+#endif
+
+ /* Close the file descriptor and clear our open flag. */
+ if (close(DEV_FD(dev)->fd))
+ return -1;
+ NDevClearOpen(dev);
+ free(dev->d_private);
+ dev->d_private = NULL;
+ return 0;
+}
+
+/**
+ * ntfs_device_unix_raw_io_seek - Seek to a place on the device
+ * @dev:
+ * @offset:
+ * @whence:
+ *
+ * Description...
+ *
+ * Returns:
+ */
+static s64 ntfs_device_unix_raw_io_seek(struct ntfs_device *dev, s64 offset,
+ int whence)
+{
+ s64 abs_pos;
+
+ ntfs_log_trace("seek offset = 0x%llx, whence = %d.\n", offset, whence);
+ switch (whence) {
+ case SEEK_SET:
+ abs_pos = offset;
+ break;
+
+ case SEEK_CUR:
+ abs_pos = DEV_FD(dev)->pos + offset;
+ break;
+
+ case SEEK_END:
+ abs_pos = DEV_FD(dev)->media_size + offset;
+ break;
+
+ default:
+ ntfs_log_trace("Wrong mode %d.\n", whence);
+ errno = EINVAL;
+ return -1;
+ }
+
+ if (abs_pos < 0 || abs_pos > DEV_FD(dev)->media_size) {
+ ntfs_log_trace("Seeking outsize seekable area.\n");
+ errno = EINVAL;
+ return -1;
+ }
+ DEV_FD(dev)->pos = abs_pos;
+ return abs_pos;
+}
+
+/**
+ * ntfs_device_unix_raw_io_read - Read from the device, from the current location
+ * @dev:
+ * @buf:
+ * @count:
+ *
+ * Description...
+ *
+ * Returns:
+ */
+static s64 ntfs_device_unix_raw_io_read(struct ntfs_device *dev, void *buf,
+ s64 count)
+{
+ s64 start, start_aligned;
+ s64 end, end_aligned;
+ size_t count_aligned;
+ char *buf_aligned;
+ ssize_t nr;
+
+ /* short-circuit for regular files */
+ start = DEV_FD(dev)->pos;
+ if (count > RAW_IO_MAX_SIZE)
+ count = RAW_IO_MAX_SIZE;
+ if (RAW_IO_ALIGNED(dev, start, count)) {
+ nr = raw_io_pread(dev, buf, count, start);
+ if (nr <= 0)
+ return nr;
+
+ DEV_FD(dev)->pos += nr;
+ return nr;
+ }
+
+ /*
+ * +- start_aligned +- end_aligned
+ * | |
+ * | +- start +- end |
+ * v v v v
+ * |----------|----------|----------|
+ * ^ ^
+ * +----- count ------+
+ * ^ ^
+ * +-------- count_aligned ---------+
+ */
+ start_aligned = RAW_IO_ALIGN(dev, start);
+ end = start + count;
+ end_aligned = RAW_IO_ALIGN(dev, end) +
+ (RAW_IO_ALIGNED(dev, end, 0) ? 0 : DEV_FD(dev)->block_size);
+ count_aligned = end_aligned - start_aligned;
+ ntfs_log_trace(
+ "%s: count = 0x%llx/0x%x, start = 0x%llx/0x%llx, end = 0x%llx/0x%llx\n",
+ dev->d_name, count, count_aligned,
+ start, start_aligned, end, end_aligned);
+
+ /* allocate buffer */
+ buf_aligned = malloc(count_aligned);
+ if (buf_aligned == NULL) {
+ ntfs_log_trace("malloc(%d) failed\n", count_aligned);
+ return -1;
+ }
+
+ /* read aligned data */
+ nr = raw_io_pread(dev, buf_aligned, count_aligned, start_aligned);
+ if (nr == 0)
+ return 0;
+ if (nr < 0 || nr < start - start_aligned) {
+ free(buf_aligned);
+ return -1;
+ }
+
+ /* copy out */
+ memcpy(buf, buf_aligned + (start - start_aligned), count);
+ free(buf_aligned);
+
+ nr -= start - start_aligned;
+ if (nr > count)
+ nr = count;
+ DEV_FD(dev)->pos += nr;
+ return nr;
+}
+
+/**
+ * ntfs_device_unix_raw_io_write - Write to the device, at the current location
+ * @dev:
+ * @buf:
+ * @count:
+ *
+ * Description...
+ *
+ * Returns:
+ */
+static s64 ntfs_device_unix_raw_io_write(struct ntfs_device *dev, const void *buf,
+ s64 count)
+{
+ s64 start, start_aligned;
+ s64 end, end_aligned;
+ size_t count_aligned;
+ char *buf_aligned;
+ ssize_t nw;
+
+ if (NDevReadOnly(dev)) {
+ errno = EROFS;
+ return -1;
+ }
+ NDevSetDirty(dev);
+
+ /* short-circuit for regular files */
+ start = DEV_FD(dev)->pos;
+ if (count > RAW_IO_MAX_SIZE)
+ count = RAW_IO_MAX_SIZE;
+ if (RAW_IO_ALIGNED(dev, start, count)) {
+ nw = raw_io_pwrite(dev, buf, count, start);
+ if (nw <= 0)
+ return nw;
+
+ DEV_FD(dev)->pos += nw;
+ return nw;
+ }
+
+ /*
+ * +- start_aligned +- end_aligned
+ * | |
+ * | +- start +- end |
+ * v v v v
+ * |----------|----------|----------|
+ * ^ ^
+ * +----- count ------+
+ * ^ ^
+ * +-------- count_aligned ---------+
+ */
+ start_aligned = RAW_IO_ALIGN(dev, start);
+ end = start + count;
+ end_aligned = RAW_IO_ALIGN(dev, end) +
+ (RAW_IO_ALIGNED(dev, end, 0) ? 0 : DEV_FD(dev)->block_size);
+ count_aligned = end_aligned - start_aligned;
+ ntfs_log_trace(
+ "%s: count = 0x%llx/0x%x, start = 0x%llx/0x%llx, end = 0x%llx/0x%llx\n",
+ dev->d_name, count, count_aligned,
+ start, start_aligned, end, end_aligned);
+
+ /* allocate buffer */
+ buf_aligned = malloc(count_aligned);
+ if (buf_aligned == NULL) {
+ ntfs_log_trace("malloc(%d) failed\n", count_aligned);
+ return -1;
+ }
+
+ /* read aligned lead-in */
+ if (raw_io_pread(dev, buf_aligned, DEV_FD(dev)->block_size, start_aligned) != DEV_FD(dev)->block_size) {
+ ntfs_log_trace("read lead-in failed\n");
+ free(buf_aligned);
+ return -1;
+ }
+
+ /* read aligned lead-out */
+ if (end != end_aligned && count_aligned > DEV_FD(dev)->block_size) {
+ if (raw_io_pread(dev, buf_aligned + count_aligned - DEV_FD(dev)->block_size, DEV_FD(dev)->block_size, end_aligned - DEV_FD(dev)->block_size) != DEV_FD(dev)->block_size) {
+ ntfs_log_trace("read lead-out failed\n");
+ free(buf_aligned);
+ return -1;
+ }
+ }
+
+ /* copy data to write */
+ memcpy(buf_aligned + (start - start_aligned), buf, count);
+
+ /* write aligned data */
+ nw = raw_io_pwrite(dev, buf_aligned, count_aligned, start_aligned);
+ free(buf_aligned);
+ if (nw < 0 || nw < start - start_aligned)
+ return -1;
+
+ nw -= start - start_aligned;
+ if (nw > count)
+ nw = count;
+ DEV_FD(dev)->pos += nw;
+ return nw;
+}
+
+/**
+ * ntfs_device_unix_raw_io_pread - Perform a positioned read from the device
+ * @dev:
+ * @buf:
+ * @count:
+ * @offset:
+ *
+ * Description...
+ *
+ * Returns:
+ */
+static s64 ntfs_device_unix_raw_io_pread(struct ntfs_device *dev, void *buf,
+ s64 count, s64 offset)
+{
+ return ntfs_pread(dev, offset, count, buf);
+}
+
+/**
+ * ntfs_device_unix_raw_io_pwrite - Perform a positioned write to the device
+ * @dev:
+ * @buf:
+ * @count:
+ * @offset:
+ *
+ * Description...
+ *
+ * Returns:
+ */
+static s64 ntfs_device_unix_raw_io_pwrite(struct ntfs_device *dev, const void *buf,
+ s64 count, s64 offset)
+{
+ if (NDevReadOnly(dev)) {
+ errno = EROFS;
+ return -1;
+ }
+ NDevSetDirty(dev);
+
+ return ntfs_pwrite(dev, offset, count, buf);
+}
+
+/**
+ * ntfs_device_unix_raw_io_sync - Flush any buffered changes to the device
+ * @dev:
+ *
+ * Description...
+ *
+ * Returns:
+ */
+static int ntfs_device_unix_raw_io_sync(struct ntfs_device *dev)
+{
+ if (!NDevReadOnly(dev)) {
+ int res = fsync(DEV_FD(dev)->fd);
+ if (!res)
+ NDevClearDirty(dev);
+ return res;
+ }
+ return 0;
+}
+
+/**
+ * ntfs_device_unix_raw_io_stat - Get information about the device
+ * @dev:
+ * @buf:
+ *
+ * Description...
+ *
+ * Returns:
+ */
+static int ntfs_device_unix_raw_io_stat(struct ntfs_device *dev, struct stat *buf)
+{
+ return fstat(DEV_FD(dev)->fd, buf);
+}
+
+/**
+ * ntfs_device_unix_raw_io_ioctl - Perform an ioctl on the device
+ * @dev:
+ * @request:
+ * @argp:
+ *
+ * Description...
+ *
+ * Returns:
+ */
+static int ntfs_device_unix_raw_io_ioctl(struct ntfs_device *dev, int request,
+ void *argp)
+{
+ return ioctl(DEV_FD(dev)->fd, request, argp);
+}
+
+/**
+ * Device operations for working with unix style devices and files.
+ */
+struct ntfs_device_operations ntfs_device_unix_io_ops = {
+ .open = ntfs_device_unix_raw_io_open,
+ .close = ntfs_device_unix_raw_io_close,
+ .seek = ntfs_device_unix_raw_io_seek,
+ .read = ntfs_device_unix_raw_io_read,
+ .write = ntfs_device_unix_raw_io_write,
+ .pread = ntfs_device_unix_raw_io_pread,
+ .pwrite = ntfs_device_unix_raw_io_pwrite,
+ .sync = ntfs_device_unix_raw_io_sync,
+ .stat = ntfs_device_unix_raw_io_stat,
+ .ioctl = ntfs_device_unix_raw_io_ioctl,
+};
diff --git a/sysutils/fusefs-ntfs/pkg-descr b/sysutils/fusefs-ntfs/pkg-descr
new file mode 100644
index 000000000000..07f474cf3197
--- /dev/null
+++ b/sysutils/fusefs-ntfs/pkg-descr
@@ -0,0 +1,7 @@
+The ntfs-3g driver is an open source, freely available read/write NTFS
+driver, which provides safe and fast handling of the Windows XP, Windows
+Server 2003 and Windows 2000 filesystems. Almost the full POSIX filesystem
+functionality is supported, the major exceptions are changing the file
+ownerships and the access rights.
+
+WWW: http://www.linux-ntfs.org/
diff --git a/sysutils/fusefs-ntfs/pkg-plist b/sysutils/fusefs-ntfs/pkg-plist
new file mode 100644
index 000000000000..fa9817110a39
--- /dev/null
+++ b/sysutils/fusefs-ntfs/pkg-plist
@@ -0,0 +1,35 @@
+bin/ntfs-3g
+include/ntfs-3g/attrib.h
+include/ntfs-3g/attrlist.h
+include/ntfs-3g/bitmap.h
+include/ntfs-3g/bootsect.h
+include/ntfs-3g/collate.h
+include/ntfs-3g/compat.h
+include/ntfs-3g/compress.h
+include/ntfs-3g/debug.h
+include/ntfs-3g/device.h
+include/ntfs-3g/device_io.h
+include/ntfs-3g/dir.h
+include/ntfs-3g/endians.h
+include/ntfs-3g/index.h
+include/ntfs-3g/inode.h
+include/ntfs-3g/layout.h
+include/ntfs-3g/lcnalloc.h
+include/ntfs-3g/list.h
+include/ntfs-3g/logfile.h
+include/ntfs-3g/logging.h
+include/ntfs-3g/mft.h
+include/ntfs-3g/mst.h
+include/ntfs-3g/ntfstime.h
+include/ntfs-3g/runlist.h
+include/ntfs-3g/security.h
+include/ntfs-3g/support.h
+include/ntfs-3g/types.h
+include/ntfs-3g/unistr.h
+include/ntfs-3g/version.h
+include/ntfs-3g/volume.h
+lib/libntfs-3g.a
+lib/libntfs-3g.la
+lib/libntfs-3g.so
+lib/libntfs-3g.so.0
+@dirrm include/ntfs-3g