1998-10-04 05:36:40 +04:00
/*
Unix SMB / Netbios implementation .
Version 2.0
SMB wrapper functions
Copyright ( C ) Andrew Tridgell 1998
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 of the License , or
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
along with this program ; if not , write to the Free Software
Foundation , Inc . , 675 Mass Ave , Cambridge , MA 0213 9 , USA .
*/
1998-10-08 04:23:08 +04:00
/* NOTE: This file WILL produce compiler warnings. They are unavoidable
Do not try and get rid of them by including other include files or
by including includes . h or proto . h or you will break portability .
*/
1998-10-04 05:36:40 +04:00
1998-10-07 13:57:22 +04:00
# include "config.h"
# include <sys/types.h>
# include <errno.h>
1998-10-07 11:55:14 +04:00
# include "realcalls.h"
1998-10-04 05:36:40 +04:00
1999-12-13 16:27:58 +03:00
# ifndef NULL
# define NULL ((void *)0)
# endif
1998-10-07 14:06:28 +04:00
int open ( char * name , int flags , mode_t mode )
1998-10-04 05:36:40 +04:00
{
if ( smbw_path ( name ) ) {
return smbw_open ( name , flags , mode ) ;
}
return real_open ( name , flags , mode ) ;
}
1998-10-05 08:58:33 +04:00
# ifdef HAVE__OPEN
1998-10-07 14:06:28 +04:00
int _open ( char * name , int flags , mode_t mode )
1998-10-05 08:58:33 +04:00
{
1998-10-05 12:54:55 +04:00
return open ( name , flags , mode ) ;
1998-10-05 08:58:33 +04:00
}
# elif HAVE___OPEN
1998-10-07 14:06:28 +04:00
int __open ( char * name , int flags , mode_t mode )
1998-10-05 08:58:33 +04:00
{
1998-10-05 12:54:55 +04:00
return open ( name , flags , mode ) ;
1998-10-05 08:58:33 +04:00
}
# endif
1998-10-05 06:31:39 +04:00
# ifdef HAVE_OPEN64
1998-10-07 14:06:28 +04:00
int open64 ( char * name , int flags , mode_t mode )
1998-10-05 06:31:39 +04:00
{
if ( smbw_path ( name ) ) {
return smbw_open ( name , flags , mode ) ;
}
return real_open64 ( name , flags , mode ) ;
}
# endif
1998-10-05 13:23:46 +04:00
# ifndef NO_OPEN64_ALIAS
1998-10-05 10:09:44 +04:00
# ifdef HAVE__OPEN64
1998-10-07 14:06:28 +04:00
int _open64 ( char * name , int flags , mode_t mode )
1998-10-05 10:09:44 +04:00
{
1998-10-07 13:57:22 +04:00
return open64 ( name , flags , mode ) ;
1998-10-05 10:09:44 +04:00
}
1998-10-05 13:23:46 +04:00
# elif HAVE___OPEN64
1998-10-07 14:06:28 +04:00
int __open64 ( char * name , int flags , mode_t mode )
1998-10-05 10:09:44 +04:00
{
1998-10-07 13:57:22 +04:00
return open64 ( name , flags , mode ) ;
1998-10-05 10:09:44 +04:00
}
# endif
1998-10-05 13:23:46 +04:00
# endif
1998-10-05 10:09:44 +04:00
1998-10-05 06:31:39 +04:00
# ifdef HAVE_PREAD
ssize_t pread ( int fd , void * buf , size_t size , off_t ofs )
{
if ( smbw_fd ( fd ) ) {
return smbw_pread ( fd , buf , size , ofs ) ;
}
return real_pread ( fd , buf , size , ofs ) ;
}
# endif
2000-07-06 06:28:44 +04:00
# if defined(HAVE_PREAD64) && defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT)
1998-10-05 06:31:39 +04:00
ssize_t pread64 ( int fd , void * buf , size_t size , off64_t ofs )
{
if ( smbw_fd ( fd ) ) {
return smbw_pread ( fd , buf , size , ofs ) ;
}
return real_pread64 ( fd , buf , size , ofs ) ;
}
# endif
# ifdef HAVE_PWRITE
ssize_t pwrite ( int fd , void * buf , size_t size , off_t ofs )
{
if ( smbw_fd ( fd ) ) {
return smbw_pwrite ( fd , buf , size , ofs ) ;
}
return real_pwrite ( fd , buf , size , ofs ) ;
}
# endif
2000-07-06 06:28:44 +04:00
# if defined(HAVE_PWRITE64) && defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT)
1998-10-05 06:31:39 +04:00
ssize_t pwrite64 ( int fd , void * buf , size_t size , off64_t ofs )
{
if ( smbw_fd ( fd ) ) {
return smbw_pwrite ( fd , buf , size , ofs ) ;
}
return real_pwrite64 ( fd , buf , size , ofs ) ;
}
# endif
1998-10-04 05:36:40 +04:00
1998-10-07 14:06:28 +04:00
int chdir ( char * name )
1998-10-04 05:36:40 +04:00
{
return smbw_chdir ( name ) ;
}
1998-10-05 08:58:33 +04:00
# ifdef HAVE___CHDIR
1998-10-07 14:06:28 +04:00
int __chdir ( char * name )
1998-10-05 08:58:33 +04:00
{
return chdir ( name ) ;
}
# elif HAVE__CHDIR
1998-10-07 14:06:28 +04:00
int _chdir ( char * name )
1998-10-05 08:58:33 +04:00
{
return chdir ( name ) ;
}
1998-10-04 05:36:40 +04:00
# endif
1998-10-05 08:58:33 +04:00
int close ( int fd )
1998-10-04 05:36:40 +04:00
{
if ( smbw_fd ( fd ) ) {
return smbw_close ( fd ) ;
}
1998-10-24 10:36:22 +04:00
if ( smbw_local_fd ( fd ) ) {
errno = EBADF ;
return - 1 ;
}
1998-10-04 05:36:40 +04:00
return real_close ( fd ) ;
}
1998-10-05 08:58:33 +04:00
# ifdef HAVE___CLOSE
int __close ( int fd )
{
return close ( fd ) ;
}
# elif HAVE__CLOSE
int _close ( int fd )
{
return close ( fd ) ;
}
1998-10-04 05:36:40 +04:00
# endif
1998-10-05 08:58:33 +04:00
1998-10-04 05:36:40 +04:00
int fchdir ( int fd )
{
1998-10-08 05:23:33 +04:00
return smbw_fchdir ( fd ) ;
1998-10-04 05:36:40 +04:00
}
1998-10-05 08:58:33 +04:00
# ifdef HAVE___FCHDIR
int __fchdir ( int fd )
{
return fchdir ( fd ) ;
}
# elif HAVE__FCHDIR
int _fchdir ( int fd )
{
return fchdir ( fd ) ;
}
1998-10-04 05:36:40 +04:00
# endif
1998-10-05 08:58:33 +04:00
1998-10-07 09:58:09 +04:00
int fcntl ( int fd , int cmd , long arg )
1998-10-04 05:36:40 +04:00
{
if ( smbw_fd ( fd ) ) {
1998-10-04 08:33:56 +04:00
return smbw_fcntl ( fd , cmd , arg ) ;
1998-10-04 05:36:40 +04:00
}
return real_fcntl ( fd , cmd , arg ) ;
}
1998-10-05 08:58:33 +04:00
# ifdef HAVE___FCNTL
1998-10-07 09:58:09 +04:00
int __fcntl ( int fd , int cmd , long arg )
1998-10-05 08:58:33 +04:00
{
return fcntl ( fd , cmd , arg ) ;
}
# elif HAVE__FCNTL
1998-10-07 09:58:09 +04:00
int _fcntl ( int fd , int cmd , long arg )
1998-10-05 08:58:33 +04:00
{
return fcntl ( fd , cmd , arg ) ;
}
1998-10-04 05:36:40 +04:00
# endif
1998-10-05 08:58:33 +04:00
1998-10-07 11:55:14 +04:00
# ifdef real_getdents
1998-10-07 13:57:22 +04:00
int getdents ( int fd , void * dirp , unsigned int count )
1998-10-04 05:36:40 +04:00
{
if ( smbw_fd ( fd ) ) {
return smbw_getdents ( fd , dirp , count ) ;
}
return real_getdents ( fd , dirp , count ) ;
}
1998-10-07 09:58:09 +04:00
# endif
1998-10-04 05:36:40 +04:00
1998-10-05 08:58:33 +04:00
# ifdef HAVE___GETDENTS
1998-10-07 13:57:22 +04:00
int __getdents ( int fd , void * dirp , unsigned int count )
1998-10-05 08:58:33 +04:00
{
return getdents ( fd , dirp , count ) ;
}
# elif HAVE__GETDENTS
1998-10-07 13:57:22 +04:00
int _getdents ( int fd , void * dirp , unsigned int count )
1998-10-05 08:58:33 +04:00
{
return getdents ( fd , dirp , count ) ;
}
1998-10-04 05:36:40 +04:00
# endif
1998-10-05 08:58:33 +04:00
off_t lseek ( int fd , off_t offset , int whence )
1998-10-04 05:36:40 +04:00
{
if ( smbw_fd ( fd ) ) {
return smbw_lseek ( fd , offset , whence ) ;
}
return real_lseek ( fd , offset , whence ) ;
}
1998-10-05 08:58:33 +04:00
# ifdef HAVE___LSEEK
off_t __lseek ( int fd , off_t offset , int whence )
{
return lseek ( fd , offset , whence ) ;
}
# elif HAVE__LSEEK
off_t _lseek ( int fd , off_t offset , int whence )
{
return lseek ( fd , offset , whence ) ;
}
1998-10-04 05:36:40 +04:00
# endif
1998-10-05 08:58:33 +04:00
1998-10-04 05:36:40 +04:00
ssize_t read ( int fd , void * buf , size_t count )
{
if ( smbw_fd ( fd ) ) {
return smbw_read ( fd , buf , count ) ;
}
return real_read ( fd , buf , count ) ;
}
1998-10-05 08:58:33 +04:00
# ifdef HAVE___READ
ssize_t __read ( int fd , void * buf , size_t count )
{
return read ( fd , buf , count ) ;
}
# elif HAVE__READ
ssize_t _read ( int fd , void * buf , size_t count )
{
return read ( fd , buf , count ) ;
}
1998-10-04 05:36:40 +04:00
# endif
1998-10-05 08:58:33 +04:00
1998-10-04 05:36:40 +04:00
ssize_t write ( int fd , void * buf , size_t count )
{
if ( smbw_fd ( fd ) ) {
return smbw_write ( fd , buf , count ) ;
}
return real_write ( fd , buf , count ) ;
}
1998-10-05 08:58:33 +04:00
# ifdef HAVE___WRITE
ssize_t __write ( int fd , void * buf , size_t count )
{
return write ( fd , buf , count ) ;
}
# elif HAVE__WRITE
ssize_t _write ( int fd , void * buf , size_t count )
{
return write ( fd , buf , count ) ;
}
# endif
1998-10-04 05:36:40 +04:00
1998-10-07 14:06:28 +04:00
int access ( char * name , int mode )
1998-10-04 05:36:40 +04:00
{
if ( smbw_path ( name ) ) {
return smbw_access ( name , mode ) ;
}
return real_access ( name , mode ) ;
}
1998-10-07 14:06:28 +04:00
int chmod ( char * name , mode_t mode )
1998-10-04 05:36:40 +04:00
{
if ( smbw_path ( name ) ) {
return smbw_chmod ( name , mode ) ;
}
return real_chmod ( name , mode ) ;
}
1998-10-07 14:06:28 +04:00
int chown ( char * name , uid_t owner , gid_t group )
1998-10-04 05:36:40 +04:00
{
if ( smbw_path ( name ) ) {
return smbw_chown ( name , owner , group ) ;
}
return real_chown ( name , owner , group ) ;
}
char * getcwd ( char * buf , size_t size )
{
1998-10-07 14:06:28 +04:00
return ( char * ) smbw_getcwd ( buf , size ) ;
1998-10-04 05:36:40 +04:00
}
1998-10-07 13:57:22 +04:00
1998-10-07 14:06:28 +04:00
int mkdir ( char * name , mode_t mode )
1998-10-07 13:57:22 +04:00
{
1998-10-04 05:36:40 +04:00
if ( smbw_path ( name ) ) {
1998-10-07 13:57:22 +04:00
return smbw_mkdir ( name , mode ) ;
1998-10-04 05:36:40 +04:00
}
1998-10-07 13:57:22 +04:00
return real_mkdir ( name , mode ) ;
}
1998-10-04 05:36:40 +04:00
1998-10-07 13:57:22 +04:00
# if HAVE___FXSTAT
int __fxstat ( int vers , int fd , void * st )
{
1998-10-07 14:44:12 +04:00
double xx [ 32 ] ;
1998-10-07 13:57:22 +04:00
int ret ;
1998-10-04 05:36:40 +04:00
1998-10-07 13:57:22 +04:00
if ( smbw_fd ( fd ) ) {
return smbw_fstat ( fd , st ) ;
1998-10-04 05:36:40 +04:00
}
1998-10-07 13:57:22 +04:00
ret = real_fstat ( fd , xx ) ;
xstat_convert ( vers , st , xx ) ;
return ret ;
1998-10-04 05:36:40 +04:00
}
1998-10-04 18:02:50 +04:00
# endif
1998-10-04 05:36:40 +04:00
1998-10-07 13:57:22 +04:00
# if HAVE___XSTAT
int __xstat ( int vers , char * name , void * st )
1998-10-04 05:36:40 +04:00
{
1998-10-07 14:44:12 +04:00
double xx [ 32 ] ;
1998-10-07 13:57:22 +04:00
int ret ;
1998-10-04 05:36:40 +04:00
if ( smbw_path ( name ) ) {
1998-10-07 13:57:22 +04:00
return smbw_stat ( name , st ) ;
1998-10-04 05:36:40 +04:00
}
1998-10-07 13:57:22 +04:00
ret = real_stat ( name , xx ) ;
xstat_convert ( vers , st , xx ) ;
return ret ;
1998-10-04 05:36:40 +04:00
}
1998-10-07 13:57:22 +04:00
# endif
1998-10-04 05:36:40 +04:00
1998-10-07 13:57:22 +04:00
# if HAVE___LXSTAT
int __lxstat ( int vers , char * name , void * st )
1998-10-04 05:36:40 +04:00
{
1998-10-07 14:44:12 +04:00
double xx [ 32 ] ;
1998-10-04 05:36:40 +04:00
int ret ;
if ( smbw_path ( name ) ) {
return smbw_stat ( name , st ) ;
}
1998-10-07 13:57:22 +04:00
ret = real_lstat ( name , xx ) ;
xstat_convert ( vers , st , xx ) ;
return ret ;
1998-10-04 05:36:40 +04:00
}
1998-10-04 18:02:50 +04:00
# endif
1998-10-04 05:36:40 +04:00
1998-10-07 13:57:22 +04:00
1998-10-07 14:06:28 +04:00
int stat ( char * name , void * st )
1998-10-04 05:36:40 +04:00
{
1998-10-04 18:02:50 +04:00
# if HAVE___XSTAT
1998-10-07 14:12:29 +04:00
return __xstat ( 0 , name , st ) ;
1998-10-04 18:02:50 +04:00
# else
if ( smbw_path ( name ) ) {
return smbw_stat ( name , st ) ;
}
return real_stat ( name , st ) ;
# endif
}
1998-10-07 13:57:22 +04:00
int lstat ( char * name , void * st )
1998-10-04 18:02:50 +04:00
{
# if HAVE___LXSTAT
1998-10-07 13:57:22 +04:00
return __lxstat ( 0 , name , st ) ;
1998-10-04 18:02:50 +04:00
# else
if ( smbw_path ( name ) ) {
return smbw_stat ( name , st ) ;
}
return real_lstat ( name , st ) ;
# endif
}
1998-10-07 13:57:22 +04:00
int fstat ( int fd , void * st )
1998-10-04 18:02:50 +04:00
{
# if HAVE___LXSTAT
1998-10-07 13:57:22 +04:00
return __fxstat ( 0 , fd , st ) ;
1998-10-04 18:02:50 +04:00
# else
if ( smbw_fd ( fd ) ) {
return smbw_fstat ( fd , st ) ;
}
return real_fstat ( fd , st ) ;
# endif
1998-10-04 05:36:40 +04:00
}
1998-10-07 14:06:28 +04:00
int unlink ( char * name )
1998-10-04 05:36:40 +04:00
{
if ( smbw_path ( name ) ) {
return smbw_unlink ( name ) ;
}
return real_unlink ( name ) ;
}
1998-10-05 12:44:46 +04:00
# ifdef HAVE_UTIME
1998-10-07 14:06:28 +04:00
int utime ( char * name , void * tvp )
1998-10-04 05:36:40 +04:00
{
if ( smbw_path ( name ) ) {
return smbw_utime ( name , tvp ) ;
}
return real_utime ( name , tvp ) ;
}
1998-10-05 12:44:46 +04:00
# endif
# ifdef HAVE_UTIMES
2001-08-23 22:12:47 +04:00
int utimes ( const char * name , const struct timeval * tvp )
1998-10-05 12:44:46 +04:00
{
if ( smbw_path ( name ) ) {
return smbw_utimes ( name , tvp ) ;
}
return real_utimes ( name , tvp ) ;
}
# endif
1998-10-04 05:36:40 +04:00
int readlink ( char * path , char * buf , size_t bufsize )
{
if ( smbw_path ( path ) ) {
return smbw_readlink ( path , buf , bufsize ) ;
}
return real_readlink ( path , buf , bufsize ) ;
}
1998-10-07 14:06:28 +04:00
int rename ( char * oldname , char * newname )
1998-10-04 05:36:40 +04:00
{
int p1 , p2 ;
p1 = smbw_path ( oldname ) ;
p2 = smbw_path ( newname ) ;
if ( p1 ^ p2 ) {
/* can't cross filesystem boundaries */
errno = EXDEV ;
return - 1 ;
}
if ( p1 & & p2 ) {
return smbw_rename ( oldname , newname ) ;
}
return real_rename ( oldname , newname ) ;
}
1998-10-07 14:06:28 +04:00
int rmdir ( char * name )
1998-10-04 05:36:40 +04:00
{
if ( smbw_path ( name ) ) {
return smbw_rmdir ( name ) ;
}
return real_rmdir ( name ) ;
}
1998-10-04 10:44:20 +04:00
1998-10-07 14:06:28 +04:00
int symlink ( char * topath , char * frompath )
1998-10-04 10:44:20 +04:00
{
int p1 , p2 ;
p1 = smbw_path ( topath ) ;
p2 = smbw_path ( frompath ) ;
if ( p1 | | p2 ) {
/* can't handle symlinks */
errno = EPERM ;
return - 1 ;
}
return real_symlink ( topath , frompath ) ;
}
1998-10-04 11:52:00 +04:00
int dup ( int fd )
{
if ( smbw_fd ( fd ) ) {
return smbw_dup ( fd ) ;
}
return real_dup ( fd ) ;
}
int dup2 ( int oldfd , int newfd )
{
if ( smbw_fd ( newfd ) ) {
close ( newfd ) ;
}
if ( smbw_fd ( oldfd ) ) {
return smbw_dup2 ( oldfd , newfd ) ;
}
return real_dup2 ( oldfd , newfd ) ;
}
1998-10-04 18:56:19 +04:00
1998-10-05 12:44:46 +04:00
# ifdef real_opendir
1998-10-07 14:06:28 +04:00
void * opendir ( char * name )
1998-10-04 18:56:19 +04:00
{
if ( smbw_path ( name ) ) {
1998-10-07 14:06:28 +04:00
return ( void * ) smbw_opendir ( name ) ;
1998-10-04 18:56:19 +04:00
}
1998-10-07 14:06:28 +04:00
return ( void * ) real_opendir ( name ) ;
1998-10-04 18:56:19 +04:00
}
1998-10-05 12:44:46 +04:00
# endif
1998-10-04 18:56:19 +04:00
1998-10-05 12:44:46 +04:00
# ifdef real_readdir
1998-10-07 13:57:22 +04:00
void * readdir ( void * dir )
1998-10-04 18:56:19 +04:00
{
if ( smbw_dirp ( dir ) ) {
1998-10-07 14:06:28 +04:00
return ( void * ) smbw_readdir ( dir ) ;
1998-10-04 18:56:19 +04:00
}
1998-10-07 14:06:28 +04:00
return ( void * ) real_readdir ( dir ) ;
1998-10-04 18:56:19 +04:00
}
1998-10-05 12:44:46 +04:00
# endif
1998-10-04 18:56:19 +04:00
1998-10-05 12:44:46 +04:00
# ifdef real_closedir
1998-10-07 13:57:22 +04:00
int closedir ( void * dir )
1998-10-04 18:56:19 +04:00
{
if ( smbw_dirp ( dir ) ) {
return smbw_closedir ( dir ) ;
}
return real_closedir ( dir ) ;
}
1998-10-05 12:44:46 +04:00
# endif
1998-10-04 18:56:19 +04:00
1998-10-05 12:44:46 +04:00
# ifdef real_telldir
1998-10-07 13:57:22 +04:00
off_t telldir ( void * dir )
1998-10-04 18:56:19 +04:00
{
if ( smbw_dirp ( dir ) ) {
return smbw_telldir ( dir ) ;
}
return real_telldir ( dir ) ;
}
# endif
1998-10-05 12:44:46 +04:00
# ifdef real_seekdir
1998-10-07 13:57:22 +04:00
int seekdir ( void * dir , off_t offset )
1998-10-04 18:56:19 +04:00
{
if ( smbw_dirp ( dir ) ) {
smbw_seekdir ( dir , offset ) ;
1998-10-07 13:57:22 +04:00
return 0 ;
1998-10-04 18:56:19 +04:00
}
real_seekdir ( dir , offset ) ;
1998-10-07 10:15:08 +04:00
return 0 ;
1998-10-04 18:56:19 +04:00
}
# endif
1998-10-04 19:54:04 +04:00
# ifndef NO_ACL_WRAPPER
1998-10-07 13:57:22 +04:00
int acl ( char * pathp , int cmd , int nentries , void * aclbufp )
1998-10-04 19:54:04 +04:00
{
if ( smbw_path ( pathp ) ) {
1998-10-07 13:57:22 +04:00
return smbw_acl ( pathp , cmd , nentries , aclbufp ) ;
1998-10-04 19:54:04 +04:00
}
1998-10-07 13:57:22 +04:00
return real_acl ( pathp , cmd , nentries , aclbufp ) ;
1998-10-04 19:54:04 +04:00
}
# endif
# ifndef NO_FACL_WRAPPER
1998-10-07 14:27:40 +04:00
int facl ( int fd , int cmd , int nentries , void * aclbufp )
1998-10-04 19:54:04 +04:00
{
1998-10-07 14:27:40 +04:00
if ( smbw_fd ( fd ) ) {
1998-10-07 13:57:22 +04:00
return smbw_facl ( fd , cmd , nentries , aclbufp ) ;
1998-10-04 19:54:04 +04:00
}
1998-10-07 13:57:22 +04:00
return real_facl ( fd , cmd , nentries , aclbufp ) ;
1998-10-04 19:54:04 +04:00
}
# endif
1998-10-07 14:06:28 +04:00
int creat ( char * path , mode_t mode )
1998-10-04 19:54:04 +04:00
{
1998-10-07 13:57:22 +04:00
extern int creat_bits ;
return open ( path , creat_bits , mode ) ;
1998-10-04 19:54:04 +04:00
}
1998-10-05 06:31:39 +04:00
1998-10-05 13:01:49 +04:00
# ifdef HAVE_CREAT64
1998-10-07 14:06:28 +04:00
int creat64 ( char * path , mode_t mode )
1998-10-05 06:31:39 +04:00
{
1998-10-07 13:57:22 +04:00
extern int creat_bits ;
return open64 ( path , creat_bits , mode ) ;
1998-10-05 06:31:39 +04:00
}
1998-10-05 04:32:09 +04:00
# endif
1998-10-05 05:42:46 +04:00
# ifdef HAVE_STAT64
1998-10-07 14:06:28 +04:00
int stat64 ( char * name , void * st64 )
1998-10-05 05:42:46 +04:00
{
if ( smbw_path ( name ) ) {
1998-10-07 14:44:12 +04:00
double xx [ 32 ] ;
1998-10-07 13:57:22 +04:00
int ret = stat ( name , xx ) ;
stat64_convert ( xx , st64 ) ;
1998-10-05 05:42:46 +04:00
return ret ;
}
return real_stat64 ( name , st64 ) ;
}
1998-10-07 13:57:22 +04:00
int fstat64 ( int fd , void * st64 )
1998-10-05 05:42:46 +04:00
{
if ( smbw_fd ( fd ) ) {
1998-10-07 14:44:12 +04:00
double xx [ 32 ] ;
1998-10-07 13:57:22 +04:00
int ret = fstat ( fd , xx ) ;
stat64_convert ( xx , st64 ) ;
1998-10-05 05:42:46 +04:00
return ret ;
}
return real_fstat64 ( fd , st64 ) ;
}
1998-10-07 14:06:28 +04:00
int lstat64 ( char * name , void * st64 )
1998-10-05 05:42:46 +04:00
{
if ( smbw_path ( name ) ) {
1998-10-07 14:44:12 +04:00
double xx [ 32 ] ;
1998-10-07 13:57:22 +04:00
int ret = lstat ( name , xx ) ;
stat64_convert ( xx , st64 ) ;
1998-10-05 05:42:46 +04:00
return ret ;
}
return real_lstat64 ( name , st64 ) ;
}
# endif
# ifdef HAVE_LLSEEK
offset_t llseek ( int fd , offset_t ofs , int whence )
{
if ( smbw_fd ( fd ) ) {
return lseek ( fd , ofs , whence ) ;
}
return real_llseek ( fd , ofs , whence ) ;
}
# endif
# ifdef HAVE_READDIR64
1998-10-07 13:57:22 +04:00
void * readdir64 ( void * dir )
1998-10-05 05:42:46 +04:00
{
if ( smbw_dirp ( dir ) ) {
1998-10-07 14:44:12 +04:00
static double xx [ 70 ] ;
1998-10-07 14:06:28 +04:00
void * d ;
d = ( void * ) readdir ( dir ) ;
1999-12-13 16:27:58 +03:00
if ( ! d ) return NULL ;
1998-10-07 13:57:22 +04:00
dirent64_convert ( d , xx ) ;
return xx ;
1998-10-05 05:42:46 +04:00
}
1998-10-07 14:06:28 +04:00
return ( void * ) real_readdir64 ( dir ) ;
1998-10-05 05:42:46 +04:00
}
# endif
1998-10-06 16:23:37 +04:00
int fork ( void )
{
return smbw_fork ( ) ;
}
1999-12-13 16:27:58 +03:00