if (reget) {
handle = sys_open(lname, O_WRONLY|O_CREAT, 0644);
if (handle >= 0) {
- start = sys_lseek(handle, 0, SEEK_END);
+ start = lseek(handle, 0, SEEK_END);
if (start == -1) {
d_printf("Error seeking local file\n");
return 1;
bool fake_dir_create_times);
int sys_posix_fallocate(int fd, SMB_OFF_T offset, SMB_OFF_T len);
int sys_fallocate(int fd, enum vfs_fallocate_mode mode, SMB_OFF_T offset, SMB_OFF_T len);
-SMB_OFF_T sys_lseek(int fd, SMB_OFF_T offset, int whence);
SMB_OFF_T sys_ftell(FILE *fp);
int sys_creat(const char *path, mode_t mode);
int sys_open(const char *path, int oflag, mode_t mode);
static NTSTATUS db_file_store_root(int fd, TDB_DATA data)
{
- if (sys_lseek(fd, 0, SEEK_SET) != 0) {
- DEBUG(0, ("sys_lseek failed: %s\n", strerror(errno)));
+ if (lseek(fd, 0, SEEK_SET) != 0) {
+ DEBUG(0, ("lseek failed: %s\n", strerror(errno)));
return map_nt_error_from_unix(errno);
}
}
if (tofd != -1 && offset != (SMB_OFF_T)-1) {
- if (sys_lseek(tofd, offset, SEEK_SET) == -1) {
+ if (lseek(tofd, offset, SEEK_SET) == -1) {
if (errno != ESPIPE) {
return -1;
}
/* Reset the seek pointer. */
if (outfd) {
- sys_lseek(*outfd, 0, SEEK_SET);
+ lseek(*outfd, 0, SEEK_SET);
}
#if defined(WIFEXITED) && defined(WEXITSTATUS)
#endif
}
-/*******************************************************************
- An lseek() wrapper.
-********************************************************************/
-
-SMB_OFF_T sys_lseek(int fd, SMB_OFF_T offset, int whence)
-{
- return lseek(fd, offset, whence);
-}
-
/*******************************************************************
An ftell() wrapper.
********************************************************************/
return (ssize_t)total;
#else
/* Use lseek and write_data. */
- if (sys_lseek(fd, pos, SEEK_SET) == -1) {
+ if (lseek(fd, pos, SEEK_SET) == -1) {
if (errno != ESPIPE) {
return -1;
}
/* Cope with 'stat' file opens. */
if (fsp->fh->fd != -1)
- result = sys_lseek(fsp->fh->fd, offset, whence);
+ result = lseek(fsp->fh->fd, offset, whence);
/*
* We want to maintain the fiction that we can seek
*/
fd = fileno(fp);
- if((offpos = sys_lseek(fd, 0, SEEK_END)) == -1) {
+ if((offpos = lseek(fd, 0, SEEK_END)) == -1) {
NTSTATUS result = map_nt_error_from_unix(errno);
- DEBUG(0, ("add_smbfilepwd_entry(sys_lseek): Failed to add entry for user %s to file %s. \
+ DEBUG(0, ("add_smbfilepwd_entry(lseek): Failed to add entry for user %s to file %s. \
Error was %s\n", newpwd->smb_name, pfile, strerror(errno)));
endsmbfilepwent(fp, &smbpasswd_state->pw_file_lock_depth);
return result;
fd = fileno(fp);
- if (sys_lseek(fd, pwd_seekpos - 1, SEEK_SET) != pwd_seekpos - 1) {
+ if (lseek(fd, pwd_seekpos - 1, SEEK_SET) != pwd_seekpos - 1) {
DEBUG(0, ("mod_smbfilepwd_entry: seek fail on file %s.\n", pfile));
pw_file_unlock(lockfd,&smbpasswd_state->pw_file_lock_depth);
fclose(fp);
return False;
}
- if (sys_lseek(fd, pwd_seekpos, SEEK_SET) != pwd_seekpos) {
+ if (lseek(fd, pwd_seekpos, SEEK_SET) != pwd_seekpos) {
DEBUG(0, ("mod_smbfilepwd_entry: seek fail on file %s.\n", pfile));
pw_file_unlock(lockfd,&smbpasswd_state->pw_file_lock_depth);
fclose(fp);