---
 libtrivfs/Makefile          |    4 ++--
 libtrivfs/fsys-get-source.c |   34 ++++++++++++++++++++++++++++++++++
 libtrivfs/get-source.c      |   28 ++++++++++++++++++++++++++++
 libtrivfs/trivfs.h          |    6 ++++++
 4 files changed, 70 insertions(+), 2 deletions(-)
 create mode 100644 libtrivfs/fsys-get-source.c
 create mode 100644 libtrivfs/get-source.c

diff --git a/libtrivfs/Makefile b/libtrivfs/Makefile
index 3163777..241b76d 100644
--- a/libtrivfs/Makefile
+++ b/libtrivfs/Makefile
@@ -25,7 +25,7 @@ FSSRCS= dir-link.c dir-mkdir.c dir-mkfile.c dir-lookup.c 
dir-readdir.c \
        file-getlinknode.c file-lock.c file-set-trans.c file-statfs.c \
        file-sync.c file-syncfs.c file-set-size.c file-utimes.c file-exec.c \
        file-access.c dir-chg.c file-chg.c file-get-storage-info.c \
-       file-get-fs-options.c file-reparent.c
+       file-get-fs-options.c file-reparent.c get-source.c
 
 IOSRCS=io-async-icky.c io-async.c io-duplicate.c io-map.c io-modes-get.c \
        io-modes-off.c io-modes-on.c io-modes-set.c io-owner-get.c \
@@ -35,7 +35,7 @@ IOSRCS=io-async-icky.c io-async.c io-duplicate.c io-map.c 
io-modes-get.c \
 
 FSYSSRCS=fsys-getroot.c fsys-goaway.c fsys-stubs.c fsys-syncfs.c \
        fsys-forward.c fsys-set-options.c fsys-get-options.c \
-       fsys-get-children.c
+       fsys-get-children.c fsys-get-source.c
 
 OTHERSRCS=demuxer.c protid-clean.c protid-dup.c cntl-create.c \
        cntl-clean.c migsupport.c times.c startup.c open.c \
diff --git a/libtrivfs/fsys-get-source.c b/libtrivfs/fsys-get-source.c
new file mode 100644
index 0000000..9b6933e
--- /dev/null
+++ b/libtrivfs/fsys-get-source.c
@@ -0,0 +1,34 @@
+/* fsys_get_source
+
+   Copyright (C) 2013 Free Software Foundation, Inc.
+
+   Written by Justus Winter <4win...@informatik.uni-hamburg.de>
+
+   This file is part of the GNU Hurd.
+
+   The GNU Hurd 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, or (at your option)
+   any later version.
+
+   The GNU Hurd 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 the GNU Hurd; see the file COPYING.  If not, write to
+   the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+
+#include "priv.h"
+
+/* Return information about the source of the receiving
+   filesystem.  */
+error_t
+trivfs_S_fsys_get_source (trivfs_control_t server,
+                          mach_port_t reply,
+                          mach_msg_type_name_t replyPoly,
+                          char *source)
+{
+  return trivfs_get_source (source);
+}
diff --git a/libtrivfs/get-source.c b/libtrivfs/get-source.c
new file mode 100644
index 0000000..fd6e027
--- /dev/null
+++ b/libtrivfs/get-source.c
@@ -0,0 +1,28 @@
+/* Default version of trivfs_get_source
+   Copyright (C) 2013 Free Software Foundation, Inc.
+
+   Written by Justus Winter <4win...@informatik.uni-hamburg.de>
+
+   This file is part of the GNU Hurd.
+
+   The GNU Hurd 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, or (at
+   your option) any later version.
+
+   The GNU Hurd 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; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA. */
+
+#include "priv.h"
+
+error_t
+trivfs_get_source (char *source)
+{
+  return EOPNOTSUPP;
+}
diff --git a/libtrivfs/trivfs.h b/libtrivfs/trivfs.h
index 33b0436..3034c55 100644
--- a/libtrivfs/trivfs.h
+++ b/libtrivfs/trivfs.h
@@ -233,6 +233,12 @@ error_t trivfs_set_options (struct trivfs_control *fsys,
    routine simply calls diskfs_append_std_options.  */
 error_t trivfs_append_args (struct trivfs_control *fsys,
                            char **argz, size_t *argz_len);
+
+/* The user may define this function.  The function must set source to
+   the source device of the filesystem. The function may return an
+   EOPNOTSUPP to indicate that the concept of a source device is not
+   applicable. The default function always returns EOPNOTSUPP. */
+error_t trivfs_get_source (char *source);
 
 /* Add the port class *CLASS to the list of control port classes recognized
    by trivfs; if *CLASS is 0, an attempt is made to allocate a new port
-- 
1.7.10.4


Reply via email to