From: Nathan Scott Date: Thu, 17 Jun 2004 07:22:11 +0000 (+0000) Subject: Merge over several portability changes from xfstest update. X-Git-Tag: v2.7.0~94 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0211f6757a7811652b0083fe968a3017a529f03;p=thirdparty%2Fxfsprogs-dev.git Merge over several portability changes from xfstest update. --- diff --git a/VERSION b/VERSION index d822914ba..85dd2ad26 100644 --- a/VERSION +++ b/VERSION @@ -3,5 +3,5 @@ # PKG_MAJOR=2 PKG_MINOR=6 -PKG_REVISION=15 +PKG_REVISION=16 PKG_BUILD=1 diff --git a/aclocal.m4 b/aclocal.m4 index 138dbe628..7d07819ff 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -76,59 +76,69 @@ AC_DEFUN([AC_PACKAGE_NEED_UTILITY], # MSGFMT MSGMERGE RPM # AC_DEFUN([AC_PACKAGE_UTILITIES], - [ if test -z "$CC"; then - AC_PROG_CC - fi + [ AC_PROG_CC cc="$CC" AC_SUBST(cc) AC_PACKAGE_NEED_UTILITY($1, "$cc", cc, [C compiler]) if test -z "$MAKE"; then - AC_PATH_PROG(MAKE, make, /usr/bin/make) + AC_PATH_PROG(MAKE, gmake,, /usr/bin:/usr/freeware/bin) + fi + if test -z "$MAKE"; then + AC_PATH_PROG(MAKE, make,, /usr/bin) fi make=$MAKE AC_SUBST(make) AC_PACKAGE_NEED_UTILITY($1, "$make", make, [GNU make]) if test -z "$LIBTOOL"; then - AC_PATH_PROG(LIBTOOL, libtool,,/usr/bin:/usr/local/bin) + AC_PATH_PROG(LIBTOOL, glibtool,, /usr/bin) + fi + if test -z "$LIBTOOL"; then + AC_PATH_PROG(LIBTOOL, libtool,, /usr/bin:/usr/local/bin:/usr/freeware/bin) fi libtool=$LIBTOOL AC_SUBST(libtool) AC_PACKAGE_NEED_UTILITY($1, "$libtool", libtool, [GNU libtool]) if test -z "$TAR"; then - AC_PATH_PROG(TAR, tar) + AC_PATH_PROG(TAR, tar,, /usr/freeware/bin:/bin:/usr/local/bin:/usr/bin) fi tar=$TAR AC_SUBST(tar) if test -z "$ZIP"; then - AC_PATH_PROG(ZIP, gzip, /bin/gzip) + AC_PATH_PROG(ZIP, gzip,, /bin:/usr/local/bin:/usr/freeware/bin) fi + zip=$ZIP AC_SUBST(zip) + if test -z "$MAKEDEPEND"; then AC_PATH_PROG(MAKEDEPEND, makedepend, /bin/true) fi makedepend=$MAKEDEPEND AC_SUBST(makedepend) + if test -z "$AWK"; then - AC_PATH_PROG(AWK, awk, /bin/awk) + AC_PATH_PROG(AWK, awk,, /bin:/usr/bin) fi awk=$AWK AC_SUBST(awk) + if test -z "$SED"; then - AC_PATH_PROG(SED, sed, /bin/sed) + AC_PATH_PROG(SED, sed,, /bin:/usr/bin) fi sed=$SED AC_SUBST(sed) + if test -z "$ECHO"; then - AC_PATH_PROG(ECHO, echo, /bin/echo) + AC_PATH_PROG(ECHO, echo,, /bin:/usr/bin) fi echo=$ECHO AC_SUBST(echo) + if test -z "$SORT"; then - AC_PATH_PROG(SORT, sort, /bin/sort) + AC_PATH_PROG(SORT, sort,, /bin:/usr/bin) fi sort=$SORT AC_SUBST(sort) @@ -138,13 +148,14 @@ AC_DEFUN([AC_PACKAGE_UTILITIES], if test "$enable_gettext" = yes; then if test -z "$MSGFMT"; then - AC_CHECK_PROG(MSGFMT, msgfmt, /usr/bin/msgfmt) + AC_PATH_PROG(MSGFMT, msgfmt,, /usr/bin:/usr/freeware/bin) fi msgfmt=$MSGFMT AC_SUBST(msgfmt) AC_PACKAGE_NEED_UTILITY($1, "$msgfmt", msgfmt, gettext) + if test -z "$MSGMERGE"; then - AC_CHECK_PROG(MSGMERGE, msgmerge, /usr/bin/msgmerge) + AC_PATH_PROG(MSGMERGE, msgmerge,, /usr/bin:/usr/freeware/bin) fi msgmerge=$MSGMERGE AC_SUBST(msgmerge) @@ -152,10 +163,11 @@ AC_DEFUN([AC_PACKAGE_UTILITIES], fi if test -z "$RPM"; then - AC_PATH_PROG(RPM, rpm, /bin/rpm) + AC_PATH_PROG(RPM, rpm,, /bin:/usr/freeware/bin) fi rpm=$RPM AC_SUBST(rpm) + dnl .. and what version is rpm rpm_version=0 test -x $RPM && rpm_version=`$RPM --version \ @@ -174,13 +186,14 @@ AC_DEFUN([AC_PACKAGE_UTILITIES], ]) AC_DEFUN([AC_PACKAGE_NEED_UUID_H], - [ AC_CHECK_HEADERS(uuid.h) - if test $ac_cv_header_uuid_h = no; then - AC_CHECK_HEADERS(uuid/uuid.h,, [ + [ AC_CHECK_HEADERS([uuid.h sys/uuid.h uuid/uuid.h]) + if test $ac_cv_header_uuid_h = no -a \ + $ac_cv_header_sys_uuid_h = no -a \ + $ac_cv_header_uuid_uuid_h = no; then echo echo 'FATAL ERROR: could not find a valid UUID header.' echo 'Install the Universally Unique Identifiers development package.' - exit 1]) + exit 1 fi ]) diff --git a/db/command.c b/db/command.c index 0571101e4..a1f02ceb8 100644 --- a/db/command.c +++ b/db/command.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2000-2001,2004 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 @@ -105,7 +105,7 @@ command( dbprintf(" arguments\n"); return 0; } - optind = 0; + platform_getoptreset(); return ct->cfunc(argc, argv); } diff --git a/debian/changelog b/debian/changelog index e37313014..a43290fbb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +xfsprogs (2.6.16-1) unstable; urgency=low + + * New upstream release. + + -- Nathan Scott Thu, 17 Jun 2004 15:16:25 +1000 + xfsprogs (2.6.15-1) unstable; urgency=low * New upstream release. diff --git a/doc/CHANGES b/doc/CHANGES index 841c2944b..4a81b460d 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -1,3 +1,14 @@ +xfsprogs-2.6.16 (17 June 2004) + - Add sendfile command into xfs_io(8) to exercise that + functionality. + - Remove maxtrres program that was used in the build + to generate a header for mkfs' consumption. + - This allows cross-compiles to be greatly simplified. + - Portability tweaks for building on other platforms. + - Fix obscure bug in log size lower boundary checks for + auto-sized logs when stripe alignment is in effect; + the enforced lower bound could have been set too low. + xfsprogs-2.6.15 (09 June 2004) - Make xfs_check test for a dirty log before proceeding to check the filesystem. diff --git a/include/Makefile b/include/Makefile index 7e0ed581b..aeb54188c 100644 --- a/include/Makefile +++ b/include/Makefile @@ -44,8 +44,11 @@ HFILES = handle.h jdm.h libxfs.h libxlog.h swab.h xqm.h \ xfs_log.h xfs_log_priv.h xfs_log_recover.h xfs_mount.h xfs_quota.h \ xfs_rtalloc.h xfs_sb.h xfs_trans.h xfs_trans_space.h xfs_types.h +HFILES += $(PKG_PLATFORM).c +PHFILES = darwin.h freebsd.h irix.h linux.h DKHFILES = volume.h fstyp.h dvh.h -LSRCFILES = platform_defs.h.in builddefs.in buildmacros buildrules $(DKHFILES) +LSRCFILES = $(shell echo $(PHFILES) | sed -e "s/$(PKG_PLATFORM).c//g") +LSRCFILES += platform_defs.h.in builddefs.in buildmacros buildrules $(DKHFILES) LDIRT = xfs disk default install : diff --git a/include/darwin.h b/include/darwin.h new file mode 100644 index 000000000..887d0e949 --- /dev/null +++ b/include/darwin.h @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2004 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 __XFS_DARWIN_H__ +#define __XFS_DARWIN_H__ + +#include +#include +#include +#include +#include +#include + +#include +# ifndef SYS_fsctl +# define SYS_fsctl 242 +# endif +static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p) +{ + return syscall(SYS_fsctl, path, cmd, p, 0); +} + +static __inline__ int platform_test_xfs_fd(int fd) +{ + struct statfs buf; + if (fstatfs(fd, &buf) < 0) + return 0; + return (strcmp(buf.f_fstypename, "xfs") == 0); +} + +static __inline__ int platform_test_xfs_path(const char *path) +{ + struct statfs buf; + if (statfs(path, &buf) < 0) + return 0; + return (strcmp(buf.f_fstypename, "xfs") == 0); +} + +static __inline__ int platform_fstatfs(int fd, struct statfs *buf) +{ + return fstatfs(fd, buf); +} + +static __inline__ void platform_getoptreset(void) +{ + extern int optreset; + optreset = 0; +} + +#define __int8_t int8_t +#define __int16_t int16_t +#define __int32_t int32_t +#define __int32_t int32_t +#define __int64_t int64_t +#define __uint8_t u_int8_t +#define __uint16_t u_int16_t +#define __uint32_t u_int32_t +#define __uint64_t u_int64_t +#define __s8 int8_t +#define __s16 int16_t +#define __s32 int32_t +#define __s64 int64_t +#define __u8 u_int8_t +#define __u16 u_int16_t +#define __u32 u_int32_t +#define __u64 u_int64_t +#define loff_t off_t +#define off64_t off_t + +typedef off_t xfs_off_t; +typedef u_int64_t xfs_ino_t; +typedef u_int32_t xfs_dev_t; +typedef int64_t xfs_daddr_t; +typedef char* xfs_caddr_t; + +typedef unsigned char uchar_t; +#define stat64 stat +#define fstat64 fstat +#define lseek64 lseek +#define pread64 pread +#define pwrite64 pwrite +#define ftruncate64 ftruncate +#define fdatasync fsync +#define memalign(a,sz) valloc(sz) + +#include +#define __BYTE_ORDER BYTE_ORDER +#define __BIG_ENDIAN BIG_ENDIAN +#define __LITTLE_ENDIAN LITTLE_ENDIAN +#include + +#define O_LARGEFILE 0 +#ifndef O_DIRECT +#define O_DIRECT 0 +#endif +#ifndef O_SYNC +#define O_SYNC 0 +#endif + +#define B_FALSE 0 +#define B_TRUE 1 + +#define ENOATTR 989 /* Attribute not found */ +#define EFSCORRUPTED 990 /* Filesystem is corrupted */ +#define constpp char * const * + +#define HAVE_FID 1 + +#endif /* __XFS_DARWIN_H__ */ diff --git a/include/freebsd.h b/include/freebsd.h new file mode 100644 index 000000000..56daf5c3e --- /dev/null +++ b/include/freebsd.h @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2004 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 __XFS_FREEBSD_H__ +#define __XFS_FREEBSD_H__ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/* FreeBSD file API is 64-bit aware */ +#define fstat64 fstat +#define ftruncate64 ftruncate +#define lseek64 lseek +#define stat64 stat +#define pwrite64 pwrite +#define pread64 pread +#define fdatasync fsync +#define memalign(a,size) valloc(size) + +typedef u_int8_t __u8; +typedef int8_t __s8; +typedef u_int16_t __u16; +typedef int16_t __s16; +typedef u_int32_t __u32; +typedef int32_t __s32; +typedef u_int64_t __u64; +typedef int64_t __s64; + +#define constpp char * const * + +#define EFSCORRUPTED 990 /* Filesystem is corrupted */ + +typedef off_t xfs_off_t; +typedef off_t off64_t; +typedef __uint64_t xfs_ino_t; +typedef __uint32_t xfs_dev_t; +typedef __int64_t xfs_daddr_t; +typedef char* xfs_caddr_t; +typedef off_t loff_t; + +#ifndef _UCHAR_T_DEFINED +typedef unsigned char uchar_t; +#define _UCHAR_T_DEFINED 1 +#endif +typedef enum { B_FALSE,B_TRUE } boolean_t; + +#define O_LARGEFILE 0 + +#define HAVE_FID 1 +#define HAVE_SWABMACROS 1 +#define INT_SWAP16(type,var) ((typeof(type))(__bswap16((__u16)(var)))) +#define INT_SWAP32(type,var) ((typeof(type))(__bswap32((__u32)(var)))) +#define INT_SWAP64(type,var) ((typeof(type))(__bswap64((__u64)(var)))) + +static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p) +{ + return ioctl(fd, cmd, p); +} + +static __inline__ int platform_test_xfs_fd(int fd) +{ + struct statfs buf; + if (fstatfs(fd, &buf) < 0) + return 0; + return strcpy(buf.f_fstypename, "xfs") == 0; +} + +static __inline__ int platform_test_xfs_path(const char *path) +{ + struct statfs buf; + if (statfs(path, &buf) < 0) + return 0; + return strcpy(buf.f_fstypename, "xfs") == 0; +} + +static __inline__ int platform_fstatfs(int fd, struct statfs *buf) +{ + return fstatfs(fd, buf); +} + +static __inline__ void platform_getoptreset(void) +{ + extern int optind; + optind = 0; +} + +/* + * Implement Linux libuuid functions in terms of DEC DCE's uuid + * functions from FreeBSD libc. + */ + +static __inline__ int gnu_uuid_compare(uuid_t a, uuid_t b) +{ + return uuid_compare(&a, &b, NULL); +} +#define uuid_compare gnu_uuid_compare + +static __inline__ int uuid_is_null(uuid_t uid) +{ + return uuid_is_nil(&uid, NULL); +} + +static __inline__ void uuid_unparse(uuid_t uid, char *buf) +{ + uint32_t status; + char *str; + uuid_to_string(&uid, &str, &status); + if (status == uuid_s_ok) + strcpy(buf, str); + else *buf = '\0'; + free(str); +} + +static __inline__ int gnu_uuid_parse(const char *buf, uuid_t *uid) +{ + uint32_t status; + uuid_from_string(buf, uid, &status); + return (status == uuid_s_ok); +} +#define uuid_parse(s,u) gnu_uuid_parse((s), &(u)) + +#define uuid_generate(uid) uuid_create(&(uid), NULL) +#define uuid_clear(uid) uuid_create_nil(&(uid), NULL) +#define uuid_copy(dst, src) memcpy(&(dst), &(src), sizeof(uuid_t)) + +#endif /* __XFS_FREEBSD_H__ */ diff --git a/include/irix.h b/include/irix.h new file mode 100644 index 000000000..732dadc8d --- /dev/null +++ b/include/irix.h @@ -0,0 +1,191 @@ +/* + * Copyright (c) 2000-2004 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 __XFS_IRIX_H__ +#define __XFS_IRIX_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include + +#define __s8 char +#define __s16 short +#define __s32 __int32_t +#define __s64 __int64_t +#define __u8 unsigned char +#define __u16 unsigned short +#define __u32 __int32_t +#define __u64 __int64_t +#define __int8_t char +#define __int16_t short +#define __uint8_t unsigned char +#define __uint16_t unsigned short +#define loff_t off64_t +typedef off64_t xfs_off_t; +typedef __int64_t xfs_ino_t; +typedef __int32_t xfs_dev_t; +typedef __int64_t xfs_daddr_t; +typedef char* xfs_caddr_t; +typedef flock64_t xfs_flock64_t; + +#include +#define __BYTE_ORDER BYTE_ORDER +#define __BIG_ENDIAN BIG_ENDIAN +#define __LITTLE_ENDIAN LITTLE_ENDIAN +#include + +#define INT_MAX INT32_MAX +#define UINT_MAX UINT32_MAX +#define PATH_MAX MAXPATHLEN +#define constpp char * const * +#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY))) + +static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p) +{ + if (cmd >= 0 && cmd < XFS_FSOPS_COUNT) + return syssgi(SGI_XFS_FSOPERATIONS, fd, cmd, (void *)0, p); + return fcntl(fd, cmd, p); +} + +static __inline__ int platform_test_xfs_fd(int fd) +{ + struct statvfs sbuf; + if (fstatvfs(fd, &sbuf) < 0) + return 0; + return (strcmp(sbuf.f_basetype, "xfs") == 0); +} + +static __inline__ int platform_test_xfs_path(const char *path) +{ + struct statvfs sbuf; + if (statvfs(path, &sbuf) < 0) + return 0; + return (strcmp(sbuf.f_basetype, "xfs") == 0); +} + +static __inline__ int platform_fstatfs(int fd, struct statfs *buf) +{ + return fstatfs(fd, buf, sizeof(struct statfs), 0); +} + +static __inline__ void platform_getoptreset(void) +{ + getoptreset(); +} + +static __inline__ char * strsep(char **s, const char *ct) +{ + char *sbegin = *s, *end; + + if (!sbegin) + return NULL; + end = strpbrk(sbegin, ct); + if (end) + *end++ = '\0'; + *s = end; + return sbegin; +} + +#define HAVE_DIOATTR 1 +#define HAVE_FSXATTR 1 +#define HAVE_GETBMAP 1 +#define HAVE_GETBMAPX 1 +#define HAVE_FSDMIDATA 1 +#define HAVE_FID 1 +#define HAVE_IOCMACROS 1 +#define HAVE_BBMACROS 1 + +#define __XFS_FS_H__ + +#define XFS_IOC_DIOINFO F_DIOINFO +#define XFS_IOC_FSGETXATTR F_FSGETXATTR +#define XFS_IOC_FSSETXATTR F_FSSETXATTR +#define XFS_IOC_ALLOCSP64 F_ALLOCSP64 +#define XFS_IOC_FREESP64 F_FREESP64 +#define XFS_IOC_GETBMAP F_GETBMAP +#define XFS_IOC_FSSETDM F_FSSETDM +#define XFS_IOC_RESVSP64 F_RESVSP64 +#define XFS_IOC_UNRESVSP64 F_UNRESVSP64 +#define XFS_IOC_GETBMAPA F_GETBMAPA +#define XFS_IOC_FSGETXATTRA F_FSGETXATTRA +#define XFS_IOC_GETBMAPX F_GETBMAPX + +#define XFS_IOC_FSGEOMETRY_V1 XFS_FS_GEOMETRY +#define XFS_IOC_FSBULKSTAT /* TODO */ +#define XFS_IOC_FSBULKSTAT_SINGLE /* TODO */ +#define XFS_IOC_FSINUMBERS /* TODO */ +#define XFS_IOC_PATH_TO_FSHANDLE /* TODO */ +#define XFS_IOC_PATH_TO_HANDLE /* TODO */ +#define XFS_IOC_FD_TO_HANDLE /* TODO */ +#define XFS_IOC_OPEN_BY_HANDLE /* TODO */ +#define XFS_IOC_READLINK_BY_HANDLE /* TODO */ +#define XFS_IOC_SWAPEXT /* TODO */ +#define XFS_IOC_FSGROWFSDATA XFS_GROWFS_DATA +#define XFS_IOC_FSGROWFSLOG XFS_GROWFS_LOG +#define XFS_IOC_FSGROWFSRT XFS_GROWFS_RT +#define XFS_IOC_FSCOUNTS XFS_FS_COUNTS +#define XFS_IOC_SET_RESBLKS XFS_SET_RESBLKS +#define XFS_IOC_GET_RESBLKS XFS_GET_RESBLKS +#define XFS_IOC_ERROR_INJECTION /* TODO */ +#define XFS_IOC_ERROR_CLEARALL /* TODO */ +#define XFS_IOC_FREEZE XFS_FS_FREEZE +#define XFS_IOC_THAW XFS_FS_THAW +#define XFS_IOC_FSSETDM_BY_HANDLE /* TODO */ +#define XFS_IOC_ATTRLIST_BY_HANDLE /* TODO */ +#define XFS_IOC_ATTRMULTI_BY_HANDLE /* TODO */ +#define XFS_IOC_FSGEOMETRY XFS_FS_GEOMETRY +#define XFS_IOC_GOINGDOWN XFS_FS_GOINGDOWN + +#define XFS_XFLAG_REALTIME 0x00000001 /* data in realtime volume */ +#define XFS_XFLAG_PREALLOC 0x00000002 /* preallocated file extents */ +#define XFS_XFLAG_IMMUTABLE 0x00000008 /* file cannot be modified */ +#define XFS_XFLAG_APPEND 0x00000010 /* all writes append */ +#define XFS_XFLAG_SYNC 0x00000020 /* all writes synchronous */ +#define XFS_XFLAG_NOATIME 0x00000040 /* do not update access time */ +#define XFS_XFLAG_NODUMP 0x00000080 /* do not include in backups */ +#define XFS_XFLAG_RTINHERIT 0x00000100 /* new files have rt bit set */ +#define XFS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ + + +#endif /* __XFS_IRIX_H__ */ diff --git a/include/linux.h b/include/linux.h new file mode 100644 index 000000000..5da858622 --- /dev/null +++ b/include/linux.h @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2004 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 __XFS_LINUX_H__ +#define __XFS_LINUX_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p) +{ + return ioctl(fd, cmd, p); +} + +static __inline__ int platform_test_xfs_fd(int fd) +{ + struct statfs buf; + if (fstatfs(fd, &buf) < 0) + return 0; + return (buf.f_type == 0x58465342); /* XFSB */ +} + +static __inline__ int platform_test_xfs_path(const char *path) +{ + struct statfs buf; + if (statfs(path, &buf) < 0) + return 0; + return (buf.f_type == 0x58465342); /* XFSB */ +} + +static __inline__ int platform_fstatfs(int fd, struct statfs *buf) +{ + return fstatfs(fd, buf); +} + +static __inline__ void platform_getoptreset(void) +{ + extern int optind; + optind = 0; +} + +#ifndef O_DIRECT +# if defined (__powerpc__) +# define O_DIRECT 0400000 +# elif defined (__sparc__) +# define O_DIRECT 0x100000 +# endif +#endif + +#if (__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ <= 1)) +# define constpp const char * const * +#else +# define constpp char * const * +#endif + +#define ENOATTR ENODATA /* Attribute not found */ +#define EFSCORRUPTED 990 /* Filesystem is corrupted */ + +typedef loff_t xfs_off_t; +typedef __uint64_t xfs_ino_t; +typedef __uint32_t xfs_dev_t; +typedef __int64_t xfs_daddr_t; +typedef char* xfs_caddr_t; + +#ifndef _UCHAR_T_DEFINED +typedef unsigned char uchar_t; +#define _UCHAR_T_DEFINED 1 +#endif + +#ifndef _BOOLEAN_T_DEFINED +typedef enum {B_FALSE, B_TRUE} boolean_t; +#define _BOOLEAN_T_DEFINED 1 +#endif + +#endif /* __XFS_IRIX_H__ */ diff --git a/include/platform_defs.h.in b/include/platform_defs.h.in index 3fa49789c..d8210405a 100644 --- a/include/platform_defs.h.in +++ b/include/platform_defs.h.in @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2000-2004 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 @@ -47,393 +47,13 @@ #if defined(__linux__) - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p) -{ - return ioctl(fd, cmd, p); -} - -static __inline__ int platform_test_xfs_fd(int fd) -{ - struct statfs buf; - if (fstatfs(fd, &buf) < 0) - return 0; - return (buf.f_type == 0x58465342); /* XFSB */ -} - -static __inline__ int platform_test_xfs_path(const char *path) -{ - struct statfs buf; - if (statfs(path, &buf) < 0) - return 0; - return (buf.f_type == 0x58465342); /* XFSB */ -} - -static __inline__ int platform_fstatfs(int fd, struct statfs *buf) -{ - return fstatfs(fd, buf); -} - -#ifndef O_DIRECT -# if defined (__powerpc__) -# define O_DIRECT 0400000 -# elif defined (__sparc__) -# define O_DIRECT 0x100000 -# endif -#endif - -#if (__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ <= 1)) -# define constpp const char * const * -#else -# define constpp char * const * -#endif - -#define ENOATTR ENODATA /* Attribute not found */ -#define EFSCORRUPTED 990 /* Filesystem is corrupted */ - -typedef loff_t xfs_off_t; -typedef __uint64_t xfs_ino_t; -typedef __uint32_t xfs_dev_t; -typedef __int64_t xfs_daddr_t; -typedef char* xfs_caddr_t; - -#ifndef _UCHAR_T_DEFINED -typedef unsigned char uchar_t; -#define _UCHAR_T_DEFINED 1 -#endif - -#ifndef _BOOLEAN_T_DEFINED -typedef enum {B_FALSE, B_TRUE} boolean_t; -#define _BOOLEAN_T_DEFINED 1 -#endif - +#include #elif defined(__FreeBSD__) - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -/* FreeBSD file API is 64-bit aware */ -#define fstat64 fstat -#define ftruncate64 ftruncate -#define lseek64 lseek -#define stat64 stat -#define pwrite64 pwrite -#define pread64 pread -#define fdatasync fsync -#define memalign(a,size) valloc(size) - -typedef u_int8_t __u8; -typedef int8_t __s8; -typedef u_int16_t __u16; -typedef int16_t __s16; -typedef u_int32_t __u32; -typedef int32_t __s32; -typedef u_int64_t __u64; -typedef int64_t __s64; - -#define constpp char * const * - -#define EFSCORRUPTED 990 /* Filesystem is corrupted */ - -typedef off_t xfs_off_t; -typedef off_t off64_t; -typedef __uint64_t xfs_ino_t; -typedef __uint32_t xfs_dev_t; -typedef __int64_t xfs_daddr_t; -typedef char* xfs_caddr_t; -typedef off_t loff_t; - -#ifndef _UCHAR_T_DEFINED -typedef unsigned char uchar_t; -#define _UCHAR_T_DEFINED 1 -#endif -typedef enum { B_FALSE,B_TRUE } boolean_t; - -#define O_LARGEFILE 0 - -#define HAVE_FID 1 -#define HAVE_SWABMACROS 1 -#define INT_SWAP16(type,var) ((typeof(type))(__bswap16((__u16)(var)))) -#define INT_SWAP32(type,var) ((typeof(type))(__bswap32((__u32)(var)))) -#define INT_SWAP64(type,var) ((typeof(type))(__bswap64((__u64)(var)))) - -static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p) -{ - return ioctl(fd, cmd, p); -} - -static __inline__ int platform_test_xfs_fd(int fd) -{ - struct statfs buf; - if (fstatfs(fd, &buf) < 0) - return 0; - return strcpy(buf.f_fstypename, "xfs") == 0; -} - -static __inline__ int platform_test_xfs_path(const char *path) -{ - struct statfs buf; - if (statfs(path, &buf) < 0) - return 0; - return strcpy(buf.f_fstypename, "xfs") == 0; -} - -static __inline__ int platform_fstatfs(int fd, struct statfs *buf) -{ - return fstatfs(fd, buf); -} - -/* - * Implement Linux libuuid functions in terms of DEC DCE's uuid - * functions from FreeBSD libc. - */ - -static __inline__ int gnu_uuid_compare(uuid_t a, uuid_t b) -{ - return uuid_compare(&a, &b, NULL); -} -#define uuid_compare gnu_uuid_compare - -static __inline__ int uuid_is_null(uuid_t uid) -{ - return uuid_is_nil(&uid, NULL); -} - -static __inline__ void uuid_unparse(uuid_t uid, char *buf) -{ - uint32_t status; - char *str; - uuid_to_string(&uid, &str, &status); - if (status == uuid_s_ok) - strcpy(buf, str); - else *buf = '\0'; - free(str); -} - -static __inline__ int gnu_uuid_parse(const char *buf, uuid_t *uid) -{ - uint32_t status; - uuid_from_string(buf, uid, &status); - return (status == uuid_s_ok); -} -#define uuid_parse(s,u) gnu_uuid_parse((s), &(u)) - -#define uuid_generate(uid) uuid_create(&(uid), NULL) -#define uuid_clear(uid) uuid_create_nil(&(uid), NULL) -#define uuid_copy(dst, src) memcpy(&(dst), &(src), sizeof(uuid_t)) - -#elif defined(__APPLE__) /* Darwin */ -#include -#include -#include -#include -#include -#include - -#include -# ifndef SYS_fsctl -# define SYS_fsctl 242 -# endif -static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p) -{ - return syscall(SYS_fsctl, path, cmd, p, 0); -} - -static __inline__ int platform_test_xfs_fd(int fd) -{ - struct statfs buf; - if (fstatfs(fd, &buf) < 0) - return 0; - return (strcmp(buf.f_fstypename, "xfs") == 0); -} - -static __inline__ int platform_test_xfs_path(const char *path) -{ - struct statfs buf; - if (statfs(path, &buf) < 0) - return 0; - return (strcmp(buf.f_fstypename, "xfs") == 0); -} - -static __inline__ int platform_fstatfs(int fd, struct statfs *buf) -{ - return fstatfs(fd, buf); -} - -#define __int8_t int8_t -#define __int16_t int16_t -#define __int32_t int32_t -#define __int32_t int32_t -#define __int64_t int64_t -#define __uint8_t u_int8_t -#define __uint16_t u_int16_t -#define __uint32_t u_int32_t -#define __uint64_t u_int64_t -#define __s8 int8_t -#define __s16 int16_t -#define __s32 int32_t -#define __s64 int64_t -#define __u8 u_int8_t -#define __u16 u_int16_t -#define __u32 u_int32_t -#define __u64 u_int64_t -#define loff_t off_t -#define off64_t off_t - -typedef off_t xfs_off_t; -typedef u_int64_t xfs_ino_t; -typedef u_int32_t xfs_dev_t; -typedef int64_t xfs_daddr_t; -typedef char* xfs_caddr_t; - -typedef unsigned char uchar_t; -#define stat64 stat -#define fstat64 fstat -#define lseek64 lseek -#define pread64 pread -#define pwrite64 pwrite -#define ftruncate64 ftruncate -#define fdatasync fsync -#define memalign(a,sz) valloc(sz) - -#include -#define __BYTE_ORDER BYTE_ORDER -#define __BIG_ENDIAN BIG_ENDIAN -#define __LITTLE_ENDIAN LITTLE_ENDIAN -#include - -#define O_LARGEFILE 0 -#ifndef O_DIRECT -#define O_DIRECT 0 -#endif -#ifndef O_SYNC -#define O_SYNC 0 -#endif - -#define B_FALSE 0 -#define B_TRUE 1 - -#define ENOATTR 989 /* Attribute not found */ -#define EFSCORRUPTED 990 /* Filesystem is corrupted */ -#define constpp char * const * - -#define HAVE_FID 1 - -#elif defined(__sgi__) /* SGI IRIX */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define __s8 char -#define __s16 short -#define __s32 __int32_t -#define __s64 __int64_t -#define __u8 unsigned char -#define __u16 unsigned short -#define __u32 __int32_t -#define __u64 __int64_t -#define __int8_t char -#define __int16_t short -#define __uint8_t unsigned char -#define __uint16_t unsigned short -#define loff_t off64_t -typedef off64_t xfs_off_t; -typedef __int64_t xfs_ino_t; -typedef __int32_t xfs_dev_t; -typedef __int64_t xfs_daddr_t; -typedef char* xfs_caddr_t; - -#include -#define __BYTE_ORDER BYTE_ORDER -#define __BIG_ENDIAN BIG_ENDIAN -#define __LITTLE_ENDIAN LITTLE_ENDIAN -#include - -#define INT_MAX INT32_MAX -#define UINT_MAX UINT32_MAX -#define PATH_MAX MAXPATHLEN -#define constpp char * const * -#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY))) - -static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p) -{ - fprintf(stderr, "%s: line %d syssgi/fcntl mapping not implemented\n", - __FILE__, __LINE__); - errno = ENOSYS; - return -1; -} - -static __inline__ int platform_test_xfs_fd(int fd) -{ - struct statvfs sbuf; - if (fstatvfs(fd, &sbuf) < 0) - return 0; - return (strcmp(sbuf.f_basetype, "xfs") == 0); -} - -static __inline__ int platform_test_xfs_path(const char *path) -{ - struct statvfs sbuf; - if (statvfs(path, &sbuf) < 0) - return 0; - return (strcmp(sbuf.f_basetype, "xfs") == 0); -} - -static __inline__ int platform_fstatfs(int fd, struct statfs *buf) -{ - return fstatfs(fd, buf, sizeof(struct statfs), 0); -} - -static __inline__ char * strsep(char **s, const char *ct) -{ - char *sbegin = *s, *end; - - if (!sbegin) - return NULL; - end = strpbrk(sbegin, ct); - if (end) - *end++ = '\0'; - *s = end; - return sbegin; -} - -#define HAVE_DIOATTR 1 -#define HAVE_FSXATTR 1 -#define HAVE_GETBMAP 1 -#define HAVE_GETBMAPX 1 -#define HAVE_FSDMIDATA 1 -#define HAVE_FID 1 -#define HAVE_BBMACROS 1 - - +#include +#elif defined(__APPLE__) +#include +#elif defined(__sgi__) +#include #else # error unknown platform... have fun porting! #endif diff --git a/include/xfs_fs.h b/include/xfs_fs.h index 1ed650e90..8b7b3ebc9 100644 --- a/include/xfs_fs.h +++ b/include/xfs_fs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995-2003 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 1995-2004 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.1 of the GNU Lesser General Public License @@ -444,6 +444,7 @@ typedef struct xfs_handle { #define XFS_FSOP_GOING_FLAGS_LOGFLUSH 0x1 /* flush log but not data */ #define XFS_FSOP_GOING_FLAGS_NOLOGFLUSH 0x2 /* don't flush log nor data */ +#ifndef HAVE_IOCMACROS /* * ioctl commands that replace IRIX fcntl()'s * For 'documentation' purposed more than anything else, @@ -498,7 +499,7 @@ typedef struct xfs_handle { #define XFS_IOC_FSGEOMETRY _IOR ('X', 124, struct xfs_fsop_geom) #define XFS_IOC_GOINGDOWN _IOR ('X', 125, __uint32_t) /* XFS_IOC_GETFSUUID ---------- deprecated 140 */ - +#endif #ifndef HAVE_BBMACROS /* diff --git a/io/Makefile b/io/Makefile index dd637fff3..da5d69eab 100644 --- a/io/Makefile +++ b/io/Makefile @@ -37,15 +37,22 @@ LTCOMMAND = xfs_io LSRCFILES = xfs_bmap.sh xfs_freeze.sh HFILES = command.h input.h init.h io.h CFILES = command.c input.c init.c \ - bmap.c file.c freeze.c fsync.c help.c inject.c \ + bmap.c file.c freeze.c fsync.c help.c \ mmap.c open.c pread.c prealloc.c pwrite.c quit.c \ - resblks.c shutdown.c truncate.c + truncate.c ifeq ($(PKG_PLATFORM),linux) -CFILES += fadvise.c -LCFLAGS += -DHAVE_FADVISE +CFILES += fadvise.c sendfile.c +LCFLAGS += -DHAVE_FADVISE -DHAVE_SENDFILE else -LSRCFILES += fadvise.c +LSRCFILES += fadvise.c sendfile.c +endif + +ifneq ($(PKG_PLATFORM),irix) +CFILES += inject.c resblks.c shutdown.c +LCFLAGS += -DHAVE_INJECT -DHAVE_RESBLKS -DHAVE_SHUTDOWN +else +LSRCFILES += inject.c resblks.c shutdown.c endif ifeq ($(ENABLE_READLINE),yes) diff --git a/io/bmap.c b/io/bmap.c index 1fa5060f7..75fc32e9d 100644 --- a/io/bmap.c +++ b/io/bmap.c @@ -81,7 +81,7 @@ bmap_f( { struct fsxattr fsx; struct getbmapx *map; - struct xfs_fsop_geom_v1 fsgeo; + struct xfs_fsop_geom fsgeo; int map_size; int loop = 0; int flg = 0; diff --git a/io/command.c b/io/command.c index 2b89807b4..9370d5583 100644 --- a/io/command.c +++ b/io/command.c @@ -106,7 +106,7 @@ command( argc-1, cmd, ct->argmin, ct->argmax); return 0; } - optind = 0; + platform_getoptreset(); return ct->cfunc(argc, argv); } @@ -141,6 +141,7 @@ init_commands(void) pwrite_init(); quit_init(); resblks_init(); + sendfile_init(); shutdown_init(); truncate_init(); } diff --git a/io/command.h b/io/command.h index 7562af1d9..4f331560a 100644 --- a/io/command.h +++ b/io/command.h @@ -62,11 +62,6 @@ extern const cmdinfo_t *find_command(const char *cmd); extern void init_commands(void); extern void bmap_init(void); -#ifdef HAVE_FADVISE -extern void fadvise_init(void); -#else -# define fadvise_init() do { } while (0) -#endif extern void file_init(void); extern void freeze_init(void); extern void fsync_init(void); @@ -78,7 +73,34 @@ extern void pread_init(void); extern void prealloc_init(void); extern void pwrite_init(void); extern void quit_init(void); -extern void resblks_init(void); -extern void shutdown_init(void); extern void truncate_init(void); +#ifdef HAVE_FADVISE +extern void fadvise_init(void); +#else +#define fadvise_init() do { } while (0) +#endif + +#ifdef HAVE_INJECT +extern void inject_init(void); +#else +#define inject_init() do { } while (0) +#endif + +#ifdef HAVE_RESBLKS +extern void resblks_init(void); +#else +#define resblks_init() do { } while (0) +#endif + +#ifdef HAVE_SENDFILE +extern void sendfile_init(void); +#else +#define sendfile_init() do { } while (0) +#endif + +#ifdef HAVE_SHUTDOWN +extern void shutdown_init(void); +#else +#define shutdown_init() do { } while (0) +#endif diff --git a/io/mmap.c b/io/mmap.c index b6a32ca45..af7c3504b 100644 --- a/io/mmap.c +++ b/io/mmap.c @@ -679,6 +679,10 @@ madvise_f( return 0; } +#if defined(__sgi__) +int mincore(caddr_t p, size_t s, char *v) { errno = ENOSYS; return -1; } +#endif + int mincore_f( int argc, diff --git a/io/open.c b/io/open.c index d27fee20a..206174733 100644 --- a/io/open.c +++ b/io/open.c @@ -618,7 +618,7 @@ statfs_f( int argc, char **argv) { - struct xfs_fsop_geom_v1 fsgeo; + struct xfs_fsop_geom fsgeo; struct statfs st; printf(_("fd.path = \"%s\"\n"), file->name); @@ -629,7 +629,7 @@ statfs_f( printf(_("statfs.f_blocks = %lld\n"), (long long) st.f_blocks); #if defined(__sgi__) printf(_("statfs.f_frsize = %lld\n"), (long long) st.f_frsize); -else +#else printf(_("statfs.f_bavail = %lld\n"), (long long) st.f_bavail); #endif printf(_("statfs.f_files = %lld\n"), (long long) st.f_files); diff --git a/m4/package_utilies.m4 b/m4/package_utilies.m4 index e0116ce9a..5ddafedcf 100644 --- a/m4/package_utilies.m4 +++ b/m4/package_utilies.m4 @@ -17,59 +17,69 @@ AC_DEFUN([AC_PACKAGE_NEED_UTILITY], # MSGFMT MSGMERGE RPM # AC_DEFUN([AC_PACKAGE_UTILITIES], - [ if test -z "$CC"; then - AC_PROG_CC - fi + [ AC_PROG_CC cc="$CC" AC_SUBST(cc) AC_PACKAGE_NEED_UTILITY($1, "$cc", cc, [C compiler]) if test -z "$MAKE"; then - AC_PATH_PROG(MAKE, make, /usr/bin/make) + AC_PATH_PROG(MAKE, gmake,, /usr/bin:/usr/freeware/bin) + fi + if test -z "$MAKE"; then + AC_PATH_PROG(MAKE, make,, /usr/bin) fi make=$MAKE AC_SUBST(make) AC_PACKAGE_NEED_UTILITY($1, "$make", make, [GNU make]) if test -z "$LIBTOOL"; then - AC_PATH_PROG(LIBTOOL, libtool,,/usr/bin:/usr/local/bin) + AC_PATH_PROG(LIBTOOL, glibtool,, /usr/bin) + fi + if test -z "$LIBTOOL"; then + AC_PATH_PROG(LIBTOOL, libtool,, /usr/bin:/usr/local/bin:/usr/freeware/bin) fi libtool=$LIBTOOL AC_SUBST(libtool) AC_PACKAGE_NEED_UTILITY($1, "$libtool", libtool, [GNU libtool]) if test -z "$TAR"; then - AC_PATH_PROG(TAR, tar) + AC_PATH_PROG(TAR, tar,, /usr/freeware/bin:/bin:/usr/local/bin:/usr/bin) fi tar=$TAR AC_SUBST(tar) if test -z "$ZIP"; then - AC_PATH_PROG(ZIP, gzip, /bin/gzip) + AC_PATH_PROG(ZIP, gzip,, /bin:/usr/local/bin:/usr/freeware/bin) fi + zip=$ZIP AC_SUBST(zip) + if test -z "$MAKEDEPEND"; then AC_PATH_PROG(MAKEDEPEND, makedepend, /bin/true) fi makedepend=$MAKEDEPEND AC_SUBST(makedepend) + if test -z "$AWK"; then - AC_PATH_PROG(AWK, awk, /bin/awk) + AC_PATH_PROG(AWK, awk,, /bin:/usr/bin) fi awk=$AWK AC_SUBST(awk) + if test -z "$SED"; then - AC_PATH_PROG(SED, sed, /bin/sed) + AC_PATH_PROG(SED, sed,, /bin:/usr/bin) fi sed=$SED AC_SUBST(sed) + if test -z "$ECHO"; then - AC_PATH_PROG(ECHO, echo, /bin/echo) + AC_PATH_PROG(ECHO, echo,, /bin:/usr/bin) fi echo=$ECHO AC_SUBST(echo) + if test -z "$SORT"; then - AC_PATH_PROG(SORT, sort, /bin/sort) + AC_PATH_PROG(SORT, sort,, /bin:/usr/bin) fi sort=$SORT AC_SUBST(sort) @@ -79,13 +89,14 @@ AC_DEFUN([AC_PACKAGE_UTILITIES], if test "$enable_gettext" = yes; then if test -z "$MSGFMT"; then - AC_CHECK_PROG(MSGFMT, msgfmt, /usr/bin/msgfmt) + AC_PATH_PROG(MSGFMT, msgfmt,, /usr/bin:/usr/freeware/bin) fi msgfmt=$MSGFMT AC_SUBST(msgfmt) AC_PACKAGE_NEED_UTILITY($1, "$msgfmt", msgfmt, gettext) + if test -z "$MSGMERGE"; then - AC_CHECK_PROG(MSGMERGE, msgmerge, /usr/bin/msgmerge) + AC_PATH_PROG(MSGMERGE, msgmerge,, /usr/bin:/usr/freeware/bin) fi msgmerge=$MSGMERGE AC_SUBST(msgmerge) @@ -93,10 +104,11 @@ AC_DEFUN([AC_PACKAGE_UTILITIES], fi if test -z "$RPM"; then - AC_PATH_PROG(RPM, rpm, /bin/rpm) + AC_PATH_PROG(RPM, rpm,, /bin:/usr/freeware/bin) fi rpm=$RPM AC_SUBST(rpm) + dnl .. and what version is rpm rpm_version=0 test -x $RPM && rpm_version=`$RPM --version \ diff --git a/m4/package_uuiddev.m4 b/m4/package_uuiddev.m4 index 71c9d57bd..2fd8af170 100644 --- a/m4/package_uuiddev.m4 +++ b/m4/package_uuiddev.m4 @@ -1,11 +1,12 @@ AC_DEFUN([AC_PACKAGE_NEED_UUID_H], - [ AC_CHECK_HEADERS(uuid.h) - if test $ac_cv_header_uuid_h = no; then - AC_CHECK_HEADERS(uuid/uuid.h,, [ + [ AC_CHECK_HEADERS([uuid.h sys/uuid.h uuid/uuid.h]) + if test $ac_cv_header_uuid_h = no -a \ + $ac_cv_header_sys_uuid_h = no -a \ + $ac_cv_header_uuid_uuid_h = no; then echo echo 'FATAL ERROR: could not find a valid UUID header.' echo 'Install the Universally Unique Identifiers development package.' - exit 1]) + exit 1 fi ]) diff --git a/man/man8/xfs_io.8 b/man/man8/xfs_io.8 index 78990b6b1..d3ba78012 100644 --- a/man/man8/xfs_io.8 +++ b/man/man8/xfs_io.8 @@ -23,7 +23,7 @@ Set the program name for prompts and some error messages, the default value is \f2xfs_io\f1. .TP \f3\-F\f1 -Allow \f2file\f1 to be ``foreign'', i.e. not in an XFS filesystem. +Allow \f2file\f1 to reside in non-XFS (foreign) filesystems. This mode has a restricted set of commands. .TP \f3\-f\f1 @@ -58,6 +58,10 @@ where they reside. Many commands have extensive online help. Use the \f3help\f1 command for more details on any command. .SH FILE I/O COMMANDS +.TP +\f3file\f1 [ \f2N\f1 ] +Display a list of all open files and (optionally) switch to an alternate +current open file. .TP 10 \f3open\f1 [ \f2\-FacdfrstR\f1 ] [ \f2path\f1 ] Closes the current file, and opens the file specified by \f2path\f1 instead. @@ -166,10 +170,16 @@ system call described in \f2xfs\f1(5). .TP \f3truncate\f1 \f2offset\f1 Truncates the current file at the given offset using \f2ftruncate\f1(2). +.TP +\f3sendfile\f1 \f2\-i infile\f1 | \f2\-f N\f1 [ \f2offset\f1 \f2length\f1 ] +On platforms which support it, allows a direct in-kernel copy between +two file descriptors. +The current open file is the target, the source must be specified as +another open file (\f2-f\f1) or by path (\f2-i\f2). .SH MEMORY MAPPED I/O COMMANDS .TP -\f3mmap\f1 [ \f2-rwx\f1 ] [ \f2offset\f1 \f2length\f1 ] +\f3mmap\f1 [ \f2-rwx\f1 ] [[ N ] | [ \f2offset\f1 \f2length\f1 ]] With no arguments, \f3mmap\f1 shows the current mappings. Specifying a single numeric argument sets the current mapping. If two arguments are specified (a range), a new mapping is created