From 422f1dd45074c0e28203aca5952e57bbe56676b6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 4 Sep 1998 00:23:28 +0000 Subject: More 64 bit stuff - now the fcntl locks are 64 bit clean. Nearly at the stage where I can expose the 64-bit-ness to the NT clients.... Jeremy. --- source/include/config.h.in | 1 + source/include/includes.h | 60 ++++++++++++++++++++++++++++++++++++---------- source/include/proto.h | 8 +++---- 3 files changed, 53 insertions(+), 16 deletions(-) (limited to 'source/include') diff --git a/source/include/config.h.in b/source/include/config.h.in index 71304c86b4e..80160fb4b47 100644 --- a/source/include/config.h.in +++ b/source/include/config.h.in @@ -81,6 +81,7 @@ #undef HAVE_SHARED_MMAP #undef HAVE_SYSV_IPC #undef HAVE_FCNTL_LOCK +#undef HAVE_STRUCT_FLOCK64 #undef HAVE_FTRUNCATE_EXTEND #undef HAVE_TRAPDOOR_UID #undef HAVE_ROOT diff --git a/source/include/includes.h b/source/include/includes.h index 41fccce5fea..4086bd53fea 100644 --- a/source/include/includes.h +++ b/source/include/includes.h @@ -330,11 +330,11 @@ #endif #ifndef SMB_OFF_T -#ifdef HAVE_OFF64_T -#define SMB_OFF_T off64_t -#else -#define SMB_OFF_T off_t -#endif +# ifdef HAVE_OFF64_T +# define SMB_OFF_T off64_t +# else +# define SMB_OFF_T off_t +# endif #endif /* @@ -343,9 +343,9 @@ */ #ifndef LARGE_SMB_OFF_T -#if defined(HAVE_OFF64_T) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8)) -#define LARGE_SMB_OFF_T 1 -#endif +# if defined(HAVE_OFF64_T) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8)) +# define LARGE_SMB_OFF_T 1 +# endif #endif /* @@ -353,11 +353,47 @@ */ #ifndef SMB_STRUCT_STAT -#if defined(HAVE_STAT64) && defined(HAVE_OFF64_T) -#define SMB_STRUCT_STAT struct stat64 -#else -#define SMB_STRUCT_STAT struct stat +# if defined(HAVE_STAT64) && defined(HAVE_OFF64_T) +# define SMB_STRUCT_STAT struct stat64 +# else +# define SMB_STRUCT_STAT struct stat +# endif +#endif + +/* + * Defines for 64 bit fcntl locks. + */ + +#ifndef SMB_STRUCT_FLOCK +# if defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T) +# define SMB_STRUCT_FLOCK struct flock64 +# else +# define SMB_STRUCT_FLOCK struct flock +# endif +#endif + +#ifndef SMB_F_SETLKW +# if defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T) +# define SMB_F_SETLKW F_SETLKW64 +# else +# define SMB_F_SETLKW F_SETLKW +# endif #endif + +#ifndef SMB_F_SETLK +# if defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T) +# define SMB_F_SETLK F_SETLK64 +# else +# define SMB_F_SETLK F_SETLK +# endif +#endif + +#ifndef SMB_F_GETLK +# if defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T) +# define SMB_F_GETLK F_GETLK64 +# else +# define SMB_F_GETLK F_GETLK +# endif #endif #ifndef MIN diff --git a/source/include/proto.h b/source/include/proto.h index 0e6dc54d34c..7313fef8f83 100644 --- a/source/include/proto.h +++ b/source/include/proto.h @@ -337,7 +337,7 @@ char *readdirname(void *p); BOOL is_in_path(char *name, name_compare_entry *namelist); void set_namearray(name_compare_entry **ppname_array, char *namelist); void free_namearray(name_compare_entry *name_array); -BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); +BOOL fcntl_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type); int file_lock(char *name,int timeout); void file_unlock(int fd); BOOL is_myname(char *s); @@ -493,12 +493,12 @@ char *smb_errstr(char *inbuf); /*The following definitions come from locking/locking.c */ BOOL is_locked(files_struct *fsp,connection_struct *conn, - uint32 count,uint32 offset, int lock_type); + SMB_OFF_T count,SMB_OFF_T offset, int lock_type); BOOL do_lock(files_struct *fsp,connection_struct *conn, - uint32 count,uint32 offset,int lock_type, + SMB_OFF_T count,SMB_OFF_T offset,int lock_type, int *eclass,uint32 *ecode); BOOL do_unlock(files_struct *fsp,connection_struct *conn, - uint32 count,uint32 offset,int *eclass,uint32 *ecode); + SMB_OFF_T count,SMB_OFF_T offset,int *eclass,uint32 *ecode); BOOL locking_init(int read_only); BOOL locking_end(void); BOOL lock_share_entry(connection_struct *conn, -- cgit v1.2.1