diff options
author | Andrew Tridgell <tridge@samba.org> | 1997-10-28 14:19:54 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1997-10-28 14:19:54 +0000 |
commit | c9fa24b7a8809a7963f0970cf2dd21f6804e31a4 (patch) | |
tree | 4bd06b65991e13b8aac3771f5d27a54b1fdb6505 /source3/include | |
parent | 7c20ee083f6820a4c8776cefae3e0477f79ea934 (diff) | |
download | samba-c9fa24b7a8809a7963f0970cf2dd21f6804e31a4.tar.gz samba-c9fa24b7a8809a7963f0970cf2dd21f6804e31a4.tar.bz2 samba-c9fa24b7a8809a7963f0970cf2dd21f6804e31a4.zip |
SYSV IPC implementation of fast share modes.
It will try sysv IPC first, then if that fails it will try mmap(),
then after that it will try share files.
I have defined USE_SYSV_IPC for Linux, Solaris and HPUX at the
moment. Probably a lot more could have it defined. In fact, the vast
majority of systems support it. Need autoconf again :-)
It should actually be faster than the mmap() version, and doesn't need
any lock files. This means the problem of the share mem file being on
a NFS drive will be gone.
(This used to be commit cc8fe0f0629eea9acc39e30d8d76d5890a5b6978)
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/includes.h | 12 | ||||
-rw-r--r-- | source3/include/proto.h | 17 | ||||
-rw-r--r-- | source3/include/smb.h | 5 |
3 files changed, 21 insertions, 13 deletions
diff --git a/source3/include/includes.h b/source3/include/includes.h index 09c687aed5..91a2ec5c67 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -214,6 +214,9 @@ Here come some platform specific sections #include <dirent.h> #include <string.h> #include <sys/vfs.h> +#include <sys/ipc.h> +#include <sys/sem.h> +#include <sys/shm.h> #include <netinet/in.h> #ifndef NO_ASMSIGNALH #include <asm/signal.h> @@ -233,6 +236,7 @@ Here come some platform specific sections #define HAVE_MEMMOVE #define USE_SIGPROCMASK #define USE_WAITPID +#define USE_SYSV_IPC #if 0 /* SETFS disabled until we can check on some bug reports */ #if _LINUX_C_LIB_VERSION_MAJOR >= 5 @@ -293,6 +297,9 @@ typedef unsigned short mode_t; #include <sys/statvfs.h> #include <sys/filio.h> #include <sys/sockio.h> +#include <sys/ipc.h> +#include <sys/sem.h> +#include <sys/shm.h> #include <netinet/in_systm.h> #include <netinet/tcp.h> #include <netinet/ip.h> @@ -317,6 +324,7 @@ extern int innetgr (const char *, const char *, const char *, const char *); #define USE_STATVFS #define USE_GETCWD #define USE_SETSID +#define USE_SYSV_IPC #ifndef REPLACE_GETPASS #define REPLACE_GETPASS #endif /* REPLACE_GETPASS */ @@ -548,6 +556,9 @@ char *mktemp(char *); /* No standard include */ #include <sys/types.h> #include <sys/termios.h> #include <netinet/tcp.h> +#include <sys/ipc.h> +#include <sys/sem.h> +#include <sys/shm.h> #ifdef HPUX_10_TRUSTED #include <hpsecurity.h> #include <prot.h> @@ -563,6 +574,7 @@ char *mktemp(char *); /* No standard include */ #define USE_GETCWD #define USE_SETSID #define USE_SETRES +#define USE_SYSV_IPC #define DEFAULT_PRINTING PRINT_HPUX /* Ken Weiss <krweiss@ucdavis.edu> tells us that SIGCLD_IGNORE is not good for HPUX */ diff --git a/source3/include/proto.h b/source3/include/proto.h index 669ed5fd8d..13368c873d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -878,18 +878,11 @@ int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); /*The following definitions come from shmem.c */ -BOOL smb_shm_open(char *file_name, int size, int ronly); -BOOL smb_shm_close( void ); -int smb_shm_alloc(int size); -BOOL smb_shm_free(int offset); -int smb_shm_get_userdef_off(void); -void *smb_shm_offset2addr(int offset); -int smb_shm_addr2offset(void *addr); -BOOL smb_shm_lock_hash_entry( unsigned int entry); -BOOL smb_shm_unlock_hash_entry( unsigned int entry ); -BOOL smb_shm_get_usage(int *bytes_free, - int *bytes_used, - int *bytes_overhead); +struct shmem_ops *smb_shm_open(char *file_name, int size, int ronly); + +/*The following definitions come from shmem_sysv.c */ + +struct shmem_ops *sysv_shm_open(int size, int ronly); /*The following definitions come from smbdes.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index 057a0b7550..d7a576de85 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -46,8 +46,12 @@ /* Default number of hash buckets used in shared memory share mode */ #ifndef SHMEM_HASH_SIZE +#ifdef SEMMSL +#define SHMEM_HASH_SIZE (SEMMSL-1) +#else #define SHMEM_HASH_SIZE 113 #endif +#endif #define NMB_PORT 137 #define DGRAM_PORT 138 @@ -1328,7 +1332,6 @@ struct share_ops { /* each implementation of the shared memory code needs to support the following operations */ struct shmem_ops { - BOOL (*open)(char *, int ); BOOL (*close)( void ); int (*alloc)(int ); BOOL (*free)(int ); |