summaryrefslogtreecommitdiff
path: root/source3/client
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
commit7bb86c1b132bce31a006ea9768a54db7a45fe1a5 (patch)
tree1802e8e2741345e91187fc4b149016af75990971 /source3/client
parent4acd373e5bbd615141ceb5fb3c4a588a5b4581d7 (diff)
downloadsamba-7bb86c1b132bce31a006ea9768a54db7a45fe1a5.tar.gz
samba-7bb86c1b132bce31a006ea9768a54db7a45fe1a5.tar.bz2
samba-7bb86c1b132bce31a006ea9768a54db7a45fe1a5.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. (This used to be commit 14500936c321d15995c963766aac67bf1f4e3824)
Diffstat (limited to 'source3/client')
-rw-r--r--source3/client/client.c23
-rw-r--r--source3/client/clitar.c2
-rw-r--r--source3/client/smbmnt.c2
3 files changed, 25 insertions, 2 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 0b98d1f670..d5dece1626 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -462,11 +462,19 @@ static void display_finfo(file_info *finfo)
{
if (do_this_one(finfo)) {
time_t t = finfo->mtime; /* the time is assumed to be passed as GMT */
+#ifdef LARGE_SMB_OFF_T
+ DEBUG(0,(" %-30s%7.7s%.0f %s",
+ CNV_LANG(finfo->name),
+ attrib_string(finfo->mode),
+ (double)finfo->size,
+ asctime(LocalTime(&t))));
+#else /* LARGE_SMB_OFF_T */
DEBUG(0,(" %-30s%7.7s%10d %s",
CNV_LANG(finfo->name),
attrib_string(finfo->mode),
finfo->size,
asctime(LocalTime(&t))));
+#endif /* LARGE_SMB_OFF_T */
dir_total += finfo->size;
}
}
@@ -1190,10 +1198,17 @@ static void do_get(char *rname,char *lname,file_info *finfo1)
}
+#ifdef LARGE_SMB_OFF_T
+ DEBUG(2,("getting file %s of size %.0f bytes as %s ",
+ CNV_LANG(finfo.name),
+ (double)finfo.size,
+ lname));
+#else /* LARGE_SMB_OFF_T */
DEBUG(2,("getting file %s of size %d bytes as %s ",
CNV_LANG(finfo.name),
finfo.size,
lname));
+#endif /* LARGE_SMB_OFF_T */
while (nread < finfo.size && !close_done)
{
@@ -1202,7 +1217,11 @@ static void do_get(char *rname,char *lname,file_info *finfo1)
p=NULL;
+#ifdef LARGE_SMB_OFF_T
+ DEBUG(3,("nread=%d max_xmit=%d fsize=%.0f\n",nread,max_xmit,(double)finfo.size));
+#else /* LARGE_SMB_OFF_T */
DEBUG(3,("nread=%d max_xmit=%d fsize=%d\n",nread,max_xmit,finfo.size));
+#endif /* LARGE_SMB_OFF_T */
/* 3 possible read types. readbraw if a large block is required.
readX + close if not much left and read if neither is supported */
@@ -1880,7 +1899,11 @@ static void do_put(char *rname,char *lname,file_info *finfo)
if (finfo->size < 0)
finfo->size = file_size(lname);
+#ifdef LARGE_SMB_OFF_T
+ DEBUG(1,("putting file %s of size %.0f bytes as %s ",lname,(double)finfo->size,CNV_LANG(rname)));
+#else /* LARGE_SMB_OFF_T */
DEBUG(1,("putting file %s of size %d bytes as %s ",lname,finfo->size,CNV_LANG(rname)));
+#endif /* LARGE_SMB_OFF_T */
if (!maxwrite)
maxwrite = writebraw_supported?MAX(max_xmit,BUFFER_SIZE):(max_xmit-200);
diff --git a/source3/client/clitar.c b/source3/client/clitar.c
index 6642154683..502a867f60 100644
--- a/source3/client/clitar.c
+++ b/source3/client/clitar.c
@@ -446,7 +446,7 @@ static void dotareof(int f)
(void) dozerobuf(f, TBLOCK);
(void) dozerobuf(f, TBLOCK);
- if (fstat(f, &stbuf) == -1)
+ if (sys_fstat(f, &stbuf) == -1)
{
DEBUG(0, ("Couldn't stat file handle\n"));
return;
diff --git a/source3/client/smbmnt.c b/source3/client/smbmnt.c
index 9fb0dba99d..f6753090b8 100644
--- a/source3/client/smbmnt.c
+++ b/source3/client/smbmnt.c
@@ -197,7 +197,7 @@ main(int argc, char *argv[])
argv += 1;
argc -= 1;
- if (stat(mount_point, &st) == -1) {
+ if (sys_stat(mount_point, &st) == -1) {
fprintf(stderr, "could not find mount point %s: %s\n",
mount_point, strerror(errno));
exit(1);