summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-04-05 14:53:08 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-04-06 01:47:43 +0200
commit6aa12fcb30c8f7246fd0215b1d808191c0d87668 (patch)
tree92eb805ea2ed03b1e42f6ce55ca26a65a92761fb /source3/lib
parent48166468fe3ca515dae3431bbe674809489f743c (diff)
downloadsamba-6aa12fcb30c8f7246fd0215b1d808191c0d87668.tar.gz
samba-6aa12fcb30c8f7246fd0215b1d808191c0d87668.tar.bz2
samba-6aa12fcb30c8f7246fd0215b1d808191c0d87668.zip
build: Remove SMB_OFF_T, replace with off_t
Now that we always require a 64 bit off_t, we no longer need SMB_OFF_T. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Fri Apr 6 01:47:43 CEST 2012 on sn-devel-104
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/recvfile.c8
-rw-r--r--source3/lib/sendfile.c18
-rw-r--r--source3/lib/system.c10
-rw-r--r--source3/lib/util.c6
-rw-r--r--source3/lib/util_transfer_file.c4
5 files changed, 23 insertions, 23 deletions
diff --git a/source3/lib/recvfile.c b/source3/lib/recvfile.c
index 6c8a1a3b57..c53ba77e5c 100644
--- a/source3/lib/recvfile.c
+++ b/source3/lib/recvfile.c
@@ -44,7 +44,7 @@
static ssize_t default_sys_recvfile(int fromfd,
int tofd,
- SMB_OFF_T offset,
+ off_t offset,
size_t count)
{
int saved_errno = 0;
@@ -62,7 +62,7 @@ static ssize_t default_sys_recvfile(int fromfd,
return 0;
}
- if (tofd != -1 && offset != (SMB_OFF_T)-1) {
+ if (tofd != -1 && offset != (off_t)-1) {
if (lseek(tofd, offset, SEEK_SET) == -1) {
if (errno != ESPIPE) {
return -1;
@@ -140,7 +140,7 @@ static ssize_t default_sys_recvfile(int fromfd,
ssize_t sys_recvfile(int fromfd,
int tofd,
- SMB_OFF_T offset,
+ off_t offset,
size_t count)
{
static int pipefd[2] = { -1, -1 };
@@ -230,7 +230,7 @@ ssize_t sys_recvfile(int fromfd,
ssize_t sys_recvfile(int fromfd,
int tofd,
- SMB_OFF_T offset,
+ off_t offset,
size_t count)
{
return default_sys_recvfile(fromfd, tofd, offset, count);
diff --git a/source3/lib/sendfile.c b/source3/lib/sendfile.c
index 50b522ed19..a9607fa825 100644
--- a/source3/lib/sendfile.c
+++ b/source3/lib/sendfile.c
@@ -33,7 +33,7 @@
#define MSG_MORE 0x8000
#endif
-ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count)
+ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, off_t offset, size_t count)
{
size_t total=0;
ssize_t ret;
@@ -103,7 +103,7 @@ extern int32 sendfile (int out_fd, int in_fd, int32 *offset, uint32 count);
#define MSG_MORE 0x8000
#endif
-ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count)
+ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, off_t offset, size_t count)
{
size_t total=0;
ssize_t ret;
@@ -118,7 +118,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of
* and uses a normal read. JRA.
*/
- if ((sizeof(SMB_OFF_T) >= 8) && (offset + count > (SMB_OFF_T)0x7FFFFFFF)) {
+ if ((sizeof(off_t) >= 8) && (offset + count > (off_t)0x7FFFFFFF)) {
errno = ENOSYS;
return -1;
}
@@ -184,7 +184,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of
#include <sys/sendfile.h>
-ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count)
+ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, off_t offset, size_t count)
{
int sfvcnt;
size_t total, xferred;
@@ -270,7 +270,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of
#include <sys/socket.h>
#include <sys/uio.h>
-ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count)
+ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, off_t offset, size_t count)
{
size_t total=0;
struct iovec hdtrl[2];
@@ -341,7 +341,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of
#include <sys/socket.h>
#include <sys/uio.h>
-ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count)
+ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, off_t offset, size_t count)
{
size_t total=0;
struct sf_hdtr hdr;
@@ -364,7 +364,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of
total = count;
while (total + hdtrl.iov_len) {
- SMB_OFF_T nwritten;
+ off_t nwritten;
int ret;
/*
@@ -418,7 +418,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of
/* Contributed by William Jojo <jojowil@hvcc.edu> */
#include <sys/socket.h>
-ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count)
+ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, off_t offset, size_t count)
{
struct sf_parms hdtrl;
@@ -472,7 +472,7 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of
#else /* No sendfile implementation. Return error. */
-ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count)
+ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, off_t offset, size_t count)
{
/* No sendfile syscall. */
errno = ENOSYS;
diff --git a/source3/lib/system.c b/source3/lib/system.c
index 8a381732cd..8a0b0f154e 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -121,7 +121,7 @@ A pread wrapper that will deal with EINTR
********************************************************************/
#if defined(HAVE_PREAD)
-ssize_t sys_pread(int fd, void *buf, size_t count, SMB_OFF_T off)
+ssize_t sys_pread(int fd, void *buf, size_t count, off_t off)
{
ssize_t ret;
@@ -137,7 +137,7 @@ A write wrapper that will deal with EINTR
********************************************************************/
#if defined(HAVE_PWRITE)
-ssize_t sys_pwrite(int fd, const void *buf, size_t count, SMB_OFF_T off)
+ssize_t sys_pwrite(int fd, const void *buf, size_t count, off_t off)
{
ssize_t ret;
@@ -517,14 +517,14 @@ int sys_lstat(const char *fname,SMB_STRUCT_STAT *sbuf,
/*******************************************************************
An posix_fallocate() wrapper.
********************************************************************/
-int sys_posix_fallocate(int fd, SMB_OFF_T offset, SMB_OFF_T len)
+int sys_posix_fallocate(int fd, off_t offset, off_t len)
{
#if defined(HAVE_POSIX_FALLOCATE) && !defined(HAVE_BROKEN_POSIX_FALLOCATE)
return posix_fallocate(fd, offset, len);
#elif defined(F_RESVSP64)
/* this handles XFS on IRIX */
struct flock64 fl;
- SMB_OFF_T new_len = offset + len;
+ off_t new_len = offset + len;
int ret;
struct stat64 sbuf;
@@ -559,7 +559,7 @@ int sys_posix_fallocate(int fd, SMB_OFF_T offset, SMB_OFF_T len)
#include <linux/falloc.h>
#endif
-int sys_fallocate(int fd, enum vfs_fallocate_mode mode, SMB_OFF_T offset, SMB_OFF_T len)
+int sys_fallocate(int fd, enum vfs_fallocate_mode mode, off_t offset, off_t len)
{
#if defined(HAVE_LINUX_FALLOCATE64) || defined(HAVE_LINUX_FALLOCATE)
int lmode;
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 22fc1e7abe..e43cfbbcb8 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -320,12 +320,12 @@ char *clean_name(TALLOC_CTX *ctx, const char *s)
Write data into an fd at a given offset. Ignore seek errors.
********************************************************************/
-ssize_t write_data_at_offset(int fd, const char *buffer, size_t N, SMB_OFF_T pos)
+ssize_t write_data_at_offset(int fd, const char *buffer, size_t N, off_t pos)
{
size_t total=0;
ssize_t ret;
- if (pos == (SMB_OFF_T)-1) {
+ if (pos == (off_t)-1) {
return write_data(fd, buffer, N);
}
#if defined(HAVE_PWRITE) || defined(HAVE_PRWITE64)
@@ -1213,7 +1213,7 @@ void set_namearray(name_compare_entry **ppname_array, const char *namelist_in)
F_UNLCK in *ptype if the region is unlocked). False if the call failed.
****************************************************************************/
-bool fcntl_getlock(int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid)
+bool fcntl_getlock(int fd, off_t *poffset, off_t *pcount, int *ptype, pid_t *ppid)
{
struct flock lock;
int ret;
diff --git a/source3/lib/util_transfer_file.c b/source3/lib/util_transfer_file.c
index 8303b2bfe1..37a7d6e248 100644
--- a/source3/lib/util_transfer_file.c
+++ b/source3/lib/util_transfer_file.c
@@ -104,8 +104,8 @@ static ssize_t sys_write_fn(void *file, const void *buf, size_t len)
return sys_write(*fd, buf, len);
}
-SMB_OFF_T transfer_file(int infd, int outfd, SMB_OFF_T n)
+off_t transfer_file(int infd, int outfd, off_t n)
{
- return (SMB_OFF_T)transfer_file_internal(&infd, &outfd, (size_t)n,
+ return (off_t)transfer_file_internal(&infd, &outfd, (size_t)n,
sys_read_fn, sys_write_fn);
}