1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

more OSF1 changes as well as changes to allow us to use the standard

includes.h in wrapped.c, thus making porting much simpler
This commit is contained in:
Andrew Tridgell 0001-01-01 00:00:00 +00:00
parent 4dbfec81b2
commit 6f2239c935
13 changed files with 345 additions and 359 deletions

View File

@ -72,3 +72,4 @@
#undef HAVE_IRIX_SPECIFIC_CAPABILITIES #undef HAVE_IRIX_SPECIFIC_CAPABILITIES
#undef KRB4_AUTH #undef KRB4_AUTH
#undef SEEKDIR_RETURNS_VOID #undef SEEKDIR_RETURNS_VOID
#undef HAVE_DIRENT_D_OFF

14
source/aclocal.m4 vendored
View File

@ -34,3 +34,17 @@ AC_DEFUN(SAMBA_MAINTAINER_MODE,[
AC_PATH_PROG(AUTOHEADER, autoheader, autoheader) AC_PATH_PROG(AUTOHEADER, autoheader, autoheader)
AC_SUBST(AUTOHEADER) AC_SUBST(AUTOHEADER)
]) ])
dnl test whether dirent has a d_off member
AC_DEFUN(AC_DIRENT_D_OFF,
[AC_CACHE_CHECK([for d_off in dirent], ac_cv_dirent_d_off,
[AC_TRY_COMPILE([
#include <unistd.h>
#include <sys/types.h>
#include <dirent.h>], [struct dirent d; d.d_off;],
ac_cv_dirent_d_off=yes, ac_cv_dirent_d_off=no)])
if test $ac_cv_dirent_d_off = yes; then
AC_DEFINE(HAVE_DIRENT_D_OFF)
fi
])

540
source/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -61,7 +61,7 @@ AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h)
AC_CHECK_HEADERS(sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h) AC_CHECK_HEADERS(sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
AC_CHECK_HEADERS(shadow.h netinet/tcp.h sys/security.h security/pam_appl.h) AC_CHECK_HEADERS(shadow.h netinet/tcp.h sys/security.h security/pam_appl.h)
AC_CHECK_HEADERS(stropts.h poll.h readline.h history.h readline/readline.h) AC_CHECK_HEADERS(stropts.h poll.h readline.h history.h readline/readline.h)
AC_CHECK_HEADERS(readline/history.h sys/capability.h sysacll.h sys/syscall.h) AC_CHECK_HEADERS(readline/history.h sys/capability.h syscall.h sys/syscall.h)
AC_CHECK_HEADERS(sys/acl.h sys/cdefs.h) AC_CHECK_HEADERS(sys/acl.h sys/cdefs.h)
AC_CHECK_SIZEOF(int,cross) AC_CHECK_SIZEOF(int,cross)
@ -80,6 +80,7 @@ AC_TYPE_OFF_T
AC_TYPE_SIZE_T AC_TYPE_SIZE_T
AC_TYPE_PID_T AC_TYPE_PID_T
AC_STRUCT_ST_RDEV AC_STRUCT_ST_RDEV
AC_DIRENT_D_OFF
AC_CHECK_TYPE(ino_t,unsigned) AC_CHECK_TYPE(ino_t,unsigned)
AC_CHECK_TYPE(loff_t,off_t) AC_CHECK_TYPE(loff_t,off_t)
AC_CHECK_TYPE(offset_t,loff_t) AC_CHECK_TYPE(offset_t,loff_t)

View File

@ -129,6 +129,7 @@
#undef HAVE_IRIX_SPECIFIC_CAPABILITIES #undef HAVE_IRIX_SPECIFIC_CAPABILITIES
#undef KRB4_AUTH #undef KRB4_AUTH
#undef SEEKDIR_RETURNS_VOID #undef SEEKDIR_RETURNS_VOID
#undef HAVE_DIRENT_D_OFF
/* The number of bytes in a int. */ /* The number of bytes in a int. */
#undef SIZEOF_INT #undef SIZEOF_INT

View File

@ -24,6 +24,20 @@
#ifndef NO_CONFIG_H /* for some tests */ #ifndef NO_CONFIG_H /* for some tests */
#include "config.h" #include "config.h"
#endif #endif
#ifdef NO_PROTO
/* get rid of prototypes for smbwrapper */
#define _NO_PROTO
#ifdef HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#ifdef __P
#undef __P
#define __P(x) ()
#endif
#endif
#endif
#include "local.h" #include "local.h"
#ifdef AIX #ifdef AIX
@ -80,6 +94,12 @@
#include <sys/socket.h> #include <sys/socket.h>
#endif #endif
#ifdef HAVE_SYS_SYSCALL_H
#include <sys/syscall.h>
#elif HAVE_SYSCALL_H
#include <syscall.h>
#endif
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
#include <string.h> #include <string.h>
#endif #endif
@ -671,4 +691,7 @@ int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
#define getpass(prompt) getsmbpass((prompt)) #define getpass(prompt) getsmbpass((prompt))
#endif #endif
/* yuck, I'd like a better way of doing this */
#define DIRP_SIZE (256 + 32)
#endif /* _INCLUDES_H */ #endif /* _INCLUDES_H */

View File

@ -20,7 +20,6 @@
*/ */
#include "includes.h" #include "includes.h"
#include "wrapper.h"
#ifdef REPLACE_UTIME #ifdef REPLACE_UTIME
int real_utime(const char *name, struct utimbuf *buf) int real_utime(const char *name, struct utimbuf *buf)

View File

@ -36,7 +36,10 @@
#define real_chmod(fn, mode) (syscall(SYS_chmod,(fn), (mode))) #define real_chmod(fn, mode) (syscall(SYS_chmod,(fn), (mode)))
#define real_chown(fn, owner, group) (syscall(SYS_chown,(fn),(owner),(group))) #define real_chown(fn, owner, group) (syscall(SYS_chown,(fn),(owner),(group)))
#ifdef SYS_getdents
#define real_getdents(fd, dirp, count) (syscall(SYS_getdents, (fd), (dirp), (count))) #define real_getdents(fd, dirp, count) (syscall(SYS_getdents, (fd), (dirp), (count)))
#endif
#define real_link(fn1, fn2) (syscall(SYS_link, (fn1), (fn2))) #define real_link(fn1, fn2) (syscall(SYS_link, (fn1), (fn2)))
#define real_open(fn,flags,mode) (syscall(SYS_open, (fn), (flags), (mode))) #define real_open(fn,flags,mode) (syscall(SYS_open, (fn), (flags), (mode)))

View File

@ -20,7 +20,7 @@
*/ */
#include "includes.h" #include "includes.h"
#include "wrapper.h" #include "realcalls.h"
pstring smbw_cwd; pstring smbw_cwd;

View File

@ -20,7 +20,7 @@
*/ */
#include "includes.h" #include "includes.h"
#include "wrapper.h" #include "realcalls.h"
extern pstring smbw_cwd; extern pstring smbw_cwd;
extern fstring smbw_prefix; extern fstring smbw_prefix;
@ -321,15 +321,19 @@ int smbw_getdents(unsigned int fd, struct dirent *dirp, int count)
} }
while (count>=DIRP_SIZE && (dir->offset < dir->count)) { while (count>=DIRP_SIZE && (dir->offset < dir->count)) {
#if HAVE_DIRENT_D_OFF
dirp->d_off = (dir->offset+1)*DIRP_SIZE; dirp->d_off = (dir->offset+1)*DIRP_SIZE;
#endif
dirp->d_reclen = DIRP_SIZE; dirp->d_reclen = DIRP_SIZE;
fstrcpy(&dirp->d_name[0], dir->list[dir->offset].name); fstrcpy(&dirp->d_name[0], dir->list[dir->offset].name);
dirp->d_ino = smbw_inode(dir->list[dir->offset].name); dirp->d_ino = smbw_inode(dir->list[dir->offset].name);
dir->offset++; dir->offset++;
count -= dirp->d_reclen; count -= dirp->d_reclen;
#if HAVE_DIRENT_D_OFF
if (dir->offset == dir->count) { if (dir->offset == dir->count) {
dirp->d_off = -1; dirp->d_off = -1;
} }
#endif
dirp = (struct dirent *)(((char *)dirp) + DIRP_SIZE); dirp = (struct dirent *)(((char *)dirp) + DIRP_SIZE);
n++; n++;
} }

View File

@ -20,7 +20,6 @@
*/ */
#include "includes.h" #include "includes.h"
#include "wrapper.h"
extern int DEBUGLEVEL; extern int DEBUGLEVEL;

View File

@ -23,7 +23,12 @@
/* we don't want prototypes for this code */ /* we don't want prototypes for this code */
#define NO_PROTO #define NO_PROTO
#include "wrapper.h" #include "includes.h"
#ifdef LINUX
#include "kernel_stat.h"
#endif
#include "realcalls.h"
int open(const char *name, int flags, mode_t mode) int open(const char *name, int flags, mode_t mode)
{ {
@ -203,7 +208,7 @@
#ifdef HAVE_GETDENTS #ifdef real_getdents
int getdents(int fd, struct dirent *dirp, unsigned int count) int getdents(int fd, struct dirent *dirp, unsigned int count)
{ {
if (smbw_fd(fd)) { if (smbw_fd(fd)) {

View File

@ -1,100 +0,0 @@
/*
Unix SMB/Netbios implementation.
Version 2.0
SMB wrapper functions - definitions
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 02139, USA.
*/
#include "config.h"
#ifdef NO_PROTO
/* get rid of prototypes */
#define _NO_PROTO
#ifdef HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#ifdef __P
#undef __P
#define __P(x) ()
#endif
#endif
#endif
#ifdef HAVE_SYSCALL_H
#include <syscall.h>
#elif HAVE_SYS_SYSCALL_H
#include <sys/syscall.h>
#endif
#ifdef HAVE_SYS_ACL_H
#include <sys/acl.h>
#endif
#ifdef HAVE_SYS_FCNTL_H
#include <sys/fcntl.h>
#endif
/* yuck! */
#define DIRP_SIZE (256 + 32)
#include <stdio.h>
#include <dirent.h>
#include <errno.h>
#include <stdarg.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#ifdef LINUX
#include "kernel_stat.h"
#endif
#include "realcalls.h"
int smbw_dirp(DIR *dirp);
int smbw_fd(int fd);
int smbw_dir_open(const char *fname);
int smbw_dir_close(int fd);
int smbw_stat(const char *fname, struct stat *st);
off_t smbw_dir_lseek(int fd, off_t offset, int whence);
int smbw_path(const char *path);
int smbw_open(const char *fname, int flags, mode_t mode);
int smbw_chdir(const char *name);
int smbw_close(int fd);
int smbw_fchdir(unsigned int fd);
int smbw_fcntl(int fd, int cmd, long arg);
int smbw_getdents(unsigned int fd, struct dirent *dirp, int count);
off_t smbw_lseek(int fd, off_t offset, int whence);
ssize_t smbw_read(int fd, void *buf, size_t count);
ssize_t smbw_write(int fd, void *buf, size_t count);
int smbw_access(const char *name, int mode);
int smbw_chmod(const char *fname, mode_t newmode);
int smbw_chown(const char *fname, uid_t owner, gid_t group);
int smbw_closedir(DIR *d);
int smbw_fstat(int fd, struct stat *st);
char *smbw_getcwd(char *buf, size_t size);
int smbw_stat(const char *fname, struct stat *st);
int smbw_mkdir(const char *fname, mode_t mode);
void smbw_seekdir(DIR *d, off_t offset);
off_t smbw_telldir(DIR *d);
int smbw_unlink(const char *fname);
int smbw_utime(const char *fname,void *buf);
DIR *smbw_opendir(const char *fname);
struct dirent *smbw_readdir(DIR *d);
int smbw_readlink(const char *path, char *buf, size_t bufsize);
int smbw_rename(const char *oldname, const char *newname);
int smbw_rmdir(const char *fname);