From e1797cf6be48b3c7ee00962283eb4e9d1b712961 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 25 Jan 2007 15:10:40 +1100 Subject: added copies of libs so can be built standalone (This used to be ctdb commit 0bf6e6cb371bb946ea8cc1d8c7a23a41ea715832) --- ctdb/lib/replace/system/filesys.h | 170 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 ctdb/lib/replace/system/filesys.h (limited to 'ctdb/lib/replace/system/filesys.h') diff --git a/ctdb/lib/replace/system/filesys.h b/ctdb/lib/replace/system/filesys.h new file mode 100644 index 0000000000..1e48f7ab40 --- /dev/null +++ b/ctdb/lib/replace/system/filesys.h @@ -0,0 +1,170 @@ +#ifndef _system_filesys_h +#define _system_filesys_h +/* + Unix SMB/CIFS implementation. + + filesystem system include wrappers + + Copyright (C) Andrew Tridgell 2004 + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include +#include + +#ifdef HAVE_SYS_PARAM_H +#include +#endif + +#ifdef HAVE_SYS_MOUNT_H +#include +#endif + +#ifdef HAVE_SYS_VFS_H +#include +#endif + +#ifdef HAVE_SYS_ACL_H +#include +#endif + +#ifdef HAVE_SYS_FS_S5PARAM_H +#include +#endif + +#if defined (HAVE_SYS_FILSYS_H) && !defined (_CRAY) +#include +#endif + +#ifdef HAVE_SYS_STATFS_H +# include +#endif + +#ifdef HAVE_DUSTAT_H +#include +#endif + +#ifdef HAVE_SYS_STATVFS_H +#include +#endif + +#ifdef HAVE_SYS_FILIO_H +#include +#endif + +#include + +#ifdef HAVE_FCNTL_H +#include +#else +#ifdef HAVE_SYS_FCNTL_H +#include +#endif +#endif + +#ifdef HAVE_SYS_MODE_H +/* apparently AIX needs this for S_ISLNK */ +#ifndef S_ISLNK +#include +#endif +#endif + +#ifdef HAVE_SYS_IOCTL_H +#include +#endif + +/* + * Veritas File System. Often in addition to native. + * Quotas different. + */ +#if defined(HAVE_SYS_FS_VX_QUOTA_H) +#define VXFS_QUOTA +#endif + +#if HAVE_SYS_ATTRIBUTES_H +#include +#endif + +/* mutually exclusive (SuSE 8.2) */ +#if HAVE_ATTR_XATTR_H +#include +#elif HAVE_SYS_XATTR_H +#include +#endif + + +#ifdef HAVE_SYS_RESOURCE_H +#include +#endif + +/* Some POSIX definitions for those without */ + +#ifndef S_IFDIR +#define S_IFDIR 0x4000 +#endif +#ifndef S_ISDIR +#define S_ISDIR(mode) ((mode & 0xF000) == S_IFDIR) +#endif +#ifndef S_IRWXU +#define S_IRWXU 00700 /* read, write, execute: owner */ +#endif +#ifndef S_IRUSR +#define S_IRUSR 00400 /* read permission: owner */ +#endif +#ifndef S_IWUSR +#define S_IWUSR 00200 /* write permission: owner */ +#endif +#ifndef S_IXUSR +#define S_IXUSR 00100 /* execute permission: owner */ +#endif +#ifndef S_IRWXG +#define S_IRWXG 00070 /* read, write, execute: group */ +#endif +#ifndef S_IRGRP +#define S_IRGRP 00040 /* read permission: group */ +#endif +#ifndef S_IWGRP +#define S_IWGRP 00020 /* write permission: group */ +#endif +#ifndef S_IXGRP +#define S_IXGRP 00010 /* execute permission: group */ +#endif +#ifndef S_IRWXO +#define S_IRWXO 00007 /* read, write, execute: other */ +#endif +#ifndef S_IROTH +#define S_IROTH 00004 /* read permission: other */ +#endif +#ifndef S_IWOTH +#define S_IWOTH 00002 /* write permission: other */ +#endif +#ifndef S_IXOTH +#define S_IXOTH 00001 /* execute permission: other */ +#endif + +#ifndef O_ACCMODE +#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR) +#endif + +#ifndef MAXPATHLEN +#define MAXPATHLEN 256 +#endif + +#ifndef SEEK_SET +#define SEEK_SET 0 +#endif + +#endif -- cgit From 169f12940462da90d6cdbbd1c8f170fa978d959a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 2 May 2007 07:32:04 +1000 Subject: merge latest versions of lib/replace, lib/talloc, lib/tdb and lib/events into ctdb bzr tree (This used to be ctdb commit eaea8a9fa8d2f5e08f3af619fa1008a663f39053) --- ctdb/lib/replace/system/filesys.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ctdb/lib/replace/system/filesys.h') diff --git a/ctdb/lib/replace/system/filesys.h b/ctdb/lib/replace/system/filesys.h index 1e48f7ab40..3b68abe48a 100644 --- a/ctdb/lib/replace/system/filesys.h +++ b/ctdb/lib/replace/system/filesys.h @@ -41,6 +41,10 @@ #include #endif +#ifdef HAVE_ACL_LIBACL_H +#include +#endif + #ifdef HAVE_SYS_FS_S5PARAM_H #include #endif -- cgit From cc87648933ab85140b1bff2853a61425e8887f11 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 30 May 2007 18:06:57 +1000 Subject: merge lib/replace from samba4 (This used to be ctdb commit d1a0bcbe331b05ad7a3f5f7a33e4c9b5242c43f2) --- ctdb/lib/replace/system/filesys.h | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'ctdb/lib/replace/system/filesys.h') diff --git a/ctdb/lib/replace/system/filesys.h b/ctdb/lib/replace/system/filesys.h index 3b68abe48a..b3c339a144 100644 --- a/ctdb/lib/replace/system/filesys.h +++ b/ctdb/lib/replace/system/filesys.h @@ -7,19 +7,24 @@ Copyright (C) Andrew Tridgell 2004 - 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. + ** NOTE! The following LGPL license applies to the replace + ** library. This does NOT imply that all of Samba is released + ** under the LGPL - This program is distributed in the hope that it will be useful, + 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 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., 675 Mass Ave, Cambridge, MA 02139, USA. + 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 + */ #include @@ -33,6 +38,10 @@ #include #endif +#ifdef HAVE_MNTENT_H +#include +#endif + #ifdef HAVE_SYS_VFS_H #include #endif -- cgit From 32de198fd3d59033418ac0e05baaf16b17f5ce46 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 15:29:31 +1000 Subject: update lib/replace from samba4 (This used to be ctdb commit f0555484105668c01c21f56322992e752e831109) --- ctdb/lib/replace/system/filesys.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'ctdb/lib/replace/system/filesys.h') diff --git a/ctdb/lib/replace/system/filesys.h b/ctdb/lib/replace/system/filesys.h index b3c339a144..4bf1f64865 100644 --- a/ctdb/lib/replace/system/filesys.h +++ b/ctdb/lib/replace/system/filesys.h @@ -14,7 +14,7 @@ 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. + version 3 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 @@ -22,8 +22,7 @@ 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 + License along with this library; if not, see . */ -- cgit From 2c0abf2dcf040e6e32612e65f04ff488745612ae Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 25 Nov 2011 16:36:40 +0100 Subject: update lib/replace to current upstream version (samba master) (This used to be ctdb commit 17bcffab19fdbb435b4745ff90c327342bbbf0f8) --- ctdb/lib/replace/system/filesys.h | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) (limited to 'ctdb/lib/replace/system/filesys.h') diff --git a/ctdb/lib/replace/system/filesys.h b/ctdb/lib/replace/system/filesys.h index 4bf1f64865..e2c3c1dd72 100644 --- a/ctdb/lib/replace/system/filesys.h +++ b/ctdb/lib/replace/system/filesys.h @@ -1,16 +1,16 @@ #ifndef _system_filesys_h #define _system_filesys_h -/* +/* Unix SMB/CIFS implementation. filesystem system include wrappers Copyright (C) Andrew Tridgell 2004 - + ** NOTE! The following LGPL license applies to the replace ** library. This does NOT imply that all of Samba is released ** under the LGPL - + 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 @@ -53,23 +53,23 @@ #include #endif -#ifdef HAVE_SYS_FS_S5PARAM_H +#ifdef HAVE_SYS_FS_S5PARAM_H #include #endif #if defined (HAVE_SYS_FILSYS_H) && !defined (_CRAY) -#include +#include #endif #ifdef HAVE_SYS_STATFS_H # include #endif -#ifdef HAVE_DUSTAT_H +#ifdef HAVE_DUSTAT_H #include #endif -#ifdef HAVE_SYS_STATVFS_H +#ifdef HAVE_SYS_STATVFS_H #include #endif @@ -77,7 +77,9 @@ #include #endif +#ifdef HAVE_SYS_FILE_H #include +#endif #ifdef HAVE_FCNTL_H #include @@ -98,6 +100,10 @@ #include #endif +#ifdef HAVE_SYS_UIO_H +#include +#endif + /* * Veritas File System. Often in addition to native. * Quotas different. @@ -123,7 +129,7 @@ #endif /* Some POSIX definitions for those without */ - + #ifndef S_IFDIR #define S_IFDIR 0x4000 #endif @@ -179,4 +185,19 @@ #define SEEK_SET 0 #endif +#ifdef _WIN32 +#define mkdir(d,m) _mkdir(d) +#endif + +#ifdef UID_WRAPPER +# ifndef UID_WRAPPER_DISABLE +# ifndef UID_WRAPPER_NOT_REPLACE +# define UID_WRAPPER_REPLACE +# endif /* UID_WRAPPER_NOT_REPLACE */ +# include "../uid_wrapper/uid_wrapper.h" +# endif /* UID_WRAPPER_DISABLE */ +#else /* UID_WRAPPER */ +# define uwrap_enabled() 0 +#endif /* UID_WRAPPER */ + #endif -- cgit From 4c1dc871b9ebdb9a83ab7b4714d89e451ea0783a Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Wed, 29 May 2013 14:44:03 +1000 Subject: replace: Sync to latest replace from upstream The latest commits affecting lib/replace remove autoconf build from Samba tree. So using following commit as a sync point. commit 9ddfd7d8784e6f546628f48990b69ee2850be52d Author: Andrew Bartlett Date: Wed May 22 17:23:30 2013 +1000 Signed-off-by: Amitay Isaacs (This used to be ctdb commit 506b27c944b4031e8a325816bd12abddd442a0bb) --- ctdb/lib/replace/system/filesys.h | 74 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) (limited to 'ctdb/lib/replace/system/filesys.h') diff --git a/ctdb/lib/replace/system/filesys.h b/ctdb/lib/replace/system/filesys.h index e2c3c1dd72..c8ac2b4f74 100644 --- a/ctdb/lib/replace/system/filesys.h +++ b/ctdb/lib/replace/system/filesys.h @@ -114,6 +114,8 @@ #if HAVE_SYS_ATTRIBUTES_H #include +#elif HAVE_ATTR_ATTRIBUTES_H +#include #endif /* mutually exclusive (SuSE 8.2) */ @@ -123,11 +125,26 @@ #include #endif +#ifdef HAVE_SYS_EA_H +#include +#endif + +#ifdef HAVE_SYS_EXTATTR_H +#include +#endif #ifdef HAVE_SYS_RESOURCE_H #include #endif +#ifndef XATTR_CREATE +#define XATTR_CREATE 0x1 /* set value, fail if attr already exists */ +#endif + +#ifndef XATTR_REPLACE +#define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */ +#endif + /* Some POSIX definitions for those without */ #ifndef S_IFDIR @@ -200,4 +217,61 @@ # define uwrap_enabled() 0 #endif /* UID_WRAPPER */ +/* + this allows us to use a uniform error handling for our xattr + wrappers +*/ +#ifndef ENOATTR +#define ENOATTR ENODATA +#endif + + +#if !defined(HAVE_GETXATTR) || defined(XATTR_ADDITIONAL_OPTIONS) +ssize_t rep_getxattr (const char *path, const char *name, void *value, size_t size); +#define getxattr(path, name, value, size) rep_getxattr(path, name, value, size) +/* define is in "replace.h" */ +#endif + +#if !defined(HAVE_FGETXATTR) || defined(XATTR_ADDITIONAL_OPTIONS) +ssize_t rep_fgetxattr (int filedes, const char *name, void *value, size_t size); +#define fgetxattr(filedes, name, value, size) rep_fgetxattr(filedes, name, value, size) +/* define is in "replace.h" */ +#endif + +#if !defined(HAVE_LISTXATTR) || defined(XATTR_ADDITIONAL_OPTIONS) +ssize_t rep_listxattr (const char *path, char *list, size_t size); +#define listxattr(path, list, size) rep_listxattr(path, list, size) +/* define is in "replace.h" */ +#endif + +#if !defined(HAVE_FLISTXATTR) || defined(XATTR_ADDITIONAL_OPTIONS) +ssize_t rep_flistxattr (int filedes, char *list, size_t size); +#define flistxattr(filedes, value, size) rep_flistxattr(filedes, value, size) +/* define is in "replace.h" */ +#endif + +#if !defined(HAVE_REMOVEXATTR) || defined(XATTR_ADDITIONAL_OPTIONS) +int rep_removexattr (const char *path, const char *name); +#define removexattr(path, name) rep_removexattr(path, name) +/* define is in "replace.h" */ +#endif + +#if !defined(HAVE_FREMOVEXATTR) || defined(XATTR_ADDITIONAL_OPTIONS) +int rep_fremovexattr (int filedes, const char *name); +#define fremovexattr(filedes, name) rep_fremovexattr(filedes, name) +/* define is in "replace.h" */ +#endif + +#if !defined(HAVE_SETXATTR) || defined(XATTR_ADDITIONAL_OPTIONS) +int rep_setxattr (const char *path, const char *name, const void *value, size_t size, int flags); +#define setxattr(path, name, value, size, flags) rep_setxattr(path, name, value, size, flags) +/* define is in "replace.h" */ +#endif + +#if !defined(HAVE_FSETXATTR) || defined(XATTR_ADDITIONAL_OPTIONS) +int rep_fsetxattr (int filedes, const char *name, const void *value, size_t size, int flags); +#define fsetxattr(filedes, name, value, size, flags) rep_fsetxattr(filedes, name, value, size, flags) +/* define is in "replace.h" */ +#endif + #endif -- cgit