summaryrefslogtreecommitdiffstats
path: root/source/smbd/predict.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-09-03 18:40:31 +0000
committerJeremy Allison <jra@samba.org>1998-09-03 18:40:31 +0000
commit14500936c321d15995c963766aac67bf1f4e3824 (patch)
treed6334d89735aa240aa8950c6c37a70b35b0ea181 /source/smbd/predict.c
parentd252d331015b7606618ba1422bb669da003da293 (diff)
downloadsamba-14500936c321d15995c963766aac67bf1f4e3824.tar.gz
samba-14500936c321d15995c963766aac67bf1f4e3824.tar.xz
samba-14500936c321d15995c963766aac67bf1f4e3824.zip
Ok - this is the 64 bit widening check in. It changes the configure
to check for stat64 and friends, and then changes much of Samba to use the data type SMB_OFF_T for file size information. stat/fstat/lstat/lseek/ftruncate have now become sys_stat etc. to hide the 64 bit calls if needed. Note that this still does not expose 64 bit functionality to the client, as the changes to the reply_xxx smb's are not yet done. This code change should make these changes possible. Still to do before full 64 bit-ness to the client: fcntl lock code. statfs code widening of dev_t and ino_t (now possible due to SMB_DEV_T and SMB_OFF_T types being in place). Let me know if wierd things happen after this check-in and I'll fix them :-). Jeremy.
Diffstat (limited to 'source/smbd/predict.c')
-rw-r--r--source/smbd/predict.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/smbd/predict.c b/source/smbd/predict.c
index 6e423c8efff..0deda0c0b63 100644
--- a/source/smbd/predict.c
+++ b/source/smbd/predict.c
@@ -27,11 +27,11 @@ extern int DEBUGLEVEL;
/* variables used by the read prediction module */
static int rp_fd = -1;
-static int rp_offset = 0;
+static SMB_OFF_T rp_offset = 0;
static int rp_length = 0;
static int rp_alloced = 0;
static int rp_predict_fd = -1;
-static int rp_predict_offset = 0;
+static SMB_OFF_T rp_predict_offset = 0;
static int rp_predict_length = 0;
static int rp_timeout = 5;
static time_t rp_time = 0;
@@ -42,7 +42,7 @@ extern time_t smb_last_time;
/****************************************************************************
handle read prediction on a file
****************************************************************************/
-int read_predict(int fd,int offset,char *buf,char **ptr,int num)
+int read_predict(int fd,SMB_OFF_T offset,char *buf,char **ptr,int num)
{
int ret = 0;
int possible = rp_length - (offset - rp_offset);
@@ -70,7 +70,7 @@ int read_predict(int fd,int offset,char *buf,char **ptr,int num)
/* Find the end of the file - ensure we don't
read predict beyond it. */
- if(fstat(fd,&rp_stat) < 0)
+ if(sys_fstat(fd,&rp_stat) < 0)
{
DEBUG(0,("read-prediction failed on fstat. Error was %s\n", strerror(errno)));
predict_skip = True;
@@ -134,7 +134,7 @@ void do_read_prediction(void)
}
}
- if (lseek(rp_fd,rp_offset,SEEK_SET) != rp_offset) {
+ if (sys_lseek(rp_fd,rp_offset,SEEK_SET) != rp_offset) {
rp_fd = -1;
rp_predict_fd = -1;
return;