diff options
author | Nathan Scott <nathans@sgi.com> | 2001-01-17 01:36:55 +0000 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2001-01-17 01:36:55 +0000 |
commit | ee0b5b8e73761ab74367012c44b01058a5a0ee89 (patch) | |
tree | 9804d8fc5e18f2822218cb92de61fa514b27d353 | |
parent | f3210355b40f375ee67a35192657824e7d7cbc89 (diff) | |
download | dmapi-dev-ee0b5b8e73761ab74367012c44b01058a5a0ee89.tar.gz |
initial version for reworked dmapi build environment.
45 files changed, 4328 insertions, 56 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3ffc074 --- /dev/null +++ b/Makefile @@ -0,0 +1,74 @@ +# +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +# + +TOPDIR = . +HAVE_BUILDDEFS = $(shell test -f $(TOPDIR)/include/builddefs && echo yes || echo no) + +ifeq ($(HAVE_BUILDDEFS), yes) +include $(TOPDIR)/include/builddefs +endif + +CONFIGURE = configure include/builddefs +LSRCFILES = configure configure.in Makepkgs install-sh README VERSION +LDIRT = config.* conftest* Logs/* built install.* install-dev.* *.gz + +SUBDIRS = include libdm man doc debian build + +default: $(CONFIGURE) +ifeq ($(HAVE_BUILDDEFS), no) + $(MAKE) -C . $@ +else + $(SUBDIRS_MAKERULE) +endif + +ifeq ($(HAVE_BUILDDEFS), yes) +include $(BUILDRULES) +else +clean: # if configure hasn't run, nothing to clean +endif + +$(CONFIGURE): configure.in include/builddefs.in VERSION + rm -f config.cache + autoconf + ./configure + +install: default + $(SUBDIRS_MAKERULE) + $(INSTALL) -m 755 -d $(PKG_DOC_DIR) + $(INSTALL) -m 644 README $(PKG_DOC_DIR) + +install-dev: default + $(SUBDIRS_MAKERULE) + +realclean distclean: clean + rm -f $(LDIRT) $(CONFIGURE) + [ ! -d Logs ] || rmdir Logs diff --git a/Makepkgs b/Makepkgs new file mode 100755 index 0000000..9f7bfa1 --- /dev/null +++ b/Makepkgs @@ -0,0 +1,110 @@ +#! /bin/sh +# +# Make whichever packages the system supports +# +LOGDIR=Logs + +clean=false +debian=false +verbose=false + +MAKE=${MAKE:-make} +test ! -z "$MAKE" && make=$MAKE + +for opt in $* +do + case "$opt" in + clean) + clean=true + ;; + debian) + debian=true + ;; + verbose) + verbose=true + ;; + *) + echo "Usage: Makepkgs [clean] [verbose] [debian]" + exit 1 + ;; + esac +done + +# start with a clean manifest +test -f files.rpm && rm -f files.rpm +test -f filesdevel.rpm && rm -f filesdevel.rpm + +test ! -d $LOGDIR && mkdir $LOGDIR +rm -rf $LOGDIR/* > /dev/null 2>&1 + +if $clean ; then + echo "== clean, log is $LOGDIR/clean" + if $verbose ; then + $MAKE clean 2>&1 | tee $LOGDIR/clean + else + $MAKE clean > $LOGDIR/clean 2>&1 + fi + if [ $? -ne 0 ] ; then + echo \"$MAKE clean\" failed, see log in $LOGDIR/clean + tail $LOGDIR/clean + exit 1 + fi +fi + +SUDO=${SUDO:-sudo} +test ! -z "$SUDO" && sudo=$SUDO +if $debian ; then + echo + echo "== Debian build, log is $LOGDIR/debian" + if $verbose ; then + exec dpkg-buildpackage -r$SUDO | tee $LOGDIR/debian + else + exec dpkg-buildpackage -r$SUDO > $LOGDIR/debian + fi +fi + +echo +echo "== configure, log is $LOGDIR/configure" +if $verbose ; then + autoconf 2>&1 | tee $LOGDIR/configure + ./configure 2>&1 | tee -a $LOGDIR/configure +else + autoconf > $LOGDIR/configure 2>&1 + ./configure >> $LOGDIR/configure 2>&1 +fi +if [ $? -ne 0 ] ; then + echo \"configure\" failed, see log in $LOGDIR/configure + tail $LOGDIR/configure + exit 1 +fi + +echo +echo "== default, log is $LOGDIR/default" +if $verbose ; then + $MAKE default 2>&1 | tee $LOGDIR/default +else + $MAKE default > $LOGDIR/default 2>&1 +fi +if [ $? -ne 0 ] ; then + echo \"$MAKE default\" failed, see log in $LOGDIR/default + tail $LOGDIR/default + exit 1 +fi + +echo +echo "== dist, log is $LOGDIR/dist" +[ ! -f .census ] && touch .census +if $verbose ; then + $MAKE -C build dist 2>&1 | tee $LOGDIR/dist +else + $MAKE -C build dist > $LOGDIR/dist 2>&1 +fi +if [ $? -ne 0 ] ; then + echo $MAKE dist failed, see log in $LOGDIR/dist + tail $LOGDIR/dist + exit 1 +else + grep '^Wrote:' $LOGDIR/dist | sed -e 's/\.\.\/\.\.\///' +fi + +exit 0 @@ -0,0 +1,15 @@ +DMAPI package README +____________________ + +See the file doc/INSTALL for build, installation and post- +install configuration steps. + +Refer to the dmapi(3) manual page for general Data Management +API (DMAPI) information. + +For more information and details on how to contribute to the +XFS project see the web pages at: + http://oss.sgi.com/projects/xfs/ + +For more information on the build process, please refer to +the doc/PORTING document. @@ -0,0 +1,7 @@ +# +# This file is used by configure to get version information +# +PKG_MAJOR=0 +PKG_MINOR=1 +PKG_REVISION=0 +PKG_BUILD=0 diff --git a/build/Makefile b/build/Makefile new file mode 100644 index 0000000..0411a6d --- /dev/null +++ b/build/Makefile @@ -0,0 +1,76 @@ +# +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +# + +TOPDIR = .. +include $(TOPDIR)/include/builddefs + +MANIFEST=src-manifest +SRCTAR=$(PKG_NAME)-$(PKG_VERSION).src.tar.gz + +LDIRT = $(MANIFEST) $(SRCTAR) bin-manifest $(TOPDIR)/$(PKG_NAME)-$(PKG_VERSION) + +# for clean and clobber +SUBDIRS = tar rpm + +# nothing to build here (it's all packaging) +default install install-dev : + +include $(BUILDRULES) + +# Symlink in the TOPDIR is used to pack files relative to +# product-version directory. +$(MANIFEST) : $(_FORCE) + @if [ ! -L $(TOPDIR)/$(PKG_NAME)-$(PKG_VERSION) ] ; then \ + $(LN_S) . $(TOPDIR)/$(PKG_NAME)-$(PKG_VERSION) ; \ + fi + @CDIR=`pwd`; cd $(TOPDIR); \ + $(MAKE) --no-print-directory source | \ + sed -e 's/^\./$(PKG_NAME)-$(PKG_VERSION)/' > $$CDIR/$@ ;\ + if [ $$? -ne 0 ] ; then \ + exit 1; \ + else \ + unset TAPE; \ + $(TAR) -T $$CDIR/$@ -cf - | $(ZIP) --best > $$CDIR/$(SRCTAR); \ + fi + +dist : default $(MANIFEST) + @DIST_MANIFEST=`pwd`/bin-manifest; DIST_ROOT=/tmp/$$$$; \ + export DIST_MANIFEST DIST_ROOT; \ + rm -f $$DIST_MANIFEST; \ + echo === install === && $(MAKE) -C $(TOPDIR) install || exit $$?; \ + if [ -x $(TAR) ]; then \ + ( echo "=== tar ===" && $(MAKEF) -C tar $@ || exit $$? ); \ + fi; \ + if [ -x $(RPM) ]; then \ + ( echo "=== rpm ===" && $(MAKEF) -C rpm $@ || exit $$? ); \ + fi; \ + test -z "$$KEEP_DIST_ROOT" || rm -rf $$DIST_ROOT; echo Done diff --git a/build/rpm/Makefile b/build/rpm/Makefile new file mode 100644 index 0000000..bd7eefe --- /dev/null +++ b/build/rpm/Makefile @@ -0,0 +1,76 @@ +# +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +# + +TOPDIR = ../.. +TREEROOT = $(shell cd ${TOPDIR}; pwd) +include $(TOPDIR)/include/builddefs + +SPECF = $(PKG_NAME).spec +LDIRT = $(PKG_NAME)*.rpm $(SPECF) rpmmacros rpm-*.rc $(TOPDIR)/files*.rpm + +LSRCFILES = macros.template $(SPECF).in rpm-2.rc.template + +default install install-dev : + +include $(BUILDRULES) + +# generate a binary rpm file +dist : default $(SPECF) rpm-$(RPM_VERSION).rc + $(RPM) -ba --rcfile ./rpm-$(RPM_VERSION).rc $(SPECF) + +# Because rpm prior to v.2.90 does not support macros and old style config +# is not supported by rpm v.3, we have to resort to such ugly hacks +ifneq ($RPM_VERSION,2) +rpm-$(RPM_VERSION).rc : rpmmacros + sed -e '/^macrofiles:/s|~/.rpmmacros|./rpmmacros|' </usr/lib/rpm/rpmrc >$@ + +rpmmacros : macros.template + @sed -e 's|%topdir%|$(TREEROOT)|g' < $< > $@ +else +rpm-2.rc: rpm-2.rc.template + @sed -e 's|%topdir%|$(TOPDIR)|g' < $< > $@ +endif + +.PHONY: $(SPECF) +${SPECF} : ${SPECF}.in + sed -e's|@pkg_name@|$(PKG_NAME)|g' \ + -e's|@pkg_version@|$(PKG_VERSION)|g' \ + -e's|@pkg_release@|$(PKG_RELEASE)|g' \ + -e's|@pkg_distribution@|$(PKG_DISTRIBUTION)|g' \ + -e's|@pkg_builder@|$(PKG_BUILDER)|g' \ + -e's|@build_root@|$(DIST_ROOT)|g' \ + -e'/^BuildRoot: *$$/d' \ + -e's|@pkg_var_dir@|$(PKG_VAR_DIR)|g' \ + -e's|@pkg_share_dir@|$(PKG_SHARE_DIR)|g' \ + -e's|@pkg_log_dir@|$(PKG_LOG_DIR)|g' \ + -e's|@pkg_tmp_dir@|$(PKG_TMP_DIR)|g' \ + -e's|@make@|$(MAKE)|g' < $< > $@ diff --git a/build/rpm/dmapi.spec.in b/build/rpm/dmapi.spec.in new file mode 100644 index 0000000..bd997b6 --- /dev/null +++ b/build/rpm/dmapi.spec.in @@ -0,0 +1,80 @@ +Summary: Data Management API runtime environment. +Name: @pkg_name@ +Version: @pkg_version@ +Release: @pkg_release@ +Distribution: @pkg_distribution@ +Packager: @pkg_builder@ +BuildRoot: @build_root@ +Prereq: /sbin/ldconfig +Source: @pkg_name@-@pkg_version@.src.tar.gz +Copyright: Copyright (C) 2000 Silicon Graphics, Inc. +Vendor: Silicon Graphics, Inc. +URL: http://oss.sgi.com/projects/xfs/ +Group: System Environment/Base + +%description +Files required by system software using the Data Management API +(DMAPI). This is used to implement the interface defined in the +X/Open document: Systems Management: Data Storage Managment +(XDSM) API dated February 1997. This interface is implemented +by the libdm library. + +%package devel +Summary: Data Management API static libraries and headers. +Group: Development/Libraries +Requires: @pkg_name@ + +%description devel +dmapi-devel contains the libraries and header files needed to +develop programs which make use of the Data Management API +(DMAPI). If you install dmapi-devel, you'll also want to install +the dmapi (runtime) package. + +# If .census exists, then no setup is necessary, just go and do the build, +# otherwise run setup +%prep +if [ -f .census ] ; then + if [ ! -d ${RPM_PACKAGE_NAME}-${RPM_PACKAGE_VERSION} ] ; then + ln -s . ${RPM_PACKAGE_NAME}-${RPM_PACKAGE_VERSION} + fi +else +%setup +touch .census +./configure +fi + +%build +@make@ + +%install +DIST_ROOT="$RPM_BUILD_ROOT" +DIST_INSTALL=`pwd`/install.manifest +DIST_INSTALL_DEV=`pwd`/install-dev.manifest +export DIST_ROOT DIST_INSTALL DIST_INSTALL_DEV +@make@ install DIST_MANIFEST="$DIST_INSTALL" +@make@ install-dev DIST_MANIFEST="$DIST_INSTALL_DEV" +files() +{ + sort | uniq | awk ' +$1 == "d" { printf ("%%%%dir %%%%attr(%s,%s,%s) %s\n", $2, $3, $4, $5); } +$1 == "f" { if (match ($6, "@pkg_man_dir@") || match ($6, "@pkg_doc_dir@")) { + printf ("%%%%doc "); + } + printf ("%%%%attr(%s,%s,%s) %s\n", $2, $3, $4, $6); } +$1 == "l" { print "%attr(0777,root,root)", $3; }' +} +set +x +files < "$DIST_INSTALL" > files.rpm +files < "$DIST_INSTALL_DEV" > filesdevel.rpm +set -x + +%clean +rm -rf $RPM_BUILD_ROOT + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files -f files.rpm + +%files devel -f filesdevel.rpm diff --git a/build/rpm/macros.template b/build/rpm/macros.template new file mode 100644 index 0000000..6ab46e1 --- /dev/null +++ b/build/rpm/macros.template @@ -0,0 +1,30 @@ +# +# rpmrc.template +# +# Template to fudge rpm directory structure inside IRIX-like build +# environment + +# Force 386 build on all platforms +%_target i386-pc-linux +%_target_cpu i386 +%_target_os linux + +# topdir == $(WORKAREA) +%_topdir %topdir% + +# Following directories are specific to the topdir +# This is where build is done. In our case it's the same as $WORKAREA +%_builddir %topdir% + +# This is where foo.1.99.tar.gz is living in the real world. +# Be careful not to run full rpm build as it will override the sources +%_sourcedir %topdir%/build + +# This is where binary RPM and source RPM would end up +%_rpmdir %topdir%/build/rpm +%_srcrpmdir %topdir%/build/rpm +%_specdir %topdir%/build/rpm + +# Leave RPM files in the same directory - we're not building for +# multiple architectures +%_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm diff --git a/build/rpm/rpm-2.rc.template b/build/rpm/rpm-2.rc.template new file mode 100644 index 0000000..f3b3eba --- /dev/null +++ b/build/rpm/rpm-2.rc.template @@ -0,0 +1,25 @@ +# +# rpmrc.template +# +# Template to fudge rpm directory structure inside IRIX-like build +# environment + +# topdir == $(WORKAREA) +topdir: %topdir% + +# Following directories are specific to the topdir +# This is where build is done. In out case it's the same as $WORKAREA +# Be careful not to run full rpm build as it will override the sources +builddir: %topdir% + +# This is where foo.1.99.tar.gz is living in the real world. +sourcedir: %topdir%/build + +# This is where binary RPM and source RPM would end up +rpmdir: %topdir%/build/rpm +srcrpmdir: %topdir%/build/rpm +specdir: %topdir%/build/rpm + +# Leave RPM files in the same directory - we're not building for +# multiple architectures +rpmfilename: %{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm diff --git a/build/tar/Makefile b/build/tar/Makefile new file mode 100644 index 0000000..63540f9 --- /dev/null +++ b/build/tar/Makefile @@ -0,0 +1,50 @@ +# +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +# + +TOPDIR = ../.. +include $(TOPDIR)/include/builddefs + +BINTAR=$(PKG_NAME)-$(PKG_VERSION).tar.gz +LDIRT = $(BINTAR) + +default install install-dev : + +include $(BUILDRULES) + +dist : default + @HERE=`pwd`; cd $${DIST_ROOT:-/}; \ + sort $$HERE/../bin-manifest | uniq | $(AWK) ' \ + $$1 == "f" { printf (".%s\n", $$6); } \ + $$1 == "d" { next; } \ + $$1 == "l" { printf (".%s\n", $$3); }' \ + | $(TAR) -T - -cf - | $(ZIP) --best > $$HERE/$(BINTAR) + @echo Wrote: `pwd`/$(BINTAR) diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..f982654 --- /dev/null +++ b/configure.in @@ -0,0 +1,155 @@ +dnl unpacking check - this file must exist +AC_INIT(include/dmapi.h) +pkg_name="dmapi" +AC_SUBST(pkg_name) + +# +# Note: the following environment variables may be set to override the +# defaults (to change paths and/or executables, build parameters, etc): +# +# DEBUG OPTIMIZER MAKE CC LD TAR ZIP RPM AWK SED ECHO +# MALLOCLIB DISTRIBUTION PACKAGE_BUILDER PREFIX ROOT_PREFIX +# + +DEBUG=${DEBUG:-'-DDEBUG'} # -DNDEBUG +OPTIMIZER=${OPTIMIZER:-'-g'} # -O2 +MALLOCLIB=${MALLOCLIB:-''} # /usr/lib/libefence.a + +dnl Debug build? +debug_build="$DEBUG" +AC_SUBST(debug_build) + +dnl Optimization options? +opt_build="$OPTIMIZER" +AC_SUBST(opt_build) + +dnl Alternate malloc library? +malloc_lib="$MALLOCLIB" +AC_SUBST(malloc_lib) + +dnl Set version +. VERSION + +pkg_version=${PKG_MAJOR}.${PKG_MINOR}.${PKG_REVISION} +pkg_release=$PKG_BUILD +AC_SUBST(pkg_version) +AC_SUBST(pkg_release) + +pkg_distribution="SGI ProPack" +test -z "$DISTRIBUTION" || pkg_distribution="$DISTRIBUTION" +AC_SUBST(pkg_distribution) + +pkg_builder=`id -u -n`@`hostname -f` +test -z "$PACKAGE_BUILDER" || pkg_builder="$PACKAGE_BUILDER" +AC_SUBST(pkg_builder) + +dnl check if user wants their own C compiler +test -z "$CC" && AC_PROG_CC +cc=$CC +AC_SUBST(cc) + +dnl check if users wants their own make +test -z "$MAKE" && AC_PATH_PROG(MAKE, make, /usr/bin/make) +make=$MAKE +AC_SUBST(make) + +dnl check if users wants their own linker +test -z "$LD" && AC_PATH_PROG(LD, ld, /usr/bin/ld) +ld=$LD +AC_SUBST(ld) + +dnl check if the tar program is available +test -z "$TAR" && AC_PATH_PROG(TAR, tar) +tar=$TAR +AC_SUBST(tar) + +dnl check if the gzip program is available +test -z "$ZIP" && AC_PATH_PROG(ZIP, gzip, /bin/gzip) +zip=$ZIP +AC_SUBST(zip) + +dnl check if the rpm program is available +test -z "$RPM" && AC_PATH_PROG(RPM, rpm, /bin/rpm) +rpm=$RPM +AC_SUBST(rpm) + +dnl .. and what version is rpm +rpm_version=0 +test -x $RPM && \ + rpm_version=`$RPM --version | awk '{print $NF}' | awk -F. '{print $1}'` +AC_SUBST(rpm_version) + +dnl check if the makedepend program is available +test -z "$MAKEDEPEND" && AC_PATH_PROG(MAKEDEPEND, makedepend, /bin/true) +makedepend=$MAKEDEPEND +AC_SUBST(makedepend) + +dnl check if symbolic links are supported +AC_PROG_LN_S + +dnl check if user wants their own awk, sed and echo +test -z "$AWK" && AC_PATH_PROG(AWK, awk, /bin/awk) +awk=$AWK +AC_SUBST(awk) +test -z "$SED" && AC_PATH_PROG(SED, sed, /bin/sed) +sed=$SED +AC_SUBST(sed) +test -z "$ECHO" && AC_PATH_PROG(ECHO, echo, /bin/echo) +echo=$ECHO +AC_SUBST(echo) + + +dnl alternate root and usr prefixes +test -z "$ROOT_PREFIX" && ROOT_PREFIX="" +root_prefix="$ROOT_PREFIX" +test -z "$PREFIX" && PREFIX="/usr" +prefix="$PREFIX" + +dnl man pages (source) +dnl also check if man page source is gzipped +dnl (usually on Debian, but not Redhat pre-7.0) +have_zipped_manpages=false +for d in ${prefix}/share/man ${prefix}/man ; do + if test -f $d/man1/man.1.gz + then + pkg_man_dir=$d + have_zipped_manpages=true + break + fi +done +AC_SUBST(pkg_man_dir) +AC_SUBST(have_zipped_manpages) + +dnl binaries +pkg_bin_dir=${prefix}/bin +AC_SUBST(pkg_bin_dir) + +dnl static libraries +pkg_lib_dir=${prefix}/lib +AC_SUBST(pkg_lib_dir) + +dnl runtime shared system libraries +pkg_slib_dir=${root_prefix}/lib +AC_SUBST(pkg_slib_dir) + +dnl system binaries +pkg_sbin_dir=${root_prefix}/bin +AC_SUBST(pkg_sbin_dir) + +dnl include files +pkg_inc_dir=${prefix}/include +AC_SUBST(pkg_inc_dir) + +dnl doc directory +pkg_doc_dir=${prefix}/share/doc/${pkg_name} +AC_SUBST(pkg_doc_dir) + + +dnl +dnl output files +dnl + +AC_OUTPUT( \ +dnl Build definitions for use in Makefiles + include/builddefs \ +) diff --git a/debian/Makefile b/debian/Makefile new file mode 100644 index 0000000..5987042 --- /dev/null +++ b/debian/Makefile @@ -0,0 +1,40 @@ +# +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +# + +TOPDIR = .. +include $(TOPDIR)/include/builddefs + +LSRCFILES = changelog control copyright rules + +default install install-dev: + +include $(BUILDRULES) diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..133a14d --- /dev/null +++ b/debian/changelog @@ -0,0 +1,9 @@ +dmapi (0.1.0) unstable; urgency=low + + * Initial release. + + -- Nathan Scott <nathans@debian.org> Thu, 4 Jan 2001 11:15:11 -0500 + +Local variables: +mode: debian-changelog +End: diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..843c743 --- /dev/null +++ b/debian/control @@ -0,0 +1,26 @@ +Source: dmapi +Section: admin +Priority: optional +Maintainer: Nathan Scott <nathans@debian.org> +Build-Depends: autoconf, debmake, xfsprogs-dev +Standards-Version: 3.1.1 + +Package: dmapi +Depends: ${shlibs:Depends} +Architecture: any +Description: Data Management API runtime environment + Files required by system software using the Data Management API + (DMAPI). This is used to implement the interface defined in the + X/Open document: Systems Management: Data Storage Management + (XDSM) API dated February 1997. This interface is implemented + by the libdm library. + +Package: dmapi-dev +Section: devel +Priority: extra +Depends: libc6-dev, dmapi +Architecture: any +Description: Data Management API static libraries and headers + dmapi-dev contains the libraries and header files needed to + develop programs which make use of the Data Management API + (DMAPI). diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..d956166 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,14 @@ +This package was debianized by Nathan Scott nathans@debian.org on +Sun, 19 Nov 2000 07:37:09 -0500. + +It can be downloaded from ftp://oss.sgi.com/projects/xfs/download/ + +Copyright: + +Copyright (C) 2000 Silicon Graphics, Inc. + +You are free to distribute this software under the terms of +the GNU General Public License. +On Debian systems, the complete text of the GNU General Public +License can be found in /usr/share/common-licenses/GPL file. + diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..6159ab3 --- /dev/null +++ b/debian/rules @@ -0,0 +1,60 @@ +#!/usr/bin/make -f + +package = dmapi +develop = $(package)-dev + +dirtmp = debian/tmp +dirdev = debian/$(develop) +doctmp = /usr/share/doc/$(package) +docdev = /usr/share/doc/$(develop) +pkgtmp = DIST_ROOT=`pwd`/$(dirtmp); export DIST_ROOT; +pkgdev = DIST_ROOT=`pwd`/$(dirdev); export DIST_ROOT; +stdenv = GZIP=-q; export GZIP; + +options = DEBUG="-DNDEBUG"; OPTIMIZER="-O2 -g"; export DEBUG OPTIMIZER; +checkdir = test -f debian/rules + +build: built +built: + @echo "== dpkg-buildpackage: build" 1>&2 + $(checkdir) + autoconf + $(options) ./configure + $(MAKE) default + touch built + +clean: + @echo "== dpkg-buildpackage: clean" 1>&2 + $(checkdir) + -rm -f built + $(MAKE) distclean + -rm -rf $(dirtmp) $(dirdev) debian/*substvars debian/files* + +binary-indep: + +binary-arch: checkroot built + @echo "== dpkg-buildpackage: binary-arch" 1>&2 + $(checkdir) + -rm -rf $(dirtmp) $(dirdev) + $(pkgtmp) $(MAKE) -C . install + $(pkgdev) $(MAKE) -C . install-dev + $(pkgtmp) $(MAKE) -C build src-manifest + $(pkgdev) ./install-sh -m 755 -d $(doctmp) + $(pkgdev) ./install-sh -m 755 -d $(docdev) + $(pkgdev) ./install-sh -m 644 debian/copyright $(docdev) + $(pkgdev) ./install-sh -m 644 debian/changelog $(docdev) + @echo "== dpkg-buildpackage: debstd" 1>&2 + $(stdenv) debstd -m + dpkg-gencontrol -isp -p$(package) -P$(dirtmp) + dpkg-gencontrol -isp -p$(develop) -P$(dirdev) + chown -R root.root $(dirtmp) $(dirdev) + chmod -R go=rX $(dirtmp) $(dirdev) + dpkg --build $(dirtmp) .. + dpkg --build $(dirdev) .. + +binary: binary-indep binary-arch + +checkroot: + test 0 -eq `id -u` + +.PHONY: binary binary-arch binary-indep clean checkroot diff --git a/doc/CHANGES b/doc/CHANGES new file mode 100644 index 0000000..1428d69 --- /dev/null +++ b/doc/CHANGES @@ -0,0 +1,5 @@ + +dmapi-0.1.0 (15 January 2001) + - initial version of package + - early alpha code + diff --git a/doc/COPYING b/doc/COPYING new file mode 100644 index 0000000..c2d5d8e --- /dev/null +++ b/doc/COPYING @@ -0,0 +1,860 @@ +All the libraries in "dmapi" are licensed under Version 2.1 +of the GNU Lesser General Public License. + +All other "dmapi" components are licensed under Version 2 of +the GNU General Public License. + +---------------------------------------------------------------------- + +<http://www.fsf.org/copyleft/lesser.txt> + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + <one line to give the library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + +---------------------------------------------------------------------- + +<http://www.fsf.org/copyleft/gpl.txt> + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) 19yy <name of author> + + This program 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 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-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. + +---------------------------------------------------------------------- diff --git a/doc/INSTALL b/doc/INSTALL new file mode 100644 index 0000000..ec5a4ef --- /dev/null +++ b/doc/INSTALL @@ -0,0 +1,48 @@ +This document describes how to configure and build the libdm +library from source, and how to install it. + +0. If you have the binary rpm, simply install it and skip to step 2 (below). + The rpm command to do this is: + # rpm -Uvh dmapi + + The Debian command to do this is: + # dpkg -i dmapi + or, if you have apt configured (don't need the binary package): + # apt-get install dmapi + +1. Configure, build and install the package + + The "dmapi" package uses autoconf/configure and expects a GNU build + environment (your platform must at least have both autoconf and gmake). + + If you just want to spin an RPM and/or tar file, use the Makepkgs + script in the top level directory. This will configure and build + the package and leave binary and src RPMs in the build/rpm + directory. It will also leave a tar file in the build/tar + directory. + + # ./Makepkgs verbose + + If you want to build the package and install it manually, use the + following steps: + + # make configure (or run autoconf; ./configure) + # make + # su root + # make install + + Note that there are so many "install" variants out there that we + wrote our own script (see "install-sh" in the top level directory). + + If you wish to turn off debugging asserts in the command build and + turn on the optimizer then set the shell environment variables: + + OPTIMIZER=-O + DEBUG=-DNDEBUG + + before running make configure or Makepkgs. + +2. How to Contribute + + See the README file in this directory for details about how to + contribute to the XFS project. diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000..d320b35 --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,55 @@ +# +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +# + +TOPDIR = .. +include $(TOPDIR)/include/builddefs + +# [don't install COPYING for Debian builds - use Debian preferred method] +HAVE_DEBIAN = $(shell test -f /etc/debian_version && echo yes || echo no) + +LSRCFILES = INSTALL PORTING CHANGES COPYING +LDIRT = *.gz + +default: $(CMDTARGET) CHANGES.gz + +include $(BUILDRULES) + +CHANGES.gz: + $(ZIP) --best -c < CHANGES > $@ + +install: default + $(INSTALL) -m 755 -d $(PKG_DOC_DIR) +ifeq ($(HAVE_DEBIAN), no) + $(INSTALL) -m 644 COPYING $(PKG_DOC_DIR) +endif + $(INSTALL) -m 644 PORTING CHANGES.gz $(PKG_DOC_DIR) +install-dev: diff --git a/doc/PORTING b/doc/PORTING new file mode 100644 index 0000000..fb13b64 --- /dev/null +++ b/doc/PORTING @@ -0,0 +1,85 @@ + +1. unpack the source tarball and cd to the resulting dir + +2. # autoconf + this reads configure.in and generates the ./configure script + +3. # ./configure + this probes your system and then, for each "file" named + in the AC_OUTPUT() macro near the end of configure.in, + read "file".in and generate "file". Variables named @somevariable@ + will be substituted with literal values. + +4. step (3) produces several files. These files are generated by + configure from their respective .in file in the same directory. + You should have a read of these generated files and diff them + against their respective .in files to see what was substituted + by configure. + + src/include/builddefs + common definitions for the build environment. This is included + by all Makefiles, in conjunction with src/include/buildrules. + Note that most autoconf/configure build environments generate + Makefile (from Makefile.in) in every src dir. Instead, we + generate builddefs, and then include it in every Makefile. + + src/include/platform_defs.h + header containing conditional macros defining the C run-time + environment discovered by the configure script. + +5. read some or all of the GNU tool chain documentation + gmake Table Of Contents : + http://www.delorie.com/gnu/docs/make/make_toc.html + gmake Quick Reference section : + http://www.delorie.com/gnu/docs/make/make_120.html + Autoconf : + http://www.delorie.com/gnu/docs/autoconf/autoconf_toc.html + gcc/g++ : + http://www.delorie.com/gnu/docs/gcc/gcc_toc.html + +6. Makefiles and build environment + First have a look at some Makefiles + + example using SUBDIRS : dmapi/Makefile + example .so/.a library: dmapi/libdm/Makefile + + All Makefiles must define TOPDIR as the root of the project. This + allows other stuff to be found relative to $(TOPDIR). + + All Makefiles should have the following structure, which is + much like commondefs and commonrules in the IRIX build environment, e.g. + + # ---------------------------------------------------------------------- + # TOPDIR must point to the root of the project + # The builddefs file defines lots of things. Read it. + TOPDIR = .. + include $(TOPDIR)/include/builddefs + + # first rule should always be "default" + default : sometarget + commands to build targets, if necessary + + # $(BUILDRULES) is defined in builddefs and includes rules for + # descending subdirs, building targets and installation rules + include $(BUILDRULES) + + install : default + $(INSTALL) sometargets somewhere + # ---------------------------------------------------------------------- + +7. packaging + + # ./Makepkgs + this script generates all of the packages supported - each has a + subdirectory below dmapi/build where knowledge specific to each + package type is maintained. + + The script produces logs of each stage of the build (this info is + also echoed to the screen when the "verbose" option is provided): + + dmapi/Logs/configure - `autoconf; ./configure' output + dmapi/Logs/default - `make default' output + dmapi/Logs/dist - `make build dist' output + + On successful completion, the script echoes the names of packages + successfully generated. diff --git a/include/Makefile b/include/Makefile new file mode 100644 index 0000000..a4fbfa8 --- /dev/null +++ b/include/Makefile @@ -0,0 +1,45 @@ +# +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +# + +TOPDIR = .. +include $(TOPDIR)/include/builddefs + +HFILES = dmapi.h +LSRCFILES = builddefs.in buildrules dmapi_kern.h + +default install : + +include $(BUILDRULES) + +install-dev: default + $(INSTALL) -m 755 -d $(PKG_INC_DIR) + $(INSTALL) -m 644 $(HFILES) $(PKG_INC_DIR) diff --git a/include/builddefs.in b/include/builddefs.in new file mode 100644 index 0000000..e3a044c --- /dev/null +++ b/include/builddefs.in @@ -0,0 +1,165 @@ +# +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +# +# @configure_input@ +# + +ifndef _BUILDDEFS_INCLUDED_ +_BUILDDEFS_INCLUDED_ = 1 + +DEBUG = @debug_build@ +OPTIMIZER = @opt_build@ +MALLOCLIB = @malloc_lib@ + +CPPFLAGS = -I$(TOPDIR)/include +BUILDRULES = $(TOPDIR)/include/buildrules + +# General package information +PKG_NAME = @pkg_name@ +PKG_RELEASE = @pkg_release@ +PKG_VERSION = @pkg_version@ +PKG_DISTRIBUTION = @pkg_distribution@ +PKG_BUILDER = @pkg_builder@ +PKG_BIN_DIR = @pkg_bin_dir@ +PKG_LIB_DIR = @pkg_lib_dir@ +PKG_SBIN_DIR = @pkg_sbin_dir@ +PKG_SLIB_DIR = @pkg_slib_dir@ +PKG_INC_DIR = @pkg_inc_dir@ +PKG_MAN_DIR = @pkg_man_dir@ +PKG_DOC_DIR = @pkg_doc_dir@ + +# LCFLAGS, LLDFLAGS, LLDLIBS, LSRCFILES and LDIRT may be specified in +# user Makefiles. Note: LSRCFILES is anything other than Makefile, $(CFILES) +# $(CXXFILES), or $(HFILES) and is used to construct the manifest list +# during the "dist" phase (packaging). + +CFLAGS += $(OPTIMIZER) $(DEBUG) -funsigned-char -Wall -Wno-parentheses \ + $(LCFLAGS) $(CPPFLAGS) '-DVERSION="$(PKG_VERSION)"' \ + -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE + +LDFLAGS = $(LLDFLAGS) +LDLIBS = $(LLDLIBS) $(MALLOCLIB) + +MAKEOPTS = --no-print-directory +SRCFILES = Makefile $(HFILES) $(CFILES) $(LSRCFILES) $(LFILES) $(YFILES) +DIRT = $(LDIRT) dep dep.bak $(OBJECTS) $(CMDTARGET) $(LIBTARGET) \ + $(STATICLIBTARGET) *.[1-9].gz + +OBJECTS = $(ASFILES:.s=.o) \ + $(CFILES:.c=.o) \ + $(LFILES:.l=.o) \ + $(YFILES:%.y=%.tab.o) + +MAKE = @make@ +CC = @cc@ +LD = @ld@ +AWK = @awk@ +SED = @sed@ +INSTALL = $(TOPDIR)/install-sh -o root -g root +ECHO = @echo@ +LN_S = @LN_S@ + +CCF = $(CC) $(CFLAGS) +MAKEF = $(MAKE) $(MAKEOPTS) +CXXF = $(CXX) $(CXXFLAGS) +LDF = $(LD) $(LDFLAGS) +MAKEDEPEND = @makedepend@ + +ZIP = @zip@ +TAR = @tar@ +RPM = @rpm@ +RPM_VERSION = @rpm_version@ + +HAVE_ZIPPED_MANPAGES = @have_zipped_manpages@ + +SHELL = /bin/sh +IMAGES_DIR = $(TOPDIR)/all-images +DIST_DIR = $(TOPDIR)/dist + +SUBDIRS_MAKERULE = \ + @for d in $(SUBDIRS) ""; do \ + if test -d "$$d" -a ! -z "$$d"; then \ + $(ECHO) === $$d ===; \ + $(MAKEF) -C $$d $@ || exit $$?; \ + fi; \ + done + +MAN_MAKERULE = \ + @for f in *.[12345678] ""; do \ + if test ! -z "$$f"; then \ + $(ZIP) --best -c < $$f > $$f.gz; \ + fi; \ + done + +INSTALL_MAN = \ + @for d in $(MAN_PAGES); do \ + first=true; \ + for m in `$(AWK) '/^\.SH NAME/ {ok=1; next} ok {print; exit}' $$d \ + | sed -e 's/,/ /g' -e 's/\\-.*//' -e 's/\\\f[0-9]//g' -e 's/ / /g;q'`; \ + do \ + [ -z "$$m" -o "$$m" = "\\" ] && continue; \ + t=$(MAN_DEST)/$$m.$(MAN_SECTION); \ + if $$first; then \ + if $(HAVE_ZIPPED_MANPAGES); then \ + $(ZIP) --best -c $$d > $$d.gz; _sfx=.gz; \ + fi; \ + u=$$m.$(MAN_SECTION)$$_sfx; \ + echo $(INSTALL) -m 644 $${d}$$_sfx $${t}$$_sfx; \ + $(INSTALL) -m 644 $${d}$$_sfx $${t}$$_sfx; \ + else \ + echo $(INSTALL) -S $$u $${t}$$_sfx; \ + $(INSTALL) -S $$u $${t}$$_sfx; \ + fi; \ + first=false; \ + done; \ + done + +DIST_MAKERULE = \ + $(MAKEF) -C build dist + +SOURCE_MAKERULE = \ + @test -z "$$DIR" && DIR="."; \ + for f in $(SRCFILES) ""; do \ + if test ! -z "$$f"; then $(ECHO) $$DIR/$$f; fi;\ + done; \ + for d in `echo $(SUBDIRS)` ; do \ + if test -d "$$d" -a ! -z "$$d"; then \ + $(MAKEF) DIR=$$DIR/$$d -C $$d $@ || exit $$?; \ + fi; \ + done + +endif + +# +# For targets that should always be rebuilt, +# define a target that is never up-to-date. +# Targets needing this should depend on $(_FORCE) +_FORCE = __force_build diff --git a/include/buildrules b/include/buildrules new file mode 100644 index 0000000..dab3fae --- /dev/null +++ b/include/buildrules @@ -0,0 +1,77 @@ +# +# Copyright (C) 1999 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as published +# by the Free Software Fondation. +# +# This program is distributed in the hope that it would be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. Further, any license provided herein, +# whether implied or otherwise, is limited to this program in accordance with +# the express provisions of the GNU General Public License. Patent licenses, +# if any, provided herein do not apply to combinations of this program with +# other product or programs, or any other product whatsoever. This program is +# distributed without any warranty that the program is delivered free of the +# rightful claim of any third person by way of infringement or the like. 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 the Free Software Foundation, Inc., 59 Temple +# Place - Suite 330, Boston MA 02111-1307, USA. +# Common build rules for gmake +# +ifndef _BUILDRULES_INCLUDED_ +_BUILDRULES_INCLUDED_ = 1 + +include $(TOPDIR)/include/builddefs + +# +# Standard targets +# +ifdef CMDTARGET +$(CMDTARGET) : $(SUBDIRS) $(OBJECTS) + $(CCF) -o $(CMDTARGET) $(LDFLAGS) $(OBJECTS) $(LDLIBS) +$(CMDTARGET).static : $(SUBDIRS) $(OBJECTS) + $(CCF) -static -o $(CMDTARGET).static $(LDFLAGS) $(OBJECTS) $(LDLIBS) +endif + +ifdef LIBTARGET +$(LIBTARGET) : $(SUBDIRS) $(OBJECTS) + $(CC) $(LDFLAGS) -fPIC -shared -Wl,-soname,$(LIBTARGET) -o $(LIBTARGET) $(OBJECTS) $(LDLIBS) +endif + +ifdef STATICLIBTARGET +$(STATICLIBTARGET) : $(SUBDIRS) $(OBJECTS) + $(AR) crf $(STATICLIBTARGET) $? +endif + +clean clobber : $(SUBDIRS) + rm -f $(DIRT) + $(SUBDIRS_MAKERULE) + +# Never blow away subdirs +ifdef SUBDIRS +.PRECIOUS: $(SUBDIRS) +$(SUBDIRS): + $(SUBDIRS_MAKERULE) +endif + +source : + $(SOURCE_MAKERULE) + +endif + +$(_FORCE): + +.PHONY : depend + +depend : $(CFILES) $(HFILES) + $(SUBDIRS_MAKERULE) + touch dep + $(MAKEDEPEND) -fdep -- $(CFLAGS) -- $(CFILES) + +# Include dep, but only if it exists +ifeq ($(shell test -f dep && echo dep), dep) +include dep +endif diff --git a/include/dmapi.h b/include/dmapi.h new file mode 100644 index 0000000..cd3e9bf --- /dev/null +++ b/include/dmapi.h @@ -0,0 +1,1033 @@ +/* + * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Further, this software is distributed without any warranty that it is + * free of the rightful claim of any third person regarding infringement + * or the like. Any license provided herein, whether implied or + * otherwise, applies only to this software file. Patent licenses, if + * any, provided herein do not apply to combinations of this program with + * other software, or any other product whatsoever. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write the Free Software Foundation, Inc., 59 + * Temple Place - Suite 330, Boston MA 02111-1307, USA. + * + * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, + * Mountain View, CA 94043, or: + * + * http://www.sgi.com + * + * For further information regarding this notice, see: + * + * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ + */ + +#ifndef _SYS_DMAPI_H +#define _SYS_DMAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include <linux/types.h> + +/************************************************************************** + * * + * The SGI implementation of DMAPI is based upon the X/Open document * + * Systems Management: Data Storage Managment (XDSM) API * + * dated February 1997. Not all DMAPI functions and structure fields * + * have been implemented. Most importantly, the DMAPI functions * + * dm_request_right, dm_release_right, dm_query_right, dm_upgrade_right * + * and dm_downgrade_right do not work as described in the specification. * + * * + * The XFS filesystem currently does not allow its locking mechanisms to * + * be externally accessed from user space. While the above-mentioned * + * dm_xxx_right functions exist and can be called by applications, they * + * always return successfully without actually obtaining any locks * + * within the filesystem. * + * * + * Applications which do not need full rights support and which only * + * make dm_xxx_right calls in order to satisfy the input requirements of * + * other DMAPI calls should be able to use these routines to avoid * + * having to implement special-case code for SGI platforms. Applications * + * which truely need the capabilities of a full implementation of rights * + * will unfortunately have to come up with alternate software solutions * + * until such time as rights can be completely implemented. * + * * + * Functions and structure fields defined within this file which are not * + * supported in the SGI implementation of DMAPI are indicated by comments * + * following their definitions such as "not supported", or "not * + * completely supported". Any function or field not so marked may be * + * assumed to work exactly according to the spec. * + * * + **************************************************************************/ + + + +/* The first portion of this file contains defines and typedefs that are + DMAPI implementation-dependent, and could be different on other platforms. +*/ + +typedef __s64 dm_attrloc_t; +typedef unsigned int dm_boolean_t; +typedef __u64 dm_eventset_t; +typedef __u64 dm_fsid_t; +typedef __u64 dm_ino_t; +typedef __u32 dm_igen_t; +typedef __s64 dm_off_t; +typedef unsigned int dm_sequence_t; +typedef int dm_sessid_t; +typedef __u64 dm_size_t; +typedef __s64 dm_ssize_t; +typedef int dm_token_t; + +/* XXX dev_t, mode_t, and nlink_t are not the same size in kernel space + and user space. This affects the field offsets for dm_stat_t. + The following solution is temporary. + + user space sizes: dev_t=8 mode_t=4 nlink_t=4 + kernel space : dev_t=2 mode_t=2 nlink_t=2 + +*/ +typedef __s64 dm_dev_t; +typedef int dm_mode_t; +typedef int dm_nlink_t; + + +#define DM_REGION_NOEVENT 0x0 +#define DM_REGION_READ 0x1 +#define DM_REGION_WRITE 0x2 +#define DM_REGION_TRUNCATE 0x4 + +/* Values for the mask argument used with dm_get_fileattr, dm_get_bulkattr, + dm_get_dirattrs, and dm_set_fileattr. +*/ + +#define DM_AT_MODE 0x0001 +#define DM_AT_UID 0x0002 +#define DM_AT_GID 0x0004 +#define DM_AT_ATIME 0x0008 +#define DM_AT_MTIME 0x0010 +#define DM_AT_CTIME 0x0020 +#define DM_AT_SIZE 0x0040 +#define DM_AT_DTIME 0x0080 +#define DM_AT_HANDLE 0x0100 +#define DM_AT_EMASK 0x0200 +#define DM_AT_PMANR 0x0400 +#define DM_AT_PATTR 0x0800 +#define DM_AT_STAT 0x1000 +#define DM_AT_CFLAG 0x2000 + +#define DM_EV_WAIT 0x1 /* used in dm_get_events() */ + +#define DM_MOUNT_RDONLY 0x1 /* me_mode field in dm_mount_event_t */ + +#define DM_RR_WAIT 0x1 + +#define DM_UNMOUNT_FORCE 0x1 /* ne_mode field in dm_namesp_event_t */ + +#define DM_WRITE_SYNC 0x1 /* used in dm_write_invis() */ + +#define DM_SESSION_INFO_LEN 256 +#define DM_NO_SESSION 0 +#define DM_TRUE 1 +#define DM_FALSE 0 +#define DM_INVALID_TOKEN 0 +#define DM_NO_TOKEN (-1) +#define DM_INVALID_HANP NULL +#define DM_INVALID_HLEN 0 +#define DM_GLOBAL_HANP ((void *)(1LL)) +#define DM_GLOBAL_HLEN ((size_t)(1)) +#define DM_VER_STR_CONTENTS "SGI DMAPI (XDSM) API, Release 1.0." + + +#define DMEV_SET(event_type, event_list) \ + ((event_list) |= (1 << (event_type))) +#define DMEV_CLR(event_type, event_list) \ + ((event_list) &= ~(1 << (event_type))) +#define DMEV_ISSET(event_type, event_list) \ + (int)(((event_list) & (1 << (event_type))) != 0) +#define DMEV_ZERO(event_list) \ + (event_list) = 0 + + +typedef struct { + int vd_offset; /* offset from start of containing struct */ + unsigned int vd_length; /* length of data starting at vd_offset */ +} dm_vardata_t; + +#define DM_GET_VALUE(p, field, type) \ + ((type) ((char *)(p) + (p)->field.vd_offset)) + +#define DM_GET_LEN(p, field) \ + ((p)->field.vd_length) + +#define DM_STEP_TO_NEXT(p, type) \ + ((type) ((p)->_link ? (char *)(p) + (p)->_link : NULL)) + + + + +/* The remainder of this include file contains defines, typedefs, and + structures which are strictly defined by the DMAPI 2.3 specification. + + (The _link field which appears in several structures is an + implementation-specific way to implement DM_STEP_TO_NEXT, and + should not be referenced directly by application code.) +*/ + + +#define DM_ATTR_NAME_SIZE 8 + + +struct dm_attrname { + unsigned char an_chars[DM_ATTR_NAME_SIZE]; +}; +typedef struct dm_attrname dm_attrname_t; + + +struct dm_attrlist { + int _link; + dm_attrname_t al_name; + dm_vardata_t al_data; +}; +typedef struct dm_attrlist dm_attrlist_t; + + +typedef enum { + DM_CONFIG_INVALID, + DM_CONFIG_BULKALL, + DM_CONFIG_CREATE_BY_HANDLE, + DM_CONFIG_DTIME_OVERLOAD, + DM_CONFIG_LEGACY, + DM_CONFIG_LOCK_UPGRADE, + DM_CONFIG_MAX_ATTR_ON_DESTROY, + DM_CONFIG_MAX_ATTRIBUTE_SIZE, + DM_CONFIG_MAX_HANDLE_SIZE, + DM_CONFIG_MAX_MANAGED_REGIONS, + DM_CONFIG_MAX_MESSAGE_DATA, + DM_CONFIG_OBJ_REF, + DM_CONFIG_PENDING, + DM_CONFIG_PERS_ATTRIBUTES, + DM_CONFIG_PERS_EVENTS, + DM_CONFIG_PERS_INHERIT_ATTRIBS, + DM_CONFIG_PERS_MANAGED_REGIONS, + DM_CONFIG_PUNCH_HOLE, + DM_CONFIG_TOTAL_ATTRIBUTE_SPACE, + DM_CONFIG_WILL_RETRY +} dm_config_t; + + +struct dm_dioinfo { /* non-standard SGI addition */ + unsigned int d_mem; + unsigned int d_miniosz; + unsigned int d_maxiosz; + dm_boolean_t d_dio_only; +}; +typedef struct dm_dioinfo dm_dioinfo_t; + + +struct dm_dispinfo { + int _link; + unsigned int di_pad1; /* reserved; do not reference */ + dm_vardata_t di_fshandle; + dm_eventset_t di_eventset; +}; +typedef struct dm_dispinfo dm_dispinfo_t; + + +typedef enum { + DM_EVENT_INVALID = -1, + DM_EVENT_CANCEL = 0, /* not supported */ + DM_EVENT_MOUNT = 1, + DM_EVENT_PREUNMOUNT = 2, + DM_EVENT_UNMOUNT = 3, + DM_EVENT_DEBUT = 4, /* not supported */ + DM_EVENT_CREATE = 5, + DM_EVENT_CLOSE = 6, /* not supported */ + DM_EVENT_POSTCREATE = 7, + DM_EVENT_REMOVE = 8, + DM_EVENT_POSTREMOVE = 9, + DM_EVENT_RENAME = 10, + DM_EVENT_POSTRENAME = 11, + DM_EVENT_LINK = 12, + DM_EVENT_POSTLINK = 13, + DM_EVENT_SYMLINK = 14, + DM_EVENT_POSTSYMLINK = 15, + DM_EVENT_READ = 16, + DM_EVENT_WRITE = 17, + DM_EVENT_TRUNCATE = 18, + DM_EVENT_ATTRIBUTE = 19, + DM_EVENT_DESTROY = 20, + DM_EVENT_NOSPACE = 21, + DM_EVENT_USER = 22, + DM_EVENT_MAX = 23 +} dm_eventtype_t; + + +struct dm_eventmsg { + int _link; + dm_eventtype_t ev_type; + dm_token_t ev_token; + dm_sequence_t ev_sequence; + dm_vardata_t ev_data; +}; +typedef struct dm_eventmsg dm_eventmsg_t; + + +struct dm_cancel_event { /* not supported */ + dm_sequence_t ce_sequence; + dm_token_t ce_token; +}; +typedef struct dm_cancel_event dm_cancel_event_t; + + +struct dm_data_event { + dm_vardata_t de_handle; + dm_off_t de_offset; + dm_size_t de_length; +}; +typedef struct dm_data_event dm_data_event_t; + +struct dm_destroy_event { + dm_vardata_t ds_handle; + dm_attrname_t ds_attrname; + dm_vardata_t ds_attrcopy; +}; +typedef struct dm_destroy_event dm_destroy_event_t; + +struct dm_mount_event { + mode_t me_mode; + dm_vardata_t me_handle1; + dm_vardata_t me_handle2; + dm_vardata_t me_name1; + dm_vardata_t me_name2; + dm_vardata_t me_roothandle; +}; +typedef struct dm_mount_event dm_mount_event_t; + +struct dm_namesp_event { + mode_t ne_mode; + dm_vardata_t ne_handle1; + dm_vardata_t ne_handle2; + dm_vardata_t ne_name1; + dm_vardata_t ne_name2; + int ne_retcode; +}; +typedef struct dm_namesp_event dm_namesp_event_t; + + +typedef enum { + DM_EXTENT_INVALID, + DM_EXTENT_RES, + DM_EXTENT_HOLE +} dm_extenttype_t; + + +struct dm_extent { + dm_extenttype_t ex_type; + unsigned int ex_pad1; /* reserved; do not reference */ + dm_off_t ex_offset; + dm_size_t ex_length; +}; +typedef struct dm_extent dm_extent_t; + +struct dm_fileattr { + mode_t fa_mode; + uid_t fa_uid; + gid_t fa_gid; + time_t fa_atime; + time_t fa_mtime; + time_t fa_ctime; + time_t fa_dtime; + unsigned int fa_pad1; /* reserved; do not reference */ + dm_off_t fa_size; +}; +typedef struct dm_fileattr dm_fileattr_t; + + +struct dm_inherit { /* not supported */ + dm_attrname_t ih_name; + mode_t ih_filetype; +}; +typedef struct dm_inherit dm_inherit_t; + + +typedef enum { + DM_MSGTYPE_INVALID, + DM_MSGTYPE_SYNC, + DM_MSGTYPE_ASYNC +} dm_msgtype_t; + + +struct dm_region { + dm_off_t rg_offset; + dm_size_t rg_size; + unsigned int rg_flags; + unsigned int rg_pad1; /* reserved; do not reference */ +}; +typedef struct dm_region dm_region_t; + + +typedef enum { + DM_RESP_INVALID, + DM_RESP_CONTINUE, + DM_RESP_ABORT, + DM_RESP_DONTCARE +} dm_response_t; + + +typedef enum { + DM_RIGHT_NULL, + DM_RIGHT_SHARED, + DM_RIGHT_EXCL +} dm_right_t; + + +struct dm_stat { + int _link; + dm_vardata_t dt_handle; + dm_vardata_t dt_compname; + int dt_nevents; + dm_eventset_t dt_emask; + int dt_pers; /* field not supported */ + int dt_pmanreg; + time_t dt_dtime; + unsigned int dt_change; /* field not supported */ + unsigned int dt_pad1; /* reserved; do not reference */ + dm_dev_t dt_dev; + dm_ino_t dt_ino; + dm_mode_t dt_mode; + dm_nlink_t dt_nlink; + uid_t dt_uid; + gid_t dt_gid; + dm_dev_t dt_rdev; + unsigned int dt_pad2; /* reserved; do not reference */ + dm_off_t dt_size; + time_t dt_atime; + time_t dt_mtime; + time_t dt_ctime; + unsigned int dt_blksize; + dm_size_t dt_blocks; + + /* Non-standard filesystem-specific fields. Currently XFS is the only + supported filesystem type. + */ + + __u64 dt_pad3; /* reserved; do not reference */ + int dt_fstype; /* filesystem index; see sysfs(2) */ + union { + struct { + dm_igen_t igen; + unsigned int xflags; + unsigned int extsize; + unsigned int extents; + unsigned short aextents; + unsigned short dmstate; + } sgi_xfs; + } fsys_dep; +}; +typedef struct dm_stat dm_stat_t; + +#define dt_xfs_igen fsys_dep.sgi_xfs.igen +#define dt_xfs_xflags fsys_dep.sgi_xfs.xflags +#define dt_xfs_extsize fsys_dep.sgi_xfs.extsize +#define dt_xfs_extents fsys_dep.sgi_xfs.extents +#define dt_xfs_aextents fsys_dep.sgi_xfs.aextents +#define dt_xfs_dmstate fsys_dep.sgi_xfs.dmstate + +/* Flags for the non-standard dt_xfs_xflags field. */ + +#define DM_XFLAG_REALTIME 0x1 +#define DM_XFLAG_PREALLOC 0x2 +#define DM_XFLAG_HASATTR 0x80000000 + + +struct dm_timestruct { + time_t dm_tv_sec; + int dm_tv_nsec; +}; +typedef struct dm_timestruct dm_timestruct_t; + + +struct dm_xstat { /* not supported */ + dm_stat_t dx_statinfo; + dm_vardata_t dx_attrdata; +}; +typedef struct dm_xstat dm_xstat_t; + + + +/* The following list provides the prototypes for all functions defined in + the DMAPI interface. +*/ + +extern int +dm_clear_inherit( /* not supported */ + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + dm_attrname_t *attrnamep); + +extern int +dm_create_by_handle( /* not supported */ + dm_sessid_t sid, + void *dirhanp, + size_t dirhlen, + dm_token_t token, + void *hanp, + size_t hlen, + char *cname); + +extern int +dm_create_session( + dm_sessid_t oldsid, + char *sessinfop, + dm_sessid_t *newsidp); + +extern int +dm_create_userevent( + dm_sessid_t sid, + size_t msglen, + void *msgdatap, + dm_token_t *tokenp); + +extern int +dm_destroy_session( + dm_sessid_t sid); + +extern int +dm_downgrade_right( /* not completely supported; see caveat above */ + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token); + +extern int +dm_fd_to_handle( + int fd, + void **hanpp, + size_t *hlenp); + +extern int +dm_find_eventmsg( + dm_sessid_t sid, + dm_token_t token, + size_t buflen, + void *bufp, + size_t *rlenp); + +extern int +dm_get_allocinfo( + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + dm_off_t *offp, + unsigned int nelem, + dm_extent_t *extentp, + unsigned int *nelemp); + +extern int +dm_get_bulkall( /* not supported */ + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + unsigned int mask, + dm_attrname_t *attrnamep, + dm_attrloc_t *locp, + size_t buflen, + void *bufp, + size_t *rlenp); + +extern int +dm_get_bulkattr( + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + unsigned int mask, + dm_attrloc_t *locp, + size_t buflen, + void *bufp, + size_t *rlenp); + +extern int +dm_get_config( + void *hanp, + size_t hlen, + dm_config_t flagname, + dm_size_t *retvalp); + +extern int +dm_get_config_events( + void *hanp, + size_t hlen, + unsigned int nelem, + dm_eventset_t *eventsetp, + unsigned int *nelemp); + +extern int +dm_get_dirattrs( + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + unsigned int mask, + dm_attrloc_t *locp, + size_t buflen, + void *bufp, + size_t *rlenp); + +extern int +dm_get_dmattr( + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + dm_attrname_t *attrnamep, + size_t buflen, + void *bufp, + size_t *rlenp); + +extern int +dm_get_eventlist( + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + unsigned int nelem, + dm_eventset_t *eventsetp, + unsigned int *nelemp); + +extern int +dm_get_events( + dm_sessid_t sid, + unsigned int maxmsgs, + unsigned int flags, + size_t buflen, + void *bufp, + size_t *rlenp); + +extern int +dm_get_fileattr( + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + unsigned int mask, + dm_stat_t *statp); + +extern int +dm_get_mountinfo( + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + size_t buflen, + void *bufp, + size_t *rlenp); + +extern int +dm_get_region( + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + unsigned int nelem, + dm_region_t *regbufp, + unsigned int *nelemp); + +extern int +dm_getall_disp( + dm_sessid_t sid, + size_t buflen, + void *bufp, + size_t *rlenp); + +extern int +dm_getall_dmattr( + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + size_t buflen, + void *bufp, + size_t *rlenp); + +extern int +dm_getall_inherit( /* not supported */ + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + unsigned int nelem, + dm_inherit_t *inheritbufp, + unsigned int *nelemp); + +extern int +dm_getall_sessions( + unsigned int nelem, + dm_sessid_t *sidbufp, + unsigned int *nelemp); + +extern int +dm_getall_tokens( + dm_sessid_t sid, + unsigned int nelem, + dm_token_t *tokenbufp, + unsigned int *nelemp); + +extern int +dm_handle_cmp( + void *hanp1, + size_t hlen1, + void *hanp2, + size_t hlen2); + +extern void +dm_handle_free( + void *hanp, + size_t hlen); + +extern u_int +dm_handle_hash( + void *hanp, + size_t hlen); + +extern dm_boolean_t +dm_handle_is_valid( + void *hanp, + size_t hlen); + +extern int +dm_handle_to_fshandle( + void *hanp, + size_t hlen, + void **fshanpp, + size_t *fshlenp); + +extern int +dm_handle_to_fsid( + void *hanp, + size_t hlen, + dm_fsid_t *fsidp); + +extern int +dm_handle_to_igen( + void *hanp, + size_t hlen, + dm_igen_t *igenp); + +extern int +dm_handle_to_ino( + void *hanp, + size_t hlen, + dm_ino_t *inop); + +extern int +dm_handle_to_path( + void *dirhanp, + size_t dirhlen, + void *targhanp, + size_t targhlen, + size_t buflen, + char *pathbufp, + size_t *rlenp); + +extern int +dm_init_attrloc( + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + dm_attrloc_t *locp); + +extern int +dm_init_service( + char **versionstrpp); + +extern int +dm_make_handle( + dm_fsid_t *fsidp, + dm_ino_t *inop, + dm_igen_t *igenp, + void **hanpp, + size_t *hlenp); + +extern int +dm_make_fshandle( + dm_fsid_t *fsidp, + void **hanpp, + size_t *hlenp); + +extern int +dm_mkdir_by_handle( /* not supported */ + dm_sessid_t sid, + void *dirhanp, + size_t dirhlen, + dm_token_t token, + void *hanp, + size_t hlen, + char *cname); + +extern int +dm_move_event( + dm_sessid_t srcsid, + dm_token_t token, + dm_sessid_t targetsid, + dm_token_t *rtokenp); + +extern int +dm_obj_ref_hold( + dm_sessid_t sid, + dm_token_t token, + void *hanp, + size_t hlen); + +extern int +dm_obj_ref_query( + dm_sessid_t sid, + dm_token_t token, + void *hanp, + size_t hlen); + +extern int +dm_obj_ref_rele( + dm_sessid_t sid, + dm_token_t token, + void *hanp, + size_t hlen); + +extern int +dm_path_to_fshandle( + char *path, + void **hanpp, + size_t *hlenp); + +extern int +dm_path_to_handle( + char *path, + void **hanpp, + size_t *hlenp); + +extern int +dm_pending( + dm_sessid_t sid, + dm_token_t token, + dm_timestruct_t *delay); + +extern int +dm_probe_hole( + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + dm_off_t off, + dm_size_t len, + dm_off_t *roffp, + dm_size_t *rlenp); + +extern int +dm_punch_hole( + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + dm_off_t off, + dm_size_t len); + +extern int +dm_query_right( /* not completely supported; see caveat above */ + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + dm_right_t *rightp); + +extern int +dm_query_session( + dm_sessid_t sid, + size_t buflen, + void *bufp, + size_t *rlenp); + +extern dm_ssize_t +dm_read_invis( + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + dm_off_t off, + dm_size_t len, + void *bufp); + +extern int +dm_release_right( /* not completely supported; see caveat above */ + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token); + +extern int +dm_remove_dmattr( + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + int setdtime, + dm_attrname_t *attrnamep); + +extern int +dm_request_right( /* not completely supported; see caveat above */ + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + unsigned int flags, + dm_right_t right); + +extern int +dm_respond_event( + dm_sessid_t sid, + dm_token_t token, + dm_response_t response, + int reterror, + size_t buflen, + void *respbufp); + +extern int +dm_send_msg( + dm_sessid_t targetsid, + dm_msgtype_t msgtype, + size_t buflen, + void *bufp); + +extern int +dm_set_disp( + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + dm_eventset_t *eventsetp, + unsigned int maxevent); + +extern int +dm_set_dmattr( + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + dm_attrname_t *attrnamep, + int setdtime, + size_t buflen, + void *bufp); + +extern int +dm_set_eventlist( + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + dm_eventset_t *eventsetp, + unsigned int maxevent); + +extern int +dm_set_fileattr( + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + unsigned int mask, + dm_fileattr_t *attrp); + +extern int +dm_set_inherit( /* not supported */ + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + dm_attrname_t *attrnamep, + mode_t mode); + +extern int +dm_set_region( + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + unsigned int nelem, + dm_region_t *regbufp, + dm_boolean_t *exactflagp); + +extern int +dm_set_return_on_destroy( + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + dm_attrname_t *attrnamep, + dm_boolean_t enable); + +extern int +dm_symlink_by_handle( /* not supported */ + dm_sessid_t sid, + void *dirhanp, + size_t dirhlen, + dm_token_t token, + void *hanp, + size_t hlen, + char *cname, + char *path); + +extern int +dm_sync_by_handle( + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token); + +extern int +dm_upgrade_right( /* not completely supported; see caveat above */ + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token); + +extern dm_ssize_t +dm_write_invis( + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + int flags, + dm_off_t off, + dm_size_t len, + void *bufp); + +/* Non-standard SGI additions to the DMAPI interface. */ + +extern int +dm_get_dioinfo( + dm_sessid_t sid, + void *hanp, + size_t hlen, + dm_token_t token, + dm_dioinfo_t *diop); + +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_DMAPI_H */ + diff --git a/include/dmapi_kern.h b/include/dmapi_kern.h new file mode 100644 index 0000000..a9a46f8 --- /dev/null +++ b/include/dmapi_kern.h @@ -0,0 +1,575 @@ +/* + * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Further, this software is distributed without any warranty that it is + * free of the rightful claim of any third person regarding infringement + * or the like. Any license provided herein, whether implied or + * otherwise, applies only to this software file. Patent licenses, if + * any, provided herein do not apply to combinations of this program with + * other software, or any other product whatsoever. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write the Free Software Foundation, Inc., 59 + * Temple Place - Suite 330, Boston MA 02111-1307, USA. + * + * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, + * Mountain View, CA 94043, or: + * + * http://www.sgi.com + * + * For further information regarding this notice, see: + * + * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ + */ + +#ifndef __DMAPI_KERN_H__ +#define __DMAPI_KERN_H__ + + +struct sys_dmapi_args { + long arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11; +}; +typedef struct sys_dmapi_args sys_dmapi_args_t; + + +#ifdef __KERNEL__ + +struct xfs_handle_t; + +/* The first group of definitions and prototypes define the filesystem's + interface into the DMAPI code. +*/ + + +/* Definitions used for the flags field on dm_send_data_event(), + dm_send_unmount_event(), and dm_send_namesp_event() calls. +*/ + +#define DM_FLAGS_NDELAY 0x001 /* return EAGAIN after dm_pending() */ +#define DM_FLAGS_UNWANTED 0x002 /* event not in fsys dm_eventset_t */ + +/* Possible code levels reported by dm_code_level(). */ + +#define DM_CLVL_INIT 0 /* DMAPI prior to X/Open compliance */ +#define DM_CLVL_XOPEN 1 /* X/Open compliant DMAPI */ + + +/* Prototypes used outside of the DMI module/directory. */ + +int dm_send_data_event( + dm_eventtype_t event, + struct bhv_desc *bdp, + dm_right_t vp_right, + off_t off, + size_t len, + int flags); + +int dm_send_destroy_event( + struct bhv_desc *bdp, + dm_right_t vp_right); + +int dm_send_mount_event( + struct vfs *vfsp, + dm_right_t vfsp_right, + struct bhv_desc *bdp, + dm_right_t vp_right, + struct bhv_desc *rootbdp, + dm_right_t rootvp_right, + char *name1, + char *name2); + +int dm_send_namesp_event( + dm_eventtype_t event, + struct bhv_desc *bdp1, + dm_right_t vp1_right, + struct bhv_desc *bdp2, + dm_right_t vp2_right, + char *name1, + char *name2, + mode_t mode, + int retcode, + int flags); + +void dm_send_unmount_event( + struct vfs *vfsp, + struct vnode *vp, + dm_right_t vfsp_right, + mode_t mode, + int retcode, + int flags); + +int dm_code_level(void); + +int dm_vp_to_handle ( + struct vnode *vp, + xfs_handle_t *handlep); + +/* The following prototypes and definitions are used by DMAPI as its + interface into the filesystem code. Communication between DMAPI and the + filesystem are established as follows: + 1. DMAPI uses the F_DMAPI command in VOP_FCNTL() to ask for the addresses + of all the functions within the filesystem that it may need to call. + 2. The filesystem returns an array of function name/address pairs which + DMAPI builds into a function vector. + The VOP_FCNTL() call is only made one time for a particular filesystem + type. From then on, DMAPI uses its function vector to call the filesystem + functions directly. Functions in the array which DMAPI doesn't recognize + are ignored. A dummy function which returns ENOSYS is used for any function + that DMAPI needs but which was not provided by the filesystem. If XFS + doesn't recognize the F_DMAPI fcntl, DMAPI assumes that it doesn't have the + X/Open support code; in this case DMAPI uses the XFS-code originally bundled + within DMAPI. + + The goal of this interface is allow incremental changes to be made to + both the filesystem and to DMAPI while minimizing inter-patch dependencies, + and to eventually allow DMAPI to support multiple filesystem types at the + same time should that become necessary. +*/ + +typedef enum { + DM_FSYS_CLEAR_INHERIT = 0, + DM_FSYS_CREATE_BY_HANDLE = 1, + DM_FSYS_DOWNGRADE_RIGHT = 2, + DM_FSYS_GET_ALLOCINFO_RVP = 3, + DM_FSYS_GET_BULKALL_RVP = 4, + DM_FSYS_GET_BULKATTR_RVP = 5, + DM_FSYS_GET_CONFIG = 6, + DM_FSYS_GET_CONFIG_EVENTS = 7, + DM_FSYS_GET_DESTROY_DMATTR = 8, + DM_FSYS_GET_DIOINFO = 9, + DM_FSYS_GET_DIRATTRS_RVP = 10, + DM_FSYS_GET_DMATTR = 11, + DM_FSYS_GET_EVENTLIST = 12, + DM_FSYS_GET_FILEATTR = 13, + DM_FSYS_GET_REGION = 14, + DM_FSYS_GETALL_DMATTR = 15, + DM_FSYS_GETALL_INHERIT = 16, + DM_FSYS_INIT_ATTRLOC = 17, + DM_FSYS_MKDIR_BY_HANDLE = 18, + DM_FSYS_PROBE_HOLE = 19, + DM_FSYS_PUNCH_HOLE = 20, + DM_FSYS_READ_INVIS_RVP = 21, + DM_FSYS_RELEASE_RIGHT = 22, + DM_FSYS_REMOVE_DMATTR = 23, + DM_FSYS_REQUEST_RIGHT = 24, + DM_FSYS_SET_DMATTR = 25, + DM_FSYS_SET_EVENTLIST = 26, + DM_FSYS_SET_FILEATTR = 27, + DM_FSYS_SET_INHERIT = 28, + DM_FSYS_SET_REGION = 29, + DM_FSYS_SYMLINK_BY_HANDLE = 30, + DM_FSYS_SYNC_BY_HANDLE = 31, + DM_FSYS_UPGRADE_RIGHT = 32, + DM_FSYS_WRITE_INVIS_RVP = 33, + DM_FSYS_MAX = 34 +} dm_fsys_switch_t; + + +#define DM_FSYS_OBJ 0x1 /* object refers to a fsys handle */ + + +/* + * Prototypes for filesystem-specific functions. + */ + +typedef int (*dm_fsys_clear_inherit_t)( + bhv_desc_t *bdp, + dm_right_t right, + dm_attrname_t *attrnamep); + +typedef int (*dm_fsys_create_by_handle_t)( + bhv_desc_t *bdp, + dm_right_t right, + void *hanp, + size_t hlen, + char *cname); + +typedef int (*dm_fsys_downgrade_right_t)( + bhv_desc_t *bdp, + dm_right_t right, + u_int type); /* DM_FSYS_OBJ or zero */ + +typedef int (*dm_fsys_get_allocinfo_rvp_t)( + bhv_desc_t *bdp, + dm_right_t right, + dm_off_t *offp, + u_int nelem, + dm_extent_t *extentp, + u_int *nelemp, + int *rvalp); + +typedef int (*dm_fsys_get_bulkall_rvp_t)( + bhv_desc_t *bdp, /* root vnode */ + dm_right_t right, + u_int mask, + dm_attrname_t *attrnamep, + dm_attrloc_t *locp, + size_t buflen, + void *bufp, + size_t *rlenp, + int *rvalp); + +typedef int (*dm_fsys_get_bulkattr_rvp_t)( + bhv_desc_t *bdp, /* root vnode */ + dm_right_t right, + u_int mask, + dm_attrloc_t *locp, + size_t buflen, + void *bufp, + size_t *rlenp, + int *rvalp); + +typedef int (*dm_fsys_get_config_t)( + bhv_desc_t *bdp, + dm_right_t right, + dm_config_t flagname, + dm_size_t *retvalp); + +typedef int (*dm_fsys_get_config_events_t)( + bhv_desc_t *bdp, + dm_right_t right, + u_int nelem, + dm_eventset_t *eventsetp, + u_int *nelemp); + +typedef int (*dm_fsys_get_destroy_dmattr_t)( + bhv_desc_t *bdp, + dm_right_t right, + dm_attrname_t *attrnamep, + char **valuepp, + int *vlenp); + +typedef int (*dm_fsys_get_dioinfo_t)( + bhv_desc_t *bdp, + dm_right_t right, + dm_dioinfo_t *diop); + +typedef int (*dm_fsys_get_dirattrs_rvp_t)( + bhv_desc_t *bdp, + dm_right_t right, + u_int mask, + dm_attrloc_t *locp, + size_t buflen, + void *bufp, + size_t *rlenp, + int *rvalp); + +typedef int (*dm_fsys_get_dmattr_t)( + bhv_desc_t *bdp, + dm_right_t right, + dm_attrname_t *attrnamep, + size_t buflen, + void *bufp, + size_t *rlenp); + +typedef int (*dm_fsys_get_eventlist_t)( + bhv_desc_t *bdp, + dm_right_t right, + u_int type, + u_int nelem, + dm_eventset_t *eventsetp, /* in kernel space! */ + u_int *nelemp); /* in kernel space! */ + +typedef int (*dm_fsys_get_fileattr_t)( + bhv_desc_t *bdp, + dm_right_t right, + u_int mask, + dm_stat_t *statp); + +typedef int (*dm_fsys_get_region_t)( + bhv_desc_t *bdp, + dm_right_t right, + u_int nelem, + dm_region_t *regbufp, + u_int *nelemp); + +typedef int (*dm_fsys_getall_dmattr_t)( + bhv_desc_t *bdp, + dm_right_t right, + size_t buflen, + void *bufp, + size_t *rlenp); + +typedef int (*dm_fsys_getall_inherit_t)( + bhv_desc_t *bdp, + dm_right_t right, + u_int nelem, + dm_inherit_t *inheritbufp, + u_int *nelemp); + +typedef int (*dm_fsys_init_attrloc_t)( + bhv_desc_t *bdp, /* sometimes root vnode */ + dm_right_t right, + dm_attrloc_t *locp); + +typedef int (*dm_fsys_mkdir_by_handle_t)( + bhv_desc_t *bdp, + dm_right_t right, + void *hanp, + size_t hlen, + char *cname); + +typedef int (*dm_fsys_probe_hole_t)( + bhv_desc_t *bdp, + dm_right_t right, + dm_off_t off, + dm_size_t len, + dm_off_t *roffp, + dm_size_t *rlenp); + +typedef int (*dm_fsys_punch_hole_t)( + bhv_desc_t *bdp, + dm_right_t right, + dm_off_t off, + dm_size_t len); + +typedef int (*dm_fsys_read_invis_rvp_t)( + bhv_desc_t *bdp, + dm_right_t right, + dm_off_t off, + dm_size_t len, + void *bufp, + int *rvp); + +typedef int (*dm_fsys_release_right_t)( + bhv_desc_t *bdp, + dm_right_t right, + u_int type); + +typedef int (*dm_fsys_remove_dmattr_t)( + bhv_desc_t *bdp, + dm_right_t right, + int setdtime, + dm_attrname_t *attrnamep); + +typedef int (*dm_fsys_request_right_t)( + bhv_desc_t *bdp, + dm_right_t right, + u_int type, /* DM_FSYS_OBJ or zero */ + u_int flags, + dm_right_t newright); + +typedef int (*dm_fsys_set_dmattr_t)( + bhv_desc_t *bdp, + dm_right_t right, + dm_attrname_t *attrnamep, + int setdtime, + size_t buflen, + void *bufp); + +typedef int (*dm_fsys_set_eventlist_t)( + bhv_desc_t *bdp, + dm_right_t right, + u_int type, + dm_eventset_t *eventsetp, /* in kernel space! */ + u_int maxevent); + +typedef int (*dm_fsys_set_fileattr_t)( + bhv_desc_t *bdp, + dm_right_t right, + u_int mask, + dm_fileattr_t *attrp); + +typedef int (*dm_fsys_set_inherit_t)( + bhv_desc_t *bdp, + dm_right_t right, + dm_attrname_t *attrnamep, + mode_t mode); + +typedef int (*dm_fsys_set_region_t)( + bhv_desc_t *bdp, + dm_right_t right, + u_int nelem, + dm_region_t *regbufp, + dm_boolean_t *exactflagp); + +typedef int (*dm_fsys_symlink_by_handle_t)( + bhv_desc_t *bdp, + dm_right_t right, + void *hanp, + size_t hlen, + char *cname, + char *path); + +typedef int (*dm_fsys_sync_by_handle_t)( + bhv_desc_t *bdp, + dm_right_t right); + +typedef int (*dm_fsys_upgrade_right_t)( + bhv_desc_t *bdp, + dm_right_t right, + u_int type); /* DM_FSYS_OBJ or zero */ + +typedef int (*dm_fsys_write_invis_rvp_t)( + bhv_desc_t *bdp, + dm_right_t right, + int flags, + dm_off_t off, + dm_size_t len, + void *bufp, + int *rvp); + +/* Structure definitions used by the F_DMAPI fcntl() call. */ + +typedef struct { + dm_fsys_switch_t func_no; /* function number */ + union { + dm_fsys_clear_inherit_t clear_inherit; + dm_fsys_create_by_handle_t create_by_handle; + dm_fsys_downgrade_right_t downgrade_right; + dm_fsys_get_allocinfo_rvp_t get_allocinfo_rvp; + dm_fsys_get_bulkall_rvp_t get_bulkall_rvp; + dm_fsys_get_bulkattr_rvp_t get_bulkattr_rvp; + dm_fsys_get_config_t get_config; + dm_fsys_get_config_events_t get_config_events; + dm_fsys_get_destroy_dmattr_t get_destroy_dmattr; + dm_fsys_get_dioinfo_t get_dioinfo; + dm_fsys_get_dirattrs_rvp_t get_dirattrs_rvp; + dm_fsys_get_dmattr_t get_dmattr; + dm_fsys_get_eventlist_t get_eventlist; + dm_fsys_get_fileattr_t get_fileattr; + dm_fsys_get_region_t get_region; + dm_fsys_getall_dmattr_t getall_dmattr; + dm_fsys_getall_inherit_t getall_inherit; + dm_fsys_init_attrloc_t init_attrloc; + dm_fsys_mkdir_by_handle_t mkdir_by_handle; + dm_fsys_probe_hole_t probe_hole; + dm_fsys_punch_hole_t punch_hole; + dm_fsys_read_invis_rvp_t read_invis_rvp; + dm_fsys_release_right_t release_right; + dm_fsys_remove_dmattr_t remove_dmattr; + dm_fsys_request_right_t request_right; + dm_fsys_set_dmattr_t set_dmattr; + dm_fsys_set_eventlist_t set_eventlist; + dm_fsys_set_fileattr_t set_fileattr; + dm_fsys_set_inherit_t set_inherit; + dm_fsys_set_region_t set_region; + dm_fsys_symlink_by_handle_t symlink_by_handle; + dm_fsys_sync_by_handle_t sync_by_handle; + dm_fsys_upgrade_right_t upgrade_right; + dm_fsys_write_invis_rvp_t write_invis_rvp; + } u_fc; +} fsys_function_vector_t; + +typedef struct { + int code_level; + int count; /* Number of functions in the vector */ + fsys_function_vector_t *vecp; +} dm_fcntl_vector_t; + +typedef struct { + size_t length; /* length of transfer */ + dm_eventtype_t max_event; /* Maximum (WRITE or READ) event */ + int error; /* returned error code */ +} dm_fcntl_mapevent_t; + +typedef struct { + size_t length; /* length of transfer */ + dm_eventtype_t max_event; /* Maximum (WRITE or READ) event */ + dm_eventtype_t issue_event; /* Event needed to be issued */ + int error; /* returned error code */ +} dm_fcntl_testevent_t; + +typedef struct { + int fsd_dmevmask; /* di_devmask */ + unsigned short fsd_padding; + unsigned short fsd_dmstate; /* di_dmstate */ +} dm_fcntl_fssetdm_t; + +typedef struct dm_fcntl { + int dmfc_subfunc; + union { + dm_fcntl_vector_t vecrq; + dm_fcntl_mapevent_t maprq; + dm_fcntl_testevent_t testrq; + dm_fcntl_fssetdm_t setdmrq; + } u_fcntl; +} dm_fcntl_t; + +#define DM_FCNTL_FSYSVECTOR 1 +#define DM_FCNTL_MAPEVENT 2 +#define DM_FCNTL_TESTEVENT 3 +#define DM_FCNTL_FSSETDM 4 + + +#endif /* __KERNEL__ */ + + +/* The following definitions are needed both by the kernel and by the + library routines. +*/ + +#define DM_MAX_HANDLE_SIZE 56 /* maximum size for a file handle */ + + +/* + * Opcodes for dmapi ioctl. + */ + +#define DM_CLEAR_INHERIT 1 +#define DM_CREATE_BY_HANDLE 2 +#define DM_CREATE_SESSION 3 +#define DM_CREATE_USEREVENT 4 +#define DM_DESTROY_SESSION 5 +#define DM_DOWNGRADE_RIGHT 6 +#define DM_FD_TO_HANDLE 7 +#define DM_FIND_EVENTMSG 8 +#define DM_GET_ALLOCINFO 9 +#define DM_GET_BULKALL 10 +#define DM_GET_BULKATTR 11 +#define DM_GET_CONFIG 12 +#define DM_GET_CONFIG_EVENTS 13 +#define DM_GET_DIOINFO 14 +#define DM_GET_DIRATTRS 15 +#define DM_GET_DMATTR 16 +#define DM_GET_EVENTLIST 17 +#define DM_GET_EVENTS 18 +#define DM_GET_FILEATTR 19 +#define DM_GET_MOUNTINFO 20 +#define DM_GET_REGION 21 +#define DM_GETALL_DISP 22 +#define DM_GETALL_DMATTR 23 +#define DM_GETALL_INHERIT 24 +#define DM_GETALL_SESSIONS 25 +#define DM_GETALL_TOKENS 26 +#define DM_INIT_ATTRLOC 27 +#define DM_MKDIR_BY_HANDLE 28 +#define DM_MOVE_EVENT 29 +#define DM_OBJ_REF_HOLD 30 +#define DM_OBJ_REF_QUERY 31 +#define DM_OBJ_REF_RELE 32 +#define DM_PATH_TO_FSHANDLE 33 +#define DM_PATH_TO_HANDLE 34 +#define DM_PENDING 35 +#define DM_PROBE_HOLE 36 +#define DM_PUNCH_HOLE 37 +#define DM_QUERY_RIGHT 38 +#define DM_QUERY_SESSION 39 +#define DM_READ_INVIS 40 +#define DM_RELEASE_RIGHT 41 +#define DM_REMOVE_DMATTR 42 +#define DM_REQUEST_RIGHT 43 +#define DM_RESPOND_EVENT 44 +#define DM_SEND_MSG 45 +#define DM_SET_DISP 46 +#define DM_SET_DMATTR 47 +#define DM_SET_EVENTLIST 48 +#define DM_SET_FILEATTR 49 +#define DM_SET_INHERIT 50 +#define DM_SET_REGION 51 +#define DM_SET_RETURN_ON_DESTROY 52 +#define DM_SYMLINK_BY_HANDLE 53 +#define DM_SYNC_BY_HANDLE 54 +#define DM_UPGRADE_RIGHT 55 +#define DM_WRITE_INVIS 56 + + +#endif /* __DMAPI_KERN_H__ */ diff --git a/install-sh b/install-sh new file mode 100755 index 0000000..395497a --- /dev/null +++ b/install-sh @@ -0,0 +1,273 @@ +#! /bin/sh +# +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +# + +# +# This script emulates bsd install and also recognises +# two environment variables, with the following semantics :- +# +# $DIST_MANIFEST - if set, the name of the file to append manifest +# information in the following format: +# File : f mode owner group src target +# Directory: d mode owner group target +# Symlink : l linkval target +# +# $DIST_ROOT - if set, prepend to target +# +# The sematics of all combinations of these two variables +# are as follows: +# +# $DIST_MANIFEST? $DIST_ROOT? | Copy? Append Manifest? +# -----------------------------+-------------------------- +# not set not set | yes no +# not set set | yes no +# set not set | no yes +# set set | yes yes +# +_usage() { + echo "Usage: $prog [-o owner] [-g group] [-m mode] -d directory" + echo "or $prog [-D] [-o owner] [-g group] [-m mode] file directory/file" + echo "or $prog [-o owner] [-g group] [-m mode] file [file ...] directory" + echo "or $prog -S file target (creates \"target\" symlink)" + echo "" + echo "The \$DIST_MANIFEST and \$DIST_ROOT environment variables affect the" + echo "behaviour of this command - see comments in the script." + echo "The -D flag is only available for the second usage, and causes" + echo "the target directory to be created before installing the file." + echo "" + exit 1 +} + +_chown () +{ + _st=255 + if [ $# -eq 3 ] ; then + chown $1:$2 $3 + _st=$? + if [ $_st -ne 0 ] ; then + if [ $REAL_UID != '0' ] ; then + if [ ! -f $DIST_ROOT/.chown.quite ] ; then + echo '===============================================' + echo Ownership of files under ${DIST_ROOT:-/} + echo cannot be changed + echo '===============================================' + if [ -n "$DIST_ROOT" ] ; then + touch $DIST_ROOT/.chown.quite + fi + fi + _st=0 + fi + fi + fi + + return $_st +} + + +_manifest () +{ + echo $* | sed -e 's/\/\//\//g' >>${DIST_MANIFEST:-/dev/null} +} + +prog=`basename $0` +HERE=`pwd` +dflag=false +Dflag=false +Sflag=false +DIRMODE=755 +FILEMODE=644 +OWNER=`id -u` +GROUP=`id -g` +REAL_UID=$OWNER + +# default is to install and don't append manifest +INSTALL=true +MANIFEST=: + +[ -n "$DIST_MANIFEST" -a -z "$DIST_ROOT" ] && INSTALL=false +[ -n "$DIST_MANIFEST" ] && MANIFEST="_manifest" + +[ $# -eq 0 ] && _usage + +if $INSTALL +then + CP=cp; LN=ln; MKDIR=mkdir; CHMOD=chmod; CHOWN=_chown +else + CP=true; LN=true; MKDIR=true; CHMOD=true; CHOWN=true +fi + +[ -n "$DIST_ROOT" -a $REAL_UID -ne 0 ] && CHOWN=true + +while getopts "Dcm:d:S:o:g:" c $* +do + case $c in + c) + ;; + g) + GROUP=$OPTARG + ;; + o) + OWNER=$OPTARG + ;; + m) + DIRMODE=`expr $OPTARG` + FILEMODE=$DIRMODE + ;; + D) + Dflag=true + ;; + S) + symlink=$OPTARG + Sflag=true + ;; + d) + dir=$DIST_ROOT/$OPTARG + dflag=true + ;; + *) + _usage + ;; + esac +done + +shift `expr $OPTIND - 1` + +status=0 +if $dflag +then + # + # first usage + # + $MKDIR -p $dir + status=$? + if [ $status -eq 0 ] + then + $CHMOD $DIRMODE $dir + status=$? + fi + if [ $status -eq 0 ] + then + $CHOWN $OWNER $GROUP $dir + status=$? + fi + $MANIFEST d $DIRMODE $OWNER $GROUP ${dir#$DIST_ROOT} +elif $Sflag +then + # + # fourth usage (symlink) + # + if [ $# -ne 1 ] + then + _usage + else + target=$DIST_ROOT/$1 + fi + $LN -s -f $symlink $target + status=$? + $MANIFEST l $symlink ${target#$DIST_ROOT} +else + list="" + dir="" + if [ $# -eq 2 ] + then + # + # second usage + # + f=$1 + dir=$DIST_ROOT/$2 + if $Dflag + then + mkdir -p `dirname $dir` + fi + $CP $f $dir + status=$? + if [ $status -eq 0 ] + then + if [ -f $dir/$f ] + then + $CHMOD $FILEMODE $dir/$f + status=$? + if [ $status -eq 0 ] + then + $CHOWN $OWNER $GROUP $dir/$f + status=$? + fi + $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$f ${dir#$DIST_ROOT}/$f + else + $CHMOD $FILEMODE $dir + status=$? + if [ $status -eq 0 ] + then + $CHOWN $OWNER $GROUP $dir + status=$? + fi + $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$dir ${dir#$DIST_ROOT} + fi + fi + else + # + # third usage + # + n=1 + while [ $# -gt 0 ] + do + if [ $# -gt 1 ] + then + list="$list $1" + else + dir=$DIST_ROOT/$1 + fi + shift + done + + # echo DIR=$dir list=\"$list\" + for f in $list + do + $CP $f $dir + status=$? + if [ $status -eq 0 ] + then + $CHMOD $FILEMODE $dir/$f + status=$? + if [ $status -eq 0 ] + then + $CHOWN $OWNER $GROUP $dir/$f + status=$? + fi + $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$f ${dir#$DIST_ROOT}/$f + fi + [ $status -ne 0 ] && break + done + fi +fi + +exit $status diff --git a/libdm/Makefile b/libdm/Makefile index b91b73f..e60155f 100644 --- a/libdm/Makefile +++ b/libdm/Makefile @@ -33,31 +33,24 @@ TOPDIR = .. include $(TOPDIR)/include/builddefs -CFLAGS += -Ilinux - +LIBTARGET = libdm.so.1 STATICLIBTARGET = libdm.a -LIBTARGET = libdm.so -CFILES = \ - dm_attr.c \ - dm_bulkattr.c \ - dm_config.c \ - dm_dmattr.c \ - dm_event.c \ - dm_handle.c \ - dm_handle2path.c \ - dm_hole.c \ - dm_mountinfo.c \ - dm_rdwr.c \ - dm_region.c \ - dm_right.c \ - dm_session.c \ - linux/dmapi_lib.c +HFILES = dmapi_lib.h +CFILES = dmapi_lib.c dm_attr.c dm_bulkattr.c dm_config.c dm_dmattr.c \ + dm_event.c dm_handle.c dm_handle2path.c dm_hole.c dm_mountinfo.c \ + dm_region.c dm_right.c dm_rdwr.c dm_session.c +LCFLAGS = -D_REENTRANT default: $(LIBTARGET) $(STATICLIBTARGET) include $(BUILDRULES) install: default - #$(INSTALL) -m 755 -d $(XFS_CMDS_LIB_DIR) - #$(INSTALL) -m 755 $(STATICLIBTARGET) $(XFS_CMDS_LIB_DIR) + $(INSTALL) -m 755 -d $(PKG_LIB_DIR) + $(INSTALL) -m 755 $(LIBTARGET) $(PKG_LIB_DIR) + +install-dev: default + $(INSTALL) -m 755 -d $(PKG_LIB_DIR) + $(INSTALL) -m 644 $(STATICLIBTARGET) $(PKG_LIB_DIR) + $(INSTALL) -S $(PKG_LIB_DIR)/$(LIBTARGET) $(PKG_LIB_DIR)/libdm.so diff --git a/libdm/dm_attr.c b/libdm/dm_attr.c index 7ce4a3c..c6fa4f7 100644 --- a/libdm/dm_attr.c +++ b/libdm/dm_attr.c @@ -30,8 +30,9 @@ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */ -#include <linux/dmapi_kern.h> -#include <dmapi_lib.h> +#include <dmapi.h> +#include <dmapi_kern.h> +#include "dmapi_lib.h" extern int diff --git a/libdm/dm_bulkattr.c b/libdm/dm_bulkattr.c index ca9d4a8..d1a8d63 100644 --- a/libdm/dm_bulkattr.c +++ b/libdm/dm_bulkattr.c @@ -30,8 +30,9 @@ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */ -#include <linux/dmapi_kern.h> -#include <dmapi_lib.h> +#include <dmapi.h> +#include <dmapi_kern.h> +#include "dmapi_lib.h" extern int diff --git a/libdm/dm_config.c b/libdm/dm_config.c index 27a33fc..1ffa25e 100644 --- a/libdm/dm_config.c +++ b/libdm/dm_config.c @@ -30,8 +30,9 @@ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */ -#include <linux/dmapi_kern.h> -#include <dmapi_lib.h> +#include <dmapi.h> +#include <dmapi_kern.h> +#include "dmapi_lib.h" extern int diff --git a/libdm/dm_dmattr.c b/libdm/dm_dmattr.c index ad7c9b4..e28a809 100644 --- a/libdm/dm_dmattr.c +++ b/libdm/dm_dmattr.c @@ -30,8 +30,9 @@ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */ -#include <linux/dmapi_kern.h> -#include <dmapi_lib.h> +#include <dmapi.h> +#include <dmapi_kern.h> +#include "dmapi_lib.h" extern int diff --git a/libdm/dm_event.c b/libdm/dm_event.c index ff30355..d0cf072 100644 --- a/libdm/dm_event.c +++ b/libdm/dm_event.c @@ -30,8 +30,9 @@ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */ -#include <linux/dmapi_kern.h> -#include <dmapi_lib.h> +#include <dmapi.h> +#include <dmapi_kern.h> +#include "dmapi_lib.h" extern int diff --git a/libdm/dm_handle.c b/libdm/dm_handle.c index e0b7cc8..6cfd202 100644 --- a/libdm/dm_handle.c +++ b/libdm/dm_handle.c @@ -34,11 +34,13 @@ #include <stdlib.h> #include <string.h> -#include <linux/dmapi_kern.h> -#include <dmapi_lib.h> +#include <dmapi.h> +#include <dmapi_kern.h> +#include "dmapi_lib.h" #ifdef linux -#include <xfs_fs.h> +#include <xfs/xfs_fs.h> +#include <xfs/handle.h> #else #include <sys/handle.h> #endif diff --git a/libdm/dm_handle2path.c b/libdm/dm_handle2path.c index e4d0c4c..52b92fe 100644 --- a/libdm/dm_handle2path.c +++ b/libdm/dm_handle2path.c @@ -39,14 +39,14 @@ #include <unistd.h> #ifdef linux #include <linux/unistd.h> -#endif - -#include <linux/dmapi_kern.h> -#include <dmapi_lib.h> -#include <handle.h> - +#include <xfs/handle.h> #include <asm/posix_types.h> #include <linux/dirent.h> +#endif + +#include <dmapi.h> +#include <dmapi_kern.h> +#include "dmapi_lib.h" /* Originally this routine called SGI_OPEN_BY_HANDLE on the target object, did diff --git a/libdm/dm_hole.c b/libdm/dm_hole.c index 15b4f78..3868ac4 100644 --- a/libdm/dm_hole.c +++ b/libdm/dm_hole.c @@ -30,8 +30,9 @@ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */ -#include <linux/dmapi_kern.h> -#include <dmapi_lib.h> +#include <dmapi.h> +#include <dmapi_kern.h> +#include "dmapi_lib.h" extern int diff --git a/libdm/dm_mountinfo.c b/libdm/dm_mountinfo.c index e250e5b..0ed7976 100644 --- a/libdm/dm_mountinfo.c +++ b/libdm/dm_mountinfo.c @@ -30,8 +30,9 @@ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */ -#include <linux/dmapi_kern.h> -#include <dmapi_lib.h> +#include <dmapi.h> +#include <dmapi_kern.h> +#include "dmapi_lib.h" extern int diff --git a/libdm/dm_rdwr.c b/libdm/dm_rdwr.c index f24d1e1..b0ae798 100644 --- a/libdm/dm_rdwr.c +++ b/libdm/dm_rdwr.c @@ -30,8 +30,9 @@ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */ -#include <linux/dmapi_kern.h> -#include <dmapi_lib.h> +#include <dmapi.h> +#include <dmapi_kern.h> +#include "dmapi_lib.h" extern dm_ssize_t diff --git a/libdm/dm_region.c b/libdm/dm_region.c index 7758718..9c949b8 100644 --- a/libdm/dm_region.c +++ b/libdm/dm_region.c @@ -30,8 +30,9 @@ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */ -#include <linux/dmapi_kern.h> -#include <dmapi_lib.h> +#include <dmapi.h> +#include <dmapi_kern.h> +#include "dmapi_lib.h" extern int diff --git a/libdm/dm_right.c b/libdm/dm_right.c index ab92ebd..6ec0937 100644 --- a/libdm/dm_right.c +++ b/libdm/dm_right.c @@ -30,8 +30,9 @@ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */ -#include <linux/dmapi_kern.h> -#include <dmapi_lib.h> +#include <dmapi.h> +#include <dmapi_kern.h> +#include "dmapi_lib.h" extern int diff --git a/libdm/dm_session.c b/libdm/dm_session.c index 8eff0d8..920b331 100644 --- a/libdm/dm_session.c +++ b/libdm/dm_session.c @@ -30,9 +30,9 @@ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */ -#include <linux/dmapi_kern.h> -#include <dmapi_lib.h> - +#include <dmapi.h> +#include <dmapi_kern.h> +#include "dmapi_lib.h" extern int diff --git a/libdm/dmapi_lib.c b/libdm/dmapi_lib.c index cf536eb..b19dc95 100644 --- a/libdm/dmapi_lib.c +++ b/libdm/dmapi_lib.c @@ -30,13 +30,14 @@ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */ -#include <sys/stat.h> #include <fcntl.h> +#include <sys/stat.h> +#include <sys/ioctl.h> #include <sys/errno.h> -#include <sys/ioctl.h> -#include <linux/dmapi_kern.h> -#include <dmapi_lib.h> +#include <dmapi.h> +#include <dmapi_kern.h> +#include "dmapi_lib.h" #define ARG(y) (long)va_arg(ap,y) diff --git a/man/Makefile b/man/Makefile new file mode 100644 index 0000000..7ebe030 --- /dev/null +++ b/man/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +# + +TOPDIR = .. +include $(TOPDIR)/include/builddefs + +SUBDIRS = man3 + +default install install-dev : $(SUBDIRS) + $(SUBDIRS_MAKERULE) + +include $(BUILDRULES) diff --git a/man/man3/Makefile b/man/man3/Makefile new file mode 100644 index 0000000..549c947 --- /dev/null +++ b/man/man3/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Further, this software is distributed without any warranty that it is +# free of the rightful claim of any third person regarding infringement +# or the like. Any license provided herein, whether implied or +# otherwise, applies only to this software file. Patent licenses, if +# any, provided herein do not apply to combinations of this program with +# other software, or any other product whatsoever. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write the Free Software Foundation, Inc., 59 +# Temple Place - Suite 330, Boston MA 02111-1307, USA. +# +# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, +# Mountain View, CA 94043, or: +# +# http://www.sgi.com +# +# For further information regarding this notice, see: +# +# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ +# + +TOPDIR = ../.. +include $(TOPDIR)/include/builddefs + +MAN_SECTION = 3 + +MAN_PAGES = $(shell echo *.$(MAN_SECTION)) +MAN_DEST = $(PKG_MAN_DIR)/man$(MAN_SECTION) +LSRCFILES = $(MAN_PAGES) + +default install : $(MAN_PAGES) + +include $(BUILDRULES) + +install-dev : default + $(INSTALL) -m 755 -d $(MAN_DEST) + $(INSTALL_MAN) diff --git a/man/man3/dmapi.3 b/man/man3/dmapi.3 new file mode 100644 index 0000000..1fa9cc8 --- /dev/null +++ b/man/man3/dmapi.3 @@ -0,0 +1,109 @@ +.TH DMAPI 3 +.SH NAME +dmi \- \&DMAPI internal system call wrapper +.SH SYNOPSIS +.nf +\f3#include <dmapi/dmapi.h>\f1 +\f3#include <dmapi/dmapi_kern.h>\f1 +\f3#include <dmapi/dmapi_lib.h>\f1 +.sp .8v +\f3int dmi (int opcode, ...);\f1 +.fi +.SH DESCRIPTION +\f2dmi\f1 is a system interface used to implement the interface +defined in the X/Open document: +\f3Systems Management: Data Storage Management (XDSM) API\f1 +dated February 1997. +This interface is made available on Silicon Graphics systems +by means of the \f3libdm\f1 library. +.PP +The value of the \f2opcode\f1 parameter determines the meaning +of the remaining arguments. +These are all interfaces that are used +to implement various \f2libdm\fP functions. +The only filesystem that supports these operations is XFS. +They are all subject to change, +should not be called +directly by applications, +and are not described further. +The valid opcodes are: +.PD +.PP +.nf +.B DM_CLEAR_INHERIT +.B DM_CREATE_BY_HANDLE +.B DM_CREATE_SESSION +.B DM_CREATE_USEREVENT +.B DM_DESTROY_SESSION +.B DM_DOWNGRADE_RIGHT +.B DM_FD_TO_HANDLE +.B DM_FIND_EVENTMSG +.B DM_GET_ALLOCINFO +.B DM_GET_BULKALL +.B DM_GET_BULKATTR +.B DM_GET_CONFIG +.B DM_GET_CONFIG_EVENTS +.B DM_GET_DIOINFO +.B DM_GET_DIRATTRS +.B DM_GET_DMATTR +.B DM_GET_EVENTLIST +.B DM_GET_EVENTS +.B DM_GET_FILEATTR +.B DM_GET_MOUNTINFO +.B DM_GET_REGION +.B DM_GETALL_DISP +.B DM_GETALL_DMATTR +.B DM_GETALL_INHERIT +.B DM_GETALL_SESSIONS +.B DM_GETALL_TOKENS +.B DM_INIT_ATTRLOC +.B DM_MKDIR_BY_HANDLE +.B DM_MOVE_EVENT +.B DM_OBJ_REF_HOLD +.B DM_OBJ_REF_QUERY +.B DM_OBJ_REF_RELE +.B DM_PATH_TO_FSHANDLE +.B DM_PATH_TO_HANDLE +.B DM_PENDING +.B DM_PROBE_HOLE +.B DM_PUNCH_HOLE +.B DM_QUERY_RIGHT +.B DM_QUERY_SESSION +.B DM_READ_INVIS +.B DM_RELEASE_RIGHT +.B DM_REMOVE_DMATTR +.B DM_REQUEST_RIGHT +.B DM_RESPOND_EVENT +.B DM_SEND_MSG +.B DM_SET_DISP +.B DM_SET_DMATTR +.B DM_SET_EVENTLIST +.B DM_SET_FILEATTR +.B DM_SET_INHERIT +.B DM_SET_REGION +.B DM_SET_RETURN_ON_DESTROY +.B DM_SYMLINK_BY_HANDLE +.B DM_SYNC_BY_HANDLE +.B DM_UPGRADE_RIGHT +.B DM_WRITE_INVIS +.fi +.sp .8v +.SH ERRORS +The following error codes may be returned by +.IR dmi : +.TP 12 +\&[EFAULT\&] +A buffer is referenced which is not in a valid part of the calling program's +address space. +.TP +\&[EPERM\&] +The effective user ID is not superuser. +.TP +\&[EINVAL\&] +An invalid parameter or parameter combination was specified. +.SH "DIAGNOSTICS" +Upon successful completion, a command dependent value (default of zero) is +returned. +Otherwise, a value of \-1 is returned and +\f2errno\f1 +is set to indicate the error. |