summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile74
-rwxr-xr-xMakepkgs110
-rw-r--r--README15
-rw-r--r--VERSION7
-rw-r--r--attr/Makefile12
-rw-r--r--build/Makefile76
-rw-r--r--build/rpm/Makefile76
-rw-r--r--build/rpm/attr.spec.in81
-rw-r--r--build/rpm/macros.template30
-rw-r--r--build/rpm/rpm-2.rc.template25
-rw-r--r--build/tar/Makefile50
-rw-r--r--configure.in155
-rw-r--r--debian/Makefile40
-rw-r--r--debian/changelog9
-rw-r--r--debian/control24
-rw-r--r--debian/copyright14
-rwxr-xr-xdebian/rules60
-rw-r--r--doc/CHANGES6
-rw-r--r--doc/COPYING860
-rw-r--r--doc/INSTALL48
-rw-r--r--doc/Makefile55
-rw-r--r--doc/PORTING86
-rw-r--r--include/Makefile45
-rw-r--r--include/attributes.h260
-rw-r--r--include/builddefs.in167
-rw-r--r--include/buildrules77
-rwxr-xr-xinstall-sh273
-rw-r--r--libattr/Makefile14
-rw-r--r--man/Makefile41
-rw-r--r--man/man1/Makefile49
-rw-r--r--man/man1/attr.1165
-rw-r--r--man/man2/Makefile49
-rw-r--r--man/man2/attrctl.2350
-rw-r--r--man/man3/Makefile49
-rw-r--r--man/man3/attr_get.3190
-rw-r--r--man/man3/attr_list.3269
-rw-r--r--man/man3/attr_multi.3279
-rw-r--r--man/man3/attr_remove.3155
-rw-r--r--man/man3/attr_set.3215
39 files changed, 4554 insertions, 6 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..8cf3781
--- /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 libattr attr 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
diff --git a/README b/README
new file mode 100644
index 0000000..c60b176
--- /dev/null
+++ b/README
@@ -0,0 +1,15 @@
+Extended attribute package README
+_________________________________
+
+See the file doc/INSTALL for build, installation and post-
+install configuration steps.
+
+Refer to the attr(1) manual page for general extended attribute
+(EA) information and references to other EA manual pages.
+
+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.
diff --git a/VERSION b/VERSION
new file mode 100644
index 0000000..6143fa6
--- /dev/null
+++ b/VERSION
@@ -0,0 +1,7 @@
+#
+# This file is used by configure to get version information
+#
+PKG_MAJOR=1
+PKG_MINOR=0
+PKG_REVISION=0
+PKG_BUILD=0
diff --git a/attr/Makefile b/attr/Makefile
index 148ce75..55202e6 100644
--- a/attr/Makefile
+++ b/attr/Makefile
@@ -33,16 +33,16 @@
TOPDIR = ..
include $(TOPDIR)/include/builddefs
-CMDTARGET = xfs_attr
-CMDDEPS = $(LIBATTR)
-
-CFILES = xfs_attr.c
+CMDTARGET = attr
+CFILES = attr.c
LLDLIBS = $(LIBATTR)
+LLDFLAGS = -L$(TOPDIR)/libattr
default: $(CMDTARGET)
include $(BUILDRULES)
install: default
- $(INSTALL) -m 755 -d $(XFS_CMDS_BIN_DIR)
- $(INSTALL) -m 755 $(CMDTARGET) $(XFS_CMDS_BIN_DIR)
+ $(INSTALL) -m 755 -d $(PKG_SBIN_DIR)
+ $(INSTALL) -m 755 $(CMDTARGET) $(PKG_SBIN_DIR)
+install-dev:
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/attr.spec.in b/build/rpm/attr.spec.in
new file mode 100644
index 0000000..a51c7d1
--- /dev/null
+++ b/build/rpm/attr.spec.in
@@ -0,0 +1,81 @@
+Summary: Utility for managing filesystem extended attributes.
+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
+An *experimental* command (attr) to manipulate extended attributes
+under Linux.
+
+%package devel
+Summary: Extended attribute static libraries and headers.
+Group: Development/Libraries
+Requires: @pkg_name@
+
+%description devel
+attr-devel contains the libraries and header files needed to
+develop programs which make use of extended attributes.
+This is an *experimental* interface, currently only XFS is
+supported, and the interface may change.
+
+You should install attr-devel if you want to develop programs
+which make use of extended attributes. If you install attr-devel,
+you'll also want to install attr.
+
+# 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..3da72ab
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,155 @@
+dnl unpacking check - this file must exist
+AC_INIT(include/attributes.h)
+pkg_name="attr"
+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/attr
+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..0508f35
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,9 @@
+attr (1.0.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..e2961f2
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,24 @@
+Source: attr
+Section: admin
+Priority: optional
+Maintainer: Nathan Scott <nathans@debian.org>
+Build-Depends: autoconf, debmake
+Standards-Version: 3.1.1
+
+Package: attr
+Depends: ${shlibs:Depends}
+Architecture: any
+Description: Experimental utility for manipulating extended attributes
+ An *experimental* command to manipulate filesystem extended
+ attributes. Currently, only the XFS filesystem is supported.
+
+Package: attr-dev
+Section: devel
+Priority: extra
+Depends: libc6-dev, attr
+Architecture: any
+Description: Extended attribute static libraries and headers.
+ attr-dev contains the libraries and header files needed to
+ develop programs which make use of extended attributes.
+ This is an *experimental* interface, currently only XFS is
+ supported, and the interface is likely to change.
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..94b0062
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,60 @@
+#!/usr/bin/make -f
+
+package = attr
+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..1200095
--- /dev/null
+++ b/doc/CHANGES
@@ -0,0 +1,6 @@
+
+attr-1.0.0 (15 January 2001)
+ - extended attribute code abstracted from xfs-cmds package
+ - completed Debian packaging
+ - late beta code
+
diff --git a/doc/COPYING b/doc/COPYING
new file mode 100644
index 0000000..a889ebd
--- /dev/null
+++ b/doc/COPYING
@@ -0,0 +1,860 @@
+All the libraries in "attr" are licensed under Version 2.1
+of the GNU Lesser General Public License.
+
+All other "attr" 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..dd1dde2
--- /dev/null
+++ b/doc/INSTALL
@@ -0,0 +1,48 @@
+This document describes how to configure and build the extended
+attribute library and utility from source, and how to install them.
+
+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 attr
+
+ The Debian command to do this is:
+ # dpkg -i attr
+ or, if you have apt configured (don't need the binary package):
+ # apt-get install attr
+
+1. Configure, build and install the package
+
+ The "attr" 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..63b7a18
--- /dev/null
+++ b/doc/PORTING
@@ -0,0 +1,86 @@
+
+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 : attr/Makefile
+ example static library: attr/libattr/Makefile
+ example command : attr/attr/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 attr/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):
+
+ attr/Logs/configure - `autoconf; ./configure' output
+ attr/Logs/default - `make default' output
+ attr/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..53f77db
--- /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 = attributes.h
+LSRCFILES = builddefs.in buildrules
+
+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/attributes.h b/include/attributes.h
new file mode 100644
index 0000000..e670438
--- /dev/null
+++ b/include/attributes.h
@@ -0,0 +1,260 @@
+/*
+ * 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 __ATTRIBUTES_H__
+#define __ATTRIBUTES_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * The (experimental) Linux generic attribute syscall - attrctl(2)
+ */
+
+typedef union attr_obj {
+ char *path;
+ int fd;
+ pid_t pid;
+} attr_obj_t;
+
+typedef struct attr_op {
+ int opcode; /* which operation to perform */
+ int error; /* result (an errno) of this operation [out] */
+ char *name; /* attribute name */
+ char *value; /* attribute value [in/out] */
+ int length; /* value length [in/out] */
+ int flags; /* bitwise OR of #defines below */
+ void *aux; /* optional cmd specific data */
+} attr_op_t;
+
+extern int attrctl (attr_obj_t __obj, int __type, attr_op_t *__ops, int __count);
+
+/*
+ * attr_obj_t type identifiers
+ */
+#define ATTR_TYPE_FD 1 /* file descriptor */
+#define ATTR_TYPE_PATH 2 /* path - follow symlinks */
+#define ATTR_TYPE_LPATH 3 /* path - don't follow symlinks */
+#define ATTR_TYPE_PID 4 /* process id */
+
+/*
+ * attrctl(2) commands
+ */
+#define ATTR_OP_GET 1 /* return the indicated attr's value */
+#define ATTR_OP_SET 2 /* set/create the indicated attr/value pair */
+#define ATTR_OP_REMOVE 3 /* remove the indicated attr */
+#define ATTR_OP_LIST 4 /* list attributes associated with a file */
+#define ATTR_OP_EXT 32 /* for supporting extensions */
+
+/*
+ * Valid command flags, may be used with all attrctl(2) commands.
+ * Flags should be bitwise OR'ed together.
+ */
+#define ATTR_ROOT 0x0001 /* use attrs in root namespace, not user */
+#define ATTR_CREATE 0x0002 /* pure create: fail if attr already exists */
+#define ATTR_REPLACE 0x0004 /* pure set: fail if attr does not exist */
+#define ATTR_SHIFT 16 /* for supporting extensions */
+
+/*
+ * Additional API specific opcodes & flags
+ */
+#define ATTR_OP_IRIX_LIST (ATTR_OP_EXT + 0) /* IRIX: for supporting strange */
+ /* attr_list(f) API semantics */
+#define ATTR_DONTFOLLOW (0x0001 << ATTR_SHIFT) /* IRIX: do not follow symlinks */
+ /* (now redundant) */
+#define ATTR_TRUST (0x0002 << ATTR_SHIFT) /* IRIX: tell server we can be */
+ /* trusted to properly handle */
+ /* extended attributes */
+
+/*
+ *
+ * The IRIX extended attributes API, fully implemented by XFS
+ *
+ */
+
+/*
+ * The maximum size (into the kernel or returned from the kernel) of an
+ * attribute value or the buffer used for an attr_list() call. Larger
+ * sizes will result in an E2BIG return code.
+ */
+#define ATTR_MAX_VALUELEN (64*1024) /* max length of a value */
+
+/*
+ * Define how lists of attribute names are returned to the user from
+ * the attr_list() syscall. A large, 32bit aligned, buffer is passed in
+ * along with its size. We put an array of offsets at the top that each
+ * reference an attrlist_ent_t and pack the attrlist_ent_t's at the bottom.
+ */
+typedef struct attrlist {
+ __s32 al_count; /* number of entries in attrlist */
+ __s32 al_more; /* T/F: more attrs (do syscall again) */
+ __s32 al_offset[1]; /* byte offsets of attrs [var-sized] */
+} attrlist_t;
+
+/*
+ * Show the interesting info about one attribute. This is what the
+ * al_offset[i] entry points to.
+ */
+typedef struct attrlist_ent { /* data from attr_list() */
+ __u32 a_valuelen; /* number bytes in value of attr */
+ char a_name[1]; /* attr name (NULL terminated) */
+} attrlist_ent_t;
+
+/*
+ * Given a pointer to the (char*) buffer containing the attr_list() result,
+ * and an index, return a pointer to the indicated attribute in the buffer.
+ */
+#define ATTR_ENTRY(buffer, index) \
+ ((attrlist_ent_t *) \
+ &((char *)buffer)[ ((attrlist_t *)(buffer))->al_offset[index] ])
+
+
+/*
+ * Implement a "cursor" for use in successive attr_list() system calls.
+ * It provides a way to find the last attribute that was returned in the
+ * last attr_list() syscall so that we can get the next one without missing
+ * any. This should be bzero()ed before use and whenever it is desired to
+ * start over from the beginning of the attribute list. The only valid
+ * operation on a cursor is to bzero() it.
+ */
+typedef struct attrlist_cursor {
+ __u32 opaque[4]; /* an opaque cookie */
+} attrlist_cursor_t;
+
+/*
+ * Multi-attribute operation vector.
+ */
+typedef struct attr_multiop {
+ int am_opcode; /* which operation to perform (ATTR_OP_GET etc.)*/
+ int am_error; /* [out arg] result of this sub-op (an errno) */
+ char *am_attrname; /* attribute name to work with */
+ char *am_attrvalue; /* [in/out arg] attribute value (raw bytes) */
+ int am_length; /* [in/out arg] length of value */
+ int am_flags; /* bitwise OR of attrctl(2) flags defined above */
+} attr_multiop_t;
+#define ATTR_MAX_MULTIOPS 128 /* max number ops in an oplist array */
+
+/*
+ * Get the value of an attribute.
+ * Valuelength must be set to the maximum size of the value buffer, it will
+ * be set to the actual number of bytes used in the value buffer upon return.
+ * The return value is -1 on error (w/errno set appropriately), 0 on success.
+ */
+extern int attr_get (const char *path, const char *attrname, char *attrvalue,
+ int *valuelength, int flags);
+extern int attr_getf (int fd, const char *attrname, char *attrvalue,
+ int *valuelength, int flags);
+
+/*
+ * Set the value of an attribute, creating the attribute if necessary.
+ * The return value is -1 on error (w/errno set appropriately), 0 on success.
+ */
+extern int attr_set (const char *__path, const char *__attrname,
+ const char *__attrvalue, const int __valuelength,
+ int __flags);
+extern int attr_setf (int __fd, const char *__attrname,
+ const char *__attrvalue, const int __valuelength,
+ int __flags);
+
+/*
+ * Remove an attribute.
+ * The return value is -1 on error (w/errno set appropriately), 0 on success.
+ */
+extern int attr_remove (const char *__path, const char *__attrname,
+ int __flags);
+extern int attr_removef (int __fd, const char *__attrname, int __flags);
+
+/*
+ * List the names and sizes of the values of all the attributes of an object.
+ * "Cursor" must be allocated and zeroed before the first call, it is used
+ * to maintain context between system calls if all the attribute names won't
+ * fit into the buffer on the first system call.
+ * The return value is -1 on error (w/errno set appropriately), 0 on success.
+ */
+extern int attr_list (const char *__path, char *__buffer,
+ const int __buffersize, int __flags,
+ attrlist_cursor_t *__cursor);
+extern int attr_listf (int __fd, char *__buffer, const int __buffersize,
+ int __flags, attrlist_cursor_t *__cursor);
+
+/*
+ * Operate on multiple attributes of the same object simultaneously.
+ *
+ * This call will save on system call overhead when many attributes are
+ * going to be operated on.
+ *
+ * The return value is -1 on error (w/errno set appropriately), 0 on success.
+ * Note that this call will not return -1 as a result of failure of any
+ * of the sub-operations, their return value is stored in each element
+ * of the operation array. This call will return -1 for a failure of the
+ * call as a whole, eg: if the pathname doesn't exist, or the fd is bad.
+ *
+ * The semantics and allowable values for the fields in a attr_multiop_t
+ * are the same as the semantics and allowable values for the arguments to
+ * the corresponding "simple" attribute interface. For example: the args
+ * to a ATTR_OP_GET are the same as the args to an attr_get() call.
+ */
+extern int attr_multi (const char *__path, attr_multiop_t *__oplist,
+ int __count, int __flags);
+extern int attr_multif (int __fd, attr_multiop_t *__oplist,
+ int __count, int __flags);
+
+#ifdef __KERNEL__
+
+/*
+ * The DMI needs a way to update attributes without affecting the inode
+ * timestamps. Note that this flag is not settable from user mode, it is
+ * kernel internal only, but it must not conflict with the above flags either.
+ */
+#define ATTR_KERNOTIME (0x0004 << ATTR_SHIFT) /* IRIX: don't update the inode */
+ /* timestamps */
+
+/*
+ * Kernel-internal version of the attrlist cursor.
+ */
+typedef struct attrlist_cursor_kern {
+ __u32 hashval; /* hash value of next entry to add */
+ __u32 blkno; /* block containing entry (suggestion)*/
+ __u32 offset; /* offset in list of equal-hashvals */
+ __u16 pad1; /* padding to match user-level */
+ __u8 pad2; /* padding to match user-level */
+ __u8 initted; /* T/F: cursor has been initialized */
+} attrlist_cursor_kern_t;
+
+#endif /* __KERNEL__ */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ATTRIBUTES_H__ */
diff --git a/include/builddefs.in b/include/builddefs.in
new file mode 100644
index 0000000..58a736f
--- /dev/null
+++ b/include/builddefs.in
@@ -0,0 +1,167 @@
+#
+# 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@
+
+#LIBATTR = -lattr
+LIBATTR = $(TOPDIR)/libattr/libattr.a
+
+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) -I$(TOPDIR)/include '-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/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/libattr/Makefile b/libattr/Makefile
index ef15036..cba306a 100644
--- a/libattr/Makefile
+++ b/libattr/Makefile
@@ -34,10 +34,24 @@ TOPDIR = ..
include $(TOPDIR)/include/builddefs
STATICLIBTARGET = libattr.a
+
CFILES = attr.c
+LCFLAGS = -D_REENTRANT
default: $(STATICLIBTARGET)
include $(BUILDRULES)
install: default
+
+install-dev: default
+ $(INSTALL) -m 755 -d $(PKG_LIB_DIR)
+ $(INSTALL) -m 644 $(STATICLIBTARGET) $(PKG_LIB_DIR)
+
+#LIBTARGET = libattr.so.1
+#install: default
+# $(INSTALL) -m 755 -d $(PKG_SLIB_DIR)
+# $(INSTALL) -m 755 $(LIBTARGET) $(PKG_SLIB_DIR)
+#install-dev: default
+# ...
+# $(INSTALL) -S $(PKG_SLIB_DIR)/$(LIBTARGET) $(PKG_LIB_DIR)/libattr.so
diff --git a/man/Makefile b/man/Makefile
new file mode 100644
index 0000000..057c462
--- /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 = man1 man2 man3
+
+default install install-dev : $(SUBDIRS)
+ $(SUBDIRS_MAKERULE)
+
+include $(BUILDRULES)
diff --git a/man/man1/Makefile b/man/man1/Makefile
new file mode 100644
index 0000000..83c09c9
--- /dev/null
+++ b/man/man1/Makefile
@@ -0,0 +1,49 @@
+#
+# 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 = 1
+
+MAN_PAGES = $(shell echo *.$(MAN_SECTION))
+MAN_DEST = $(PKG_MAN_DIR)/man$(MAN_SECTION)
+LSRCFILES = $(MAN_PAGES)
+
+default : $(MAN_PAGES)
+
+include $(BUILDRULES)
+
+install : default
+ $(INSTALL) -m 755 -d $(MAN_DEST)
+ $(INSTALL_MAN)
+install-dev:
diff --git a/man/man1/attr.1 b/man/man1/attr.1
new file mode 100644
index 0000000..7d0302e
--- /dev/null
+++ b/man/man1/attr.1
@@ -0,0 +1,165 @@
+.TH attr 1
+.SH NAME
+attr \- manipulate Extended Attributes on filesystem objects
+.SH SYNOPSIS
+.nf
+\f3attr\f1 [ \f3\-LRq\f1 ] \f3\-s attrname\f1 [ \f3\-V attrvalue\f1 ] \c
+\f3pathname\f1
+.sp .8v
+\f3attr\f1 [ \f3\-LRq\f1 ] \f3\-g attrname pathname\f1
+.sp .8v
+\f3attr\f1 [ \f3\-LRq\f1 ] \f3\-r attrname pathname\f1
+.sp .8v
+\f3attr\f1 [ \f3\-LRq\f1 ] \f3\-l pathname\f1
+.sp .8v
+.fi
+.SH OVERVIEW
+Extended Attributes implement the ability for a user to attach
+name/value pairs to objects within the filesystem.
+They are currently only supported in XFS filesystems.
+.P
+They could be used to store meta-information about the file.
+For example "character-set=kanji" could tell a document browser to
+use the Kanji character set when displaying that document
+and "thumbnail=..." could provide a reduced resolution overview of a
+high resolution graphic image.
+.P
+The
+.I names
+can be up to 256 bytes in length, terminated by the first 0 byte.
+The intent is that they be printable ASCII (or other character set)
+names for the attribute.
+.P
+The
+.I values
+can be up to 256KB of arbitrary binary data.
+.P
+Attributes can be attached to all types of inodes:
+regular files, directories, symbolic links, device nodes, etc.
+.P
+There are 2 disjoint attribute name spaces associated with every
+filesystem object.
+They are the
+.B root
+and
+.B user
+address spaces.
+The
+.B root
+address space is accessable only to the superuser,
+and then only by specifying a flag argument to the function call.
+Other users will not see or be able to modify attributes in the
+.B root
+address space.
+The
+.B user
+address space is protected by the normal file permissions mechanism,
+so the owner of the file can decide who is able to see and/or modify
+the value of attributes on any particular file.
+.P
+Attributes are currently supported only in the XFS filesystem type.
+.SH DESCRIPTION
+The
+.I attr
+utility allows the manipulation of Extended Attributes associated with
+filesystem objects from within shell scripts.
+.PP
+There are four main operations that
+.I attr
+can perform:
+.TP
+.B GET
+The
+.B \-g attrname
+option tells
+.I attr
+to search the named object and print (to \f4stdout\fP) the value
+associated with that attribute name.
+With the
+.B \-q
+flag, \f4stdout\fP will be exactly and only the value of the attribute,
+suitable for storage directly into a file or processing via a piped command.
+.TP
+.B LIST
+The
+.B \-l
+option tells
+.I attr
+to list the names of all the attributes that are associated with the object,
+and the number of bytes in the value of each of those attributes.
+With the
+.B \-q
+flag, \f4stdout\fP will be a simple list of only the attribute names,
+one per line, suitable for input into a script.
+.TP
+.B REMOVE
+The
+.B \-r attrname
+option tells
+.I attr
+to remove an attribute with the given name from the object if the
+attribute exists.
+There is no output on sucessful completion.
+.TP
+.B SET/CREATE
+The
+.B \-s attrname
+option tells
+.I attr
+to set the named attribute of the object to the value read from \f4stdin\fP.
+If an attribute with that name already exists,
+its value will be replaced with this one.
+If an attribute with that name does not already exist,
+one will be created with this value.
+With the
+.B \-V attrvalue
+flag, the attribute will be set to have a value of
+.B attrvalue
+and \f4stdin\fP will not be read.
+With the
+.B \-q
+flag, \f4stdout\fP will not be used.
+Without the
+.B \-q
+flag, a message showing the attribute name and the entire value
+will be printed.
+.PP
+When the
+.B \-L
+option is given and the named object is a symbolic link,
+operate on the attributes of the object referenced by the symbolic link.
+Without this option, operate on the attributes of the symbolic link itself.
+.PP
+When the
+.B \-R
+option is given and the process has appropriate privileges,
+operate in the
+.I root
+attribute namespace rather that the
+.I USER
+attribute namespace.
+.PP
+When the
+.B \-q
+option is given
+.I attr
+will try to keep quiet.
+It will output error messages (to \f4stderr\fP)
+but will not print status messages (to \f4stdout\fP).
+.SH "NOTES"
+The standard file interchange/archive programs
+.IR tar (1),
+.IR cpio (1),
+and
+.IR bru (1)
+will not archive or restore Extended Attributes,
+while the
+.IR xfsdump (8)
+program will.
+.SH "SEE ALSO"
+attr_get(2), attr_getf(2),
+attr_list(2), attr_listf(2),
+attr_multi(2), attr_multif(2),
+attr_remove(2), attr_removef(2),
+attr_set(2), attr_setf(2),
+xfsdump(8).
diff --git a/man/man2/Makefile b/man/man2/Makefile
new file mode 100644
index 0000000..db1761c
--- /dev/null
+++ b/man/man2/Makefile
@@ -0,0 +1,49 @@
+#
+# 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 = 2
+
+MAN_PAGES = $(shell echo *.$(MAN_SECTION))
+MAN_DEST = $(PKG_MAN_DIR)/man$(MAN_SECTION)
+LSRCFILES = $(MAN_PAGES)
+
+default : $(MAN_PAGES)
+
+include $(BUILDRULES)
+
+install : default
+ $(INSTALL) -m 755 -d $(MAN_DEST)
+ $(INSTALL_MAN)
+install-dev:
diff --git a/man/man2/attrctl.2 b/man/man2/attrctl.2
new file mode 100644
index 0000000..b49b0c7
--- /dev/null
+++ b/man/man2/attrctl.2
@@ -0,0 +1,350 @@
+.TH ATTRCTL 2
+.SH NAME
+attrctl \- manipulate (extended) attributes of system objects
+.SH C SYNOPSIS
+.PP
+.sp
+.nf
+.B #include <attr/attributes.h>
+.sp
+.B "int attrctl (attr_obj_t obj, int type, attr_op_t *ops,"
+.B " int count);"
+.Op
+.SH OVERVIEW
+The
+.I attrctl
+system call allows a user to attach name/value pairs to system
+objects - typically filesystem objects (inodes).
+.P
+This is a first draft proposal which may well *not* be the final
+interface - it has been implemented to address some immediate
+issues with the current XFS implementation and is the first attempt
+at an interface which could allow both XFS and EXT2 extended attributes
+implementations to coexist.
+.P
+Extended attributes can be used to store meta-information about a
+file, for example "character-set=kanji" could tell a document browser
+to use the Kanji character set when displaying that document
+and "thumbnail=..." could provide a reduced resolution overview of a
+high resolution graphic image.
+.P
+The
+.B names
+can be up to MAXNAMELEN bytes in length, terminated by the first \e0 byte.
+The intent is that they be printable ASCII (or other character set)
+names for the attribute.
+.P
+The
+.B values
+can be up to ATTR_MAX_VALUELEN (currently 64KB) of arbitrary binary data.
+.P
+Attributes can be attached to all types of inodes:
+regular files, directories, symbolic links, device nodes, etc.
+.P
+There are 2 disjoint attribute name spaces associated with every
+filesystem object.
+They are the
+.B root
+and
+.B user
+address spaces.
+The
+.B root
+address space is accessible only to the super-user,
+and then only by specifying a flag to the operation request.
+Non-root users will not see or be able to modify attributes in the
+.B root
+address space.
+The
+.B user
+address space is protected by the normal file permissions mechanism,
+so the owner of the file can decide who is able to see and/or modify
+the value of attributes on any particular file. The attribute get/list
+operations require read permission, and attribute set/remove require
+write permission.
+.P
+Attributes are currently supported only in the XFS and EXT2 filesystem
+types. However, this system call has been designed to be generic
+and extensible, such that other filesystems should be able to make
+use of it.
+.SH DESCRIPTION
+The
+.I attrctl
+system call provides a way to access arbitrary extended attributes.
+.P
+.I Obj\^
+indicates the system object whose extended attributes are to be
+manipulated.
+The contents of the \f4attr_obj_t\f1 union are as follows:
+.P
+typedef union {
+.RS 3
+.nf
+.ft 4
+.ta 9n 22n
+char *path;
+int fd;
+pid_t pid;
+.ft 1
+.fi
+.RE
+} attr_obj_t;
+.PP
+.I type\^
+identifies the type of
+.I obj\^
+- currently only file descriptors and path names are implemented
+(ATTR_TYPE_NAME and ATTR_TYPE_FD), but processes have also been
+proposed (ATTR_TYPE_PID).
+.P
+.I Ops\^
+refers to an array of one or more input/output structures containing
+control information related to attribute operations and those
+operations' results.
+.PP
+The
+.I count
+argument indicates the number of structures in the
+.I ops
+array.
+.PP
+.Op c p a
+The contents of an \f4attr_op_t\fP structure are as follows:
+.P
+typedef struct {
+.RS 3
+.nf
+.ft 4
+.ta 9n 22n
+int opcode; /* which operation to perform (see below) */
+int error; /* [out arg] result of this sub-op (an errno) */
+char *name; /* attribute name to work with */
+char *value; /* [in/out arg] attribute value (raw bytes) */
+int length; /* [in/out arg] length of value */
+int flags; /* flags (bit-wise OR of #defines below) */
+void *aux; /* optional command-specific data */
+.ft 1
+.fi
+.RE
+} attr_op_t;
+.PP
+The
+.I opcode
+field defines how the remaining fields are to be interpreted
+and can take on one of the following
+.B ATTR_OP
+values.
+.PP
+.B ATTR_OP_GET
+returns the
+.I value
+associated with attribute
+.IR name .
+The size of the user buffer is passed in as
+.IR length ,
+and the size of the attribute value is returned in the same field.
+Valid flags are ATTR_ROOT and ATTR_DONTFOLLOW.
+.P
+.B ATTR_OP_SET
+sets (possibly creating a new attribute) the value of the
+attribute specified by
+.I name
+to
+.IR value .
+The
+.I length
+parameter specifies the size of the new value, and the valid
+.I flags
+are ATTR_ROOT, ATTR_DONTFOLLOW, ATTR_CREATE, and ATTR_REPLACE.
+.P
+.B ATTR_OP_REMOVE
+provides a way to remove previously created attributes.
+If the attribute
+.I name
+exists, the attribute name and its associated value will be
+removed.
+Valid
+.I flags
+are ATTR_ROOT and ATTR_DONTFOLLOW.
+.P
+.B ATTR_OP_LIST
+is used to list the existing attributes associated with an object.
+The
+.I name
+field is ignored \-
+.I value
+and
+.I size
+specify the buffer to be filled with at least a portion of the
+attributes associated with the given object.
+An
+.B attrlist_t
+structure will be written into the
+.I value
+buffer, containing a list of the attributes associated with the
+object, up to a maximum of
+.I size
+bytes.
+The
+.B attrlist_t
+structure contains the following elements:
+.P
+typedef struct {
+.RS 3
+.nf
+.ft 4
+.ta 9n 22n
+__s32 count; /* number of entries in attribute list */
+__s32 more; /* [in/out arg] more attrs (call again) */
+__s32 offset[1]; /* byte offsets of attrs [var-sized] */
+.ft 1
+.fi
+.RE
+} attrlist_t;
+.PP
+The
+.I count
+field shows the number of attributes represented in this buffer,
+which is also the number of elements in the
+.I offset
+array.
+The
+.I more
+field will be non-zero if another
+.B ATTR_OP_LIST
+call would retrieve more attributes.
+The
+.I offset
+array contains the byte offset within the
+.I value
+buffer of the structure describing each of the attributes, an
+.B attrlist_ent_t
+structure.
+The
+.B "ATTR_ENTRY(buffer, index)"
+macro will help with decoding the list.
+It takes a pointer to the
+.I value
+and an index into the
+.I offset
+array, and returns a pointer to the corresponding
+.I attrlist_ent_t
+structure.
+.P
+typedef struct {
+.RS 3
+.nf
+.ft 4
+.ta 9n 22n
+__u32 valuelen; /* number of bytes in attribute value */
+char name[]; /* attribute name (NULL terminated) */
+.ft 1
+.fi
+.RE
+} attrlist_ent_t;
+.PP
+The
+.I valuelen
+field shows the size in bytes of the value associated
+with the attribute whose name is stored in the
+.I name
+field.
+.P
+Valid
+.I flags
+for the
+.B ATTR_LIST
+command are ATTR_ROOT and ATTR_DONTFOLLOW.
+The
+.I aux
+pointer is used to reference an opaque cursor (type
+.BR attrlist_cursor_t ),
+which the kernel uses to track the calling process's position
+in the attribute list.
+The only valid operations on this cursor are to pass it into the
+operation or to zero it out (it should be zeroed before the
+first
+.B attrctl
+call.
+Note that multi-threaded applications may keep more than one
+cursor in order to serve multiple contexts (i.e. the
+.B ATTR_LIST
+operation is "thread-safe").
+.P
+All operations will set
+.I error
+to an error code if the operation fails, otherwise it will
+contain zero indicating success. The set of valid
+.I flags
+field values (combined using bitwise OR) is as follows:
+.TP
+.SM
+\%ATTR_ROOT
+Look for attribute
+.I name
+in the
+.B root
+address space, not in the
+.B user
+address space (limited to use by the super-user only).
+.TP
+.SM
+\%ATTR_DONTFOLLOW
+Do not follow symbolic links when resolving a
+.I path
+on an
+.I attr_set
+function call.
+The default is to follow symbolic links.
+.TP
+.SM
+\%ATTR_CREATE
+Set
+.I error
+field (EEXIST) if an attribute of the given name already
+exists on the indicated object.
+This flag is used to implement a pure create operation,
+without this flag
+.B ATTR_SET
+will create the attribute if it does not already exist.
+.TP
+.SM
+\%ATTR_REPLACE
+Set
+.I error
+field (ENOENT) if an attribute of the given name
+does not already exist on the indicated object,
+otherwise replace the existing attribute\'s value with the
+given value.
+This flag is used to implement a pure replacement operation,
+without this flag
+.B ATTR_SET
+will create the attribute if it does not already exist.
+.PP
+The
+.I error
+field will be set (EINVAL) if both ATTR_CREATE and ATTR_REPLACE
+are requested in the same operation.
+.SH DIAGNOSTICS
+.I attrctl
+will return 0 on success, and an error code on any failure.
+Since the
+.I attrctl
+system call is arbitrarily extensible, and the intention is that it
+will always be used through an overlying API, refer to the manual
+pages for overlying API calls for specific error code values.
+.P
+.I attrctl
+will always attempt to perform all operations, and a set of
+operations are not atomic (failure of one operation does not
+necessarily cause prior successful operations to be undone).
+.SH "SEE ALSO"
+attr(1),
+.br
+attr_list(3), attr_listf(3),
+.br
+attr_multi(3), attr_multif(3),
+.br
+attr_remove(3), attr_removef(3),
+.br
+attr_set(3), attr_setf(3).
diff --git a/man/man3/Makefile b/man/man3/Makefile
new file mode 100644
index 0000000..abf2063
--- /dev/null
+++ b/man/man3/Makefile
@@ -0,0 +1,49 @@
+#
+# 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 : $(MAN_PAGES)
+
+include $(BUILDRULES)
+
+install : default
+ $(INSTALL) -m 755 -d $(MAN_DEST)
+ $(INSTALL_MAN)
+install-dev:
diff --git a/man/man3/attr_get.3 b/man/man3/attr_get.3
new file mode 100644
index 0000000..8c9385c
--- /dev/null
+++ b/man/man3/attr_get.3
@@ -0,0 +1,190 @@
+.TH ATTR_GET 3
+.SH NAME
+attr_get, attr_getf \- get the value of a user attribute of a filesystem object
+.SH C SYNOPSIS
+.PP
+.sp
+.nf
+.B #include <sys/attributes.h>
+.sp
+.B "int attr_get (const char \(**path, const char \(**attrname, "
+.B " char \(**attrvalue, int \(**valuelength, int flags);"
+.PP
+.B "int attr_getf (int fd, const char \(**attrname, "
+.B " char \(**attrvalue, int \(**valuelength, int flags);"
+.Op
+.SH DESCRIPTION
+The
+.I attr_get
+and
+.I attr_getf
+functions provide a way to retrieve the value of an attribute.
+.P
+.I Path\^
+points to a path name for a filesystem object, and
+.I fd\^
+refers to the file descriptor associated with a file.
+If the attribute
+.I attrname
+exists, the value associated with it will be copied into the
+.I attrvalue
+buffer.
+The
+.I valuelength
+argument is an input/output argument that on the call to
+.I attr_get
+should contain the maximum size of attribute value the
+process is willing to accept.
+On return, the
+.I valuelength
+will have been modified to show the actual size of the
+attribute value returned.
+The
+.I flags
+argument can contain the following symbols bitwise OR\'ed together:
+.TP
+.SM
+\%ATTR_ROOT
+Look for
+.I attrname
+in the
+.B root
+address space, not in the
+.B user
+address space.
+(limited to use by super-user only)
+.TP
+.SM
+\%ATTR_DONTFOLLOW
+Do not follow symbolic links when resolving a
+.I path
+on an
+.I attr_get
+function call.
+The default is to follow symbolic links.
+.PP
+.I attr_get
+will fail if one or more of the following are true:
+.TP 17
+.SM
+\%[ENOATTR]
+The attribute name given is not associated with the indicated
+filesystem object.
+.TP
+.SM
+\%[E2BIG]
+The value of the given attribute is too large to fit into the buffer.
+The integer that the
+.I valuelength
+argument points to has been modified to show the actual number
+of bytes that would be required to store the value of that attribute.
+.TP
+.SM
+\%[ENOENT]
+The named file does not exist.
+.TP
+.SM
+\%[EPERM]
+The effective user
+.SM ID
+does not match the owner of the file
+and the effective user
+.SM ID
+is not super-user.
+.TP
+.SM
+\%[ENOTDIR]
+A component of the
+path prefix
+is not a directory.
+.TP
+.SM
+\%[EACCES]
+Search permission is denied on a
+component of the
+path prefix.
+.TP
+.SM
+\%[EINVAL]
+A bit was set in the
+.I flag
+argument that is not defined for this system call.
+.TP
+.SM
+\%[EFAULT]
+.I Path,
+.I attrname,
+.I attrvalue,
+or
+.I valuelength
+points outside the allocated address space of the process.
+.TP
+.SM
+\%[ELOOP]
+A path name lookup involved too many symbolic links.
+.TP
+.SM
+\%[ENAMETOOLONG]
+The length of
+.I path
+exceeds
+.SM
+.RI { MAXPATHLEN },
+or a pathname component is longer than
+.SM
+.RI { MAXNAMELEN }.
+.PP
+.I attr_getf\^
+will fail if:
+.TP 15
+.SM
+\%[ENOATTR]
+The attribute name given is not associated with the indicated
+filesystem object.
+.TP
+.SM
+\%[E2BIG]
+The value of the given attribute is too large to fit into the buffer.
+The integer that the
+.I valuelength
+argument points to has been modified to show the actual numnber
+of bytes that would be required to store the value of that attribute.
+.TP
+.SM
+\%[EINVAL]
+A bit was set in the
+.I flag
+argument that is not defined for this system call,
+or
+.I fd\^
+refers to a socket, not a file.
+.TP
+.SM
+\%[EFAULT]
+.I Attrname,
+.I attrvalue,
+or
+.I valuelength
+points outside the allocated address space of the process.
+.TP
+.SM
+\%[EBADF]
+.I Fd\^
+does not refer to a valid descriptor.
+.SH "SEE ALSO"
+attr(1),
+.br
+attrctl(2),
+.br
+attr_list(3), attr_listf(3)
+.br
+attr_multi(3), attr_multif(3)
+.br
+attr_remove(3), attr_removef(3),
+.br
+attr_set(3), attr_setf(3),
+.SH "DIAGNOSTICS"
+Upon successful completion, a value of 0 is returned.
+Otherwise, a value of \-1 is returned and
+.I errno\^
+is set to indicate the error.
diff --git a/man/man3/attr_list.3 b/man/man3/attr_list.3
new file mode 100644
index 0000000..71408a4
--- /dev/null
+++ b/man/man3/attr_list.3
@@ -0,0 +1,269 @@
+.TH ATTR_LIST 3
+.SH NAME
+attr_list, attr_listf \- list the names of the user attributes of a filesystem object
+.SH C SYNOPSIS
+.PP
+.sp
+.nf
+.B #include <sys/attributes.h>
+.sp
+.B "int attr_list (const char \(**path, char \(**buffer, "
+.B " const int buffersize, int flags,"
+.B " attrlist_cursor_t \(**cursor);"
+.PP
+.B "int attr_listf (int fd, char \(**buffer, "
+.B " const int buffersize, int flags,"
+.B " attrlist_cursor_t \(**cursor);"
+.Op
+.SH DESCRIPTION
+The
+.I attr_list
+and
+.I attr_listf
+functions provide a way to list the existing attributes of a
+filesystem object.
+.P
+.I Path\^
+points to a path name for a filesystem object, and
+.I fd\^
+refers to the file descriptor associated with a file.
+The
+.I buffer
+will be filled with a structure describing at least a portion of the
+attributes associated with the given filesystem object.
+.I Buffer
+will be overwritten with an \f4attrlist_t\fP structure
+containing a list of the attributes associated with
+that filesystem object, up to a maximum of
+.I buffersize
+bytes.
+The
+.I buffer
+must be sufficiently large to hold the appropriate data structures
+plus at least one maximally sized attribute name,
+but cannot be more than ATTR_MAX_VALUELEN (currently 64KB) bytes in length.
+.PP
+.Op c p a
+The contents of an \f4attrlist_t\fP structure include the following members:
+.P
+.RS 3
+.nf
+.ft 4
+.ta 9n 22n
+__int32_t al_count; /\(** number of entries in attrlist \(**/
+__int32_t al_more; /\(** T/F: more attrs (do syscall again) \(**/
+__int32_t al_offset[1]; /\(** byte offsets of attrs [var-sized] \(**/
+.ft 1
+.fi
+.RE
+.PP
+The
+.I al_count
+field shows the number of attributes represented in this buffer,
+which is also the number of elements in the
+.I al_offset
+array.
+The
+.I al_more
+field will be non-zero if another
+.I attr_list
+call would result in more attributes.
+The
+.I al_offset
+array contains the byte offset within the
+.I buffer
+of the structure describing each of the attributes,
+an \f4attrlist_ent_t\fP structure.
+The \f4ATTR_ENTRY(buffer, index)\fP macro will help with decoding the list.
+It takes a pointer to the
+.I buffer
+and an
+.I index
+into the
+.I al_offset
+array and returns a pointer to the corresponding
+\f4attrlist_ent_t\fP structure.
+.PP
+The contents of an \f4attrlist_ent_t\fP structure
+include the following members:
+.P
+.RS 3
+.nf
+.ft 4
+.ta 9n 22n
+u_int32_t a_valuelen; /\(** number bytes in value of attr \(**/
+char a_name[]; /\(** attr name (NULL terminated) \(**/
+.ft 1
+.fi
+.Op
+.RE
+.PP
+The
+.I a_valuelen
+field shows the size in bytes of the value
+associated with the attribute whose name is stored in the
+.I a_name
+field.
+The name is a NULL terminated string.
+.PP
+Note that the value of the attribute cannot be obtained through
+this interface, the
+.I attr_get
+call should be used to get the value.
+The
+.I attr_list
+interface tells the calling process how large of a buffer
+it must have in order to get the attribute\'s value.
+.PP
+The
+.I flags
+argument can contain the following symbols bitwise OR\'ed together:
+.TP
+.SM
+\%ATTR_ROOT
+List the attributes that are in the
+.B root
+address space, not in the
+.B user
+address space.
+(limited to use by super-user only)
+.TP
+.SM
+\%ATTR_DONTFOLLOW
+Do not follow symbolic links when resolving a
+.I path
+on an
+.I attr_list
+function call.
+The default is to follow symbolic links.
+.PP
+The
+.I cursor
+argument is a pointer to an opaque data structure that the kernel uses
+to track the calling process\'s position in the attribute list.
+The only valid operations on a
+.I cursor
+are to pass it into an
+.I attr_list
+function call or to zero it out.
+It should be zero\'ed out before the first
+.I attr_list
+call.
+Note that multi-threaded applications may keep more than one
+.I cursor
+in order to serve multiple contexts, ie: the
+.I attr_list
+call is "thread-safe".
+.PP
+.I attr_list
+will fail if one or more of the following are true:
+.TP 17
+.SM
+\%[ENOENT]
+The named file does not exist.
+.TP
+.SM
+\%[EPERM]
+The effective user
+.SM ID
+does not match the owner of the file
+and the effective user
+.SM ID
+is not super-user.
+.TP
+.SM
+\%[ENOTDIR]
+A component of the
+path prefix
+is not a directory.
+.TP
+.SM
+\%[EACCES]
+Search permission is denied on a
+component of the
+path prefix.
+.TP
+.SM
+\%[EINVAL]
+A bit was set in the
+.I flag
+argument that is not defined for this system call,
+or the buffer was too small or too large.
+.TP
+.SM
+\%[EFAULT]
+Either
+.I Path
+or
+.I buffer
+points outside the allocated address space of the process, or
+.I buffer
+or
+.I bufsize
+are not 32bit aligned.
+.TP
+.SM
+\%[ELOOP]
+A path name lookup involved too many symbolic links.
+.TP
+.SM
+\%[ENAMETOOLONG]
+The length of
+.I path
+exceeds
+.SM
+.RI { MAXPATHLEN },
+or a pathname component is longer than
+.SM
+.RI { MAXNAMELEN }.
+.TP
+.SM
+\%[ENOATTR]
+.I attribute\^
+does not exist for this file.
+.PP
+.I attr_listf\^
+will fail if:
+.TP 15
+.SM
+\%[EINVAL]
+A bit was set in the
+.I flag
+argument that is not defined for this system call, or
+.I fd\^
+refers to a socket, not a file,
+or the buffer was too small or too large.
+.TP
+.SM
+\%[EFAULT]
+Either
+.I Path
+or
+.I buffer
+points outside the allocated address space of the process, or
+.I buffer
+or
+.I bufsize
+are not 32bit aligned.
+.TP
+.SM
+\%[EBADF]
+.I Fd\^
+does not refer to a valid descriptor.
+.SH "SEE ALSO"
+attr(1),
+.br
+attrctl(2),
+.br
+attr_get(3), attr_getf(3),
+.br
+attr_multi(3), attr_multif(3)
+.br
+attr_remove(3), attr_removef(3),
+.br
+attr_set(3), attr_set(3)
+.SH "DIAGNOSTICS"
+Upon successful completion, a value of 0 is returned.
+Otherwise, a value of \-1 is returned and
+.I errno\^
+is set to indicate the error.
diff --git a/man/man3/attr_multi.3 b/man/man3/attr_multi.3
new file mode 100644
index 0000000..fd9107e
--- /dev/null
+++ b/man/man3/attr_multi.3
@@ -0,0 +1,279 @@
+.TH ATTR_MULTI 3
+.SH NAME
+attr_multi, attr_multif \- manipulate multiple user attributes on a filesystem object at once
+.SH C SYNOPSIS
+.PP
+.sp
+.nf
+.B #include <sys/attributes.h>
+.sp
+.B "int attr_multi (const char \(**path, attr_multiop_t \(**oplist, "
+.B " int count, int flags);"
+.PP
+.B "int attr_multif (int fd, attr_multiop_t \(**oplist, "
+.B " int count, int flags);"
+.Op
+.SH DESCRIPTION
+The
+.I attr_multi
+and
+.I attr_multif
+functions provide a way to operate on multiple attributes of a
+filesystem object at once.
+.P
+.I Path
+points to a path name for a filesystem object, and
+.I fd
+refers to the file descriptor associated with a file.
+The
+.I oplist
+is an array of \f4attr_multiop_t\fP structures.
+Each element in that array describes a single attribute operation
+and provides all the information required to carry out that operation
+and to check for success or failure of that operation.
+.I Count
+tells how many elements are in the
+.I oplist
+array.
+.PP
+.Op c p a
+The contents of an \f4attr_multiop_t\fP structure include
+the following members:
+.P
+.RS 3
+.nf
+.ft 4
+.ta 9n 22n
+int am_opcode; /* which operation to perform (see below) */
+int am_error; /* [out arg] result of this sub-op (an errno) */
+char *am_attrname; /* attribute name to work with */
+char *am_attrvalue; /* [in/out arg] attribute value (raw bytes) */
+int am_length; /* [in/out arg] length of value */
+int am_flags; /* flags (bit-wise OR of #defines below) */
+.ft 1
+.fi
+.RE
+.PP
+The
+.I am_opcode
+field defines how the remaining fields are to be interpreted
+and can take on one of the following values:
+.P
+.RS 3
+.nf
+.ft 4
+.ta 9n 22n
+ATTR_OP_GET /* return the indicated attr's value */
+ATTR_OP_SET /* set/create the indicated attr/value pair */
+ATTR_OP_REMOVE /* remove the indicated attr */
+.ft 1
+.fi
+.RE
+.PP
+The
+.I am_error
+field will contain the appropriate error result code
+if that sub-operation fails.
+The result codes for a given sub-operation are a subset of
+the result codes that are possible from the corresponding
+single-attribute function call.
+For example, the result code possible from an \f4ATTR_OP_GET\fP
+sub-operation are a subset of those that can be returned from an
+.I attr_get
+function call.
+.PP
+The
+.I am_attrname
+field is a pointer to a NULL terminated string giving the attribute name
+that the sub-operation should operate on.
+.PP
+The
+.I am_attrvalue,
+.I am_length
+and
+.I am_flags
+fields are used to store the value of the named attribute,
+and some control flags for that sub-operation, respectively.
+Their use varies depending on the value of the
+.I am_opcode
+field.
+.TP
+.SM
+.B \%ATTR_OP_GET
+The
+.I am_attrvalue
+field is a pointer to a empty buffer that will be overwritten
+with the value of the named attribute.
+The
+.I am_length
+field is initially the total size of the memory buffer that the
+.I am_attrvalue
+field points to.
+After the operation, the
+.I am_length
+field contains the actual size of the attribute\'s value.
+The
+.I am_flags
+field may be set to the \f4ATTR_ROOT\fP flag.
+If the process has appropriate priviledges,
+the ROOT namespace will be searched for the named attribute,
+otherwise the USER namespace will be searched.
+.TP
+.SM
+.B \%ATTR_OP_SET
+The
+.I am_attrvalue
+and
+.I am_length
+fields contain the new value for the given attribute name and its length.
+The \f4ATTR_ROOT\fP flag may be set in the
+.I am_flags
+field.
+If the process has appropriate priviledges,
+the ROOT namespace will be searched for the named attribute,
+otherwise the USER namespace will be searched.
+The \f4ATTR_CREATE\fP and the \f4ATTR_REPLACE\fP flags
+may also be set in the
+.I am_flags
+field (but not simultaneously).
+If the \f4ATTR_CREATE\fP flag is set,
+the sub-operation will set the
+.I am_error
+field to EEXIST if the named attribute already exists.
+If the \f4ATTR_REPLACE\fP flag is set,
+the sub-operation will set the
+.I am_error
+field to ENOATTR if the named attribute does not already exist.
+If neither of those two flags are set and the attribute does not exist,
+then the attribute will be created with the given value.
+If neither of those two flags are set and the attribute already exists,
+then the value will be replaced with the given value.
+.TP
+.SM
+.B \%ATTR_OP_REMOVE
+The
+.I am_attrvalue
+and
+.I am_length
+fields are not used and are ignored.
+The
+.I am_flags
+field may be set to the \f4ATTR_ROOT\fP flag.
+If the process has appropriate priviledges,
+the ROOT namespace will be searched for the named attribute,
+otherwise the USER namespace will be searched.
+.PP
+The
+.I flags
+argument to the
+.I attr_multi
+call is used to control following of symbolic links in the
+.I path
+argument.
+The default is to follow symbolic links,
+.I flags
+should be set to ATTR_DONTFOLLOW to not follow symbolic links.
+.PP
+.I attr_multi
+will fail if one or more of the following are true:
+.TP 17
+.SM
+\%[ENOENT]
+The named file does not exist.
+.TP
+.SM
+\%[EPERM]
+The effective user
+.SM ID
+does not match the owner of the file
+and the effective user
+.SM ID
+is not super-user.
+.TP
+.SM
+\%[ENOTDIR]
+A component of the
+path prefix
+is not a directory.
+.TP
+.SM
+\%[EACCES]
+Search permission is denied on a
+component of the
+path prefix.
+.TP
+.SM
+\%[EINVAL]
+A bit other than ATTR_DONTFOLLOW was set in the
+.I flag
+argument.
+.TP
+.SM
+\%[EFAULT]
+.I Path,
+or
+.I oplist
+points outside the allocated address space of the process.
+.TP
+.SM
+\%[ELOOP]
+A path name lookup involved too many symbolic links.
+.TP
+.SM
+\%[ENAMETOOLONG]
+The length of
+.I path
+exceeds
+.SM
+.RI { MAXPATHLEN },
+or a pathname component is longer than
+.SM
+.RI { MAXNAMELEN }.
+.PP
+.I attr_multif
+will fail if:
+.TP 15
+.SM
+\%[EINVAL]
+A bit was set in the
+.I flag
+argument, or
+.I fd\^
+refers to a socket, not a file.
+.TP
+.SM
+\%[EFAULT]
+.I Oplist
+points outside the allocated address space of the process.
+.TP
+.SM
+\%[EBADF]
+.I Fd\^
+does not refer to a valid descriptor.
+.SH "SEE ALSO"
+attr(1),
+.br
+attrctl(2),
+.br
+attr_get(3), attr_getf(3),
+.br
+attr_list(3), attr_list(3)
+.br
+attr_remove(3), attr_removef(3),
+.br
+attr_set(3), attr_set(3)
+.SH "DIAGNOSTICS"
+Upon successful completion of the
+.I attr_multi
+call, a value of 0 is returned.
+Otherwise, a value of \-1 is returned and
+.I errno
+is set to indicate the error.
+Note that the individual operations listed in the
+.I oplist
+array each have their own error return fields.
+The
+.I errno
+variable only records the result of the
+.I attr_multi
+call itself, not the result of any of the sub-operations.
diff --git a/man/man3/attr_remove.3 b/man/man3/attr_remove.3
new file mode 100644
index 0000000..66340dd
--- /dev/null
+++ b/man/man3/attr_remove.3
@@ -0,0 +1,155 @@
+.TH ATTR_REMOVE 3
+.SH NAME
+attr_remove, attr_removef \- remove a user attribute of a filesystem object
+.SH C SYNOPSIS
+.PP
+.sp
+.nf
+.B #include <sys/attributes.h>
+.sp
+.B "int attr_remove (const char \(**path, const char \(**attrname, int flags);"
+.PP
+.B "int attr_removef (int fd, const char \(**attrname, int flags);"
+.Op
+.SH DESCRIPTION
+The
+.I attr_remove
+and
+.I attr_removef
+functions provide a way to remove previously created attributes
+from filesystem objects.
+.P
+.I Path\^
+points to a path name for a filesystem object, and
+.I fd\^
+refers to the file descriptor associated with a file.
+If the attribute
+.I attrname
+exists, the attribute name and value will be removed from the
+fileystem object.
+The
+.I flags
+argument can contain the following symbols bitwise OR\'ed together:
+.TP
+.SM
+\%ATTR_ROOT
+Look for
+.I attrname
+in the
+.B root
+address space, not in the
+.B user
+address space.
+(limited to use by super-user only)
+.TP
+.SM
+\%ATTR_DONTFOLLOW
+Do not follow symbolic links when resolving a
+.I path
+on an
+.I attr_remove
+function call.
+The default is to follow symbolic links.
+.PP
+.I attr_remove
+will fail if one or more of the following are true:
+.TP 17
+.SM
+\%[ENOATTR]
+The attribute name given is not associated with the indicated
+filesystem object.
+.TP
+.SM
+\%[ENOENT]
+The named file does not exist.
+.TP
+.SM
+\%[EPERM]
+The effective user
+.SM ID
+does not match the owner of the file
+and the effective user
+.SM ID
+is not super-user.
+.TP
+.SM
+\%[ENOTDIR]
+A component of the
+path prefix
+is not a directory.
+.TP
+.SM
+\%[EACCES]
+Search permission is denied on a
+component of the
+path prefix.
+.TP
+.SM
+\%[EINVAL]
+A bit was set in the
+.I flag
+argument that is not defined for this system call.
+.TP
+.SM
+\%[EFAULT]
+.I Path
+points outside the allocated address space of the process.
+.TP
+.SM
+\%[ELOOP]
+A path name lookup involved too many symbolic links.
+.TP
+.SM
+\%[ENAMETOOLONG]
+The length of
+.I path
+exceeds
+.SM
+.RI { MAXPATHLEN },
+or a pathname component is longer than
+.SM
+.RI { MAXNAMELEN }.
+.PP
+.I attr_removef\^
+will fail if:
+.TP 15
+.SM
+\%[ENOATTR]
+The attribute name given is not associated with the indicated
+filesystem object.
+.TP
+.SM
+\%[EINVAL]
+A bit was set in the
+.I flag
+argument that is not defined for this system call,
+or
+.I fd\^
+refers to a socket, not a file.
+.TP
+.SM
+\%[EFAULT]
+.I Attrname
+points outside the allocated address space of the process.
+.TP
+.SM
+\%[EBADF]
+.I Fd\^
+does not refer to a valid descriptor.
+.SH "SEE ALSO"
+attr(1),
+.br
+attrctl(2),
+.br
+attr_get(3), attr_getf(3),
+.br
+attr_list(3), attr_listf(3)
+.br
+attr_multi(3), attr_multif(3)
+.br
+attr_set(3), attr_setf(3),
+.SH "DIAGNOSTICS"
+Upon successful completion, a value of 0 is returned.
+Otherwise, a value of \-1 is returned and
+.I errno\^
+is set to indicate the error.
diff --git a/man/man3/attr_set.3 b/man/man3/attr_set.3
new file mode 100644
index 0000000..c23c523
--- /dev/null
+++ b/man/man3/attr_set.3
@@ -0,0 +1,215 @@
+.TH ATTR_SET 3
+.SH NAME
+attr_set, attr_setf \- set the value of a user attribute of a filesystem object
+.SH C SYNOPSIS
+.PP
+.sp
+.nf
+.B #include <sys/attributes.h>
+.sp
+.B "int attr_set (const char \(**path, const char \(**attrname, "
+.B " const char \(**attrvalue, const int valuelength,"
+.B " int flags);"
+.PP
+.B "int attr_setf (int fd, const char \(**attrname, "
+.B " const char \(**attrvalue, const int valuelength,"
+.B " int flags);"
+.Op
+.SH DESCRIPTION
+The
+.I attr_set
+and
+.I attr_setf
+functions provide a way to create attributes and set/change their values.
+.P
+.I Path\^
+points to a path name for a filesystem object, and
+.I fd\^
+refers to the file descriptor associated with a file.
+If the attribute
+.I attrname
+does not exist, an attribute with the given name and value will be created
+and associated with that indicated filesystem object.
+If an attribute with that name already exists on that filesystem object,
+the existing value is replaced with the new value given in this call.
+The new attribute value is copied from the
+.I attrvalue
+buffer for a total of
+.I valuelength
+bytes.
+The
+.I flags
+argument can contain the following symbols bitwise OR\'ed together:
+.TP
+.SM
+\%ATTR_ROOT
+Look for
+.I attrname
+in the
+.B root
+address space, not in the
+.B user
+address space.
+(limited to use by super-user only)
+.TP
+.SM
+\%ATTR_DONTFOLLOW
+Do not follow symbolic links when resolving a
+.I path
+on an
+.I attr_set
+function call.
+The default is to follow symbolic links.
+.TP
+.SM
+\%ATTR_CREATE
+Return an error (EEXIST) if an attribute of the given name
+already exists on the indicated filesystem object,
+otherwise create an attribute with the given name and value.
+This flag is used to implement a pure create operation,
+without this flag
+.I attr_set
+will create the attribute if it does not already exist.
+An error (EINVAL) will be returned if both ATTR_CREATE and ATTR_REPLACE
+are set in the same call.
+.TP
+.SM
+\%ATTR_REPLACE
+Return an error (ENOATTR) if an attribute of the given name
+does not already exist on the indicated filesystem object,
+otherwise replace the existing attribute\'s value with the given value.
+This flag is used to implement a pure replacement operation,
+without this flag
+.I attr_set
+will create the attribute if it does not already exist.
+An error (EINVAL) will be returned if both ATTR_CREATE and ATTR_REPLACE
+are set in the same call.
+.PP
+.I attr_set
+will fail if one or more of the following are true:
+.TP 17
+.SM
+\%[ENOATTR]
+The attribute name given is not associated with the indicated
+filesystem object and the ATTR_REPLACE flag bit was set.
+.TP
+.SM
+\%[E2BIG]
+The value of the given attribute is too large, it exceeds the
+maximum allowable size of an attribute value.
+.TP
+.SM
+\%[EEXIST]
+The attribute name given is already associated with the indicated
+filesystem object and the ATTR_CREATE flag bit was set.
+.TP
+.SM
+\%[ENOENT]
+The named file does not exist.
+.TP
+.SM
+\%[EPERM]
+The effective user
+.SM ID
+does not match the owner of the file
+and the effective user
+.SM ID
+is not super-user.
+.TP
+.SM
+\%[ENOTDIR]
+A component of the
+path prefix
+is not a directory.
+.TP
+.SM
+\%[EACCES]
+Search permission is denied on a
+component of the
+path prefix.
+.TP
+.SM
+\%[EINVAL]
+A bit was set in the
+.I flag
+argument that is not defined for this system call,
+or both the ATTR_CREATE and ATTR_REPLACE flags bits were set.
+.TP
+.SM
+\%[EFAULT]
+.I Path,
+.I attrname,
+or
+.I attrvalue
+points outside the allocated address space of the process.
+.TP
+.SM
+\%[ELOOP]
+A path name lookup involved too many symbolic links.
+.TP
+.SM
+\%[ENAMETOOLONG]
+The length of
+.I path
+exceeds
+.SM
+.RI { MAXPATHLEN },
+or a pathname component is longer than
+.SM
+.RI { MAXNAMELEN }.
+.PP
+.I attr_setf\^
+will fail if:
+.TP 15
+.SM
+\%[ENOATTR]
+The attribute name given is not associated with the indicated
+filesystem object and the ATTR_REPLACE flag bit was set.
+.TP
+.SM
+\%[E2BIG]
+The value of the given attribute is too large, it exceeds the
+maximum allowable size of an attribute value.
+.TP
+.SM
+\%[EEXIST]
+The attribute name given is already associated with the indicated
+filesystem object and the ATTR_CREATE flag bit was set.
+.TP
+.SM
+\%[EINVAL]
+A bit was set in the
+.I flag
+argument that is not defined for this system call,
+or both the ATTR_CREATE and ATTR_REPLACE flags bits were set, or
+.I fd\^
+refers to a socket, not a file.
+.TP
+.SM
+\%[EFAULT]
+.I Attrname,
+or
+.I attrvalue
+points outside the allocated address space of the process.
+.TP
+.SM
+\%[EBADF]
+.I Fd\^
+does not refer to a valid descriptor.
+.SH "SEE ALSO"
+attr(1),
+.br
+attrctl(2),
+.br
+attr_get(3), attr_getf(3),
+.br
+attr_list(3), attr_listf(3)
+.br
+attr_multi(3), attr_multif(3)
+.br
+attr_remove(3), attr_removef(3),
+.SH "DIAGNOSTICS"
+Upon successful completion, a value of 0 is returned.
+Otherwise, a value of \-1 is returned and
+.I errno\^
+is set to indicate the error.