15dd76dd0SGregory Neil Shapiro# Copyright (c) 2000-2002 Proofpoint, Inc. and its suppliers. 240266059SGregory Neil Shapiro# All rights reserved. 340266059SGregory Neil Shapiro# 440266059SGregory Neil Shapiro# By using this file, you agree to the terms and conditions set 540266059SGregory Neil Shapiro# forth in the LICENSE file which can be found at the top level of 640266059SGregory Neil Shapiro# the sendmail distribution. 740266059SGregory Neil Shapiro# 84313cc83SGregory Neil Shapiro# $Id: README,v 1.25 2013-11-22 20:51:42 ca Exp $ 940266059SGregory Neil Shapiro# 1040266059SGregory Neil Shapiro 1140266059SGregory Neil ShapiroLibsm is a library of generally useful C abstractions. 1240266059SGregory Neil ShapiroFor documentation, see index.html. 1340266059SGregory Neil Shapiro 1440266059SGregory Neil ShapiroLibsm stands alone; it depends on no other sendmail libraries, 1540266059SGregory Neil Shapiroand the only sendmail header files it depends on are its own, 1640266059SGregory Neil Shapirowhich reside in ../include/sm. 1740266059SGregory Neil Shapiro 1840266059SGregory Neil ShapiroThe t-*.c files are regression tests. 1940266059SGregory Neil ShapiroThese tests are incomplete: we do not yet test all of the APIs, 2040266059SGregory Neil Shapiroand we have not yet converted all tests to use the test harness. 2140266059SGregory Neil ShapiroIf a test fails read the explanation it generates. Sometimes it 2240266059SGregory Neil Shapirois sufficient to change a compile time flag, which are also listed 2340266059SGregory Neil Shapirobelow. If that does not help, check the sendmail/README files for 2440266059SGregory Neil Shapiroproblems on your OS. 2540266059SGregory Neil Shapiro 2640266059SGregory Neil ShapiroThe b-*.c files are benchmarks that compare system routines with 2740266059SGregory Neil Shapirothose provided by libsm. By default sendmail uses the routines 2840266059SGregory Neil Shapiroprovided by the OS. In several cases, the routines provided by 2940266059SGregory Neil Shapirolibsm are faster than those of the OS. If your OS provides the 3040266059SGregory Neil Shapiroroutines, you can compare the performance of them with the libsm 3140266059SGregory Neil Shapiroversions by running the programs with the option -d (by default 3240266059SGregory Neil Shapirothe programs just issue an explanation when/how to use them). 3340266059SGregory Neil ShapiroThe programs are: 3440266059SGregory Neil Shapiro 3540266059SGregory Neil Shapirob-strcmp.c tests strcasecmp(). 3640266059SGregory Neil Shapiro 37*d39bd2c1SGregory Neil Shapiro 3840266059SGregory Neil Shapiro+----------------------+ 3940266059SGregory Neil Shapiro| CONFIGURATION MACROS | 4040266059SGregory Neil Shapiro+----------------------+ 4140266059SGregory Neil Shapiro 4240266059SGregory Neil ShapiroLibsm uses a set of C preprocessor macros to specify platform specific 4340266059SGregory Neil Shapirofeatures of the C compiler and standard C libraries. 4440266059SGregory Neil Shapiro 4540266059SGregory Neil ShapiroIf you are porting sendmail to a new platform, you may need to tweak 4640266059SGregory Neil Shapirothe values of some of these macros. 4740266059SGregory Neil Shapiro 4840266059SGregory Neil ShapiroThe following macros are given default values in <sm/config.h>. 4940266059SGregory Neil ShapiroIf the default value is wrong for a given platform, then a platform 5040266059SGregory Neil Shapirospecific value is specified in one of two ways: 5140266059SGregory Neil Shapiro 5240266059SGregory Neil Shapiro - A -D option is added to the confENVDEF macro; this change can be made 5340266059SGregory Neil Shapiro to the platform M4 file in devtools/OS, or to the site.config.m4 5440266059SGregory Neil Shapiro file in devtools/Site. 5540266059SGregory Neil Shapiro 5640266059SGregory Neil Shapiro - The confSM_OS_HEADER macro in the platform M4 file defines sm_os_foo, 5740266059SGregory Neil Shapiro which forces "sm/os/sm_os_foo.h" to be included by "sm/config.h" via a 5840266059SGregory Neil Shapiro link that is made from "sm_os.h" to "sm/os/sm_os_foo.h". Platform 5940266059SGregory Neil Shapiro specific configuration macro settings are added to <sm/os/sm_os_foo.h>. 6040266059SGregory Neil Shapiro 6140266059SGregory Neil ShapiroSM_CONF_STDBOOL_H 6240266059SGregory Neil Shapiro Set to 1 if the header file <stdbool.h> exists, 6340266059SGregory Neil Shapiro and defines true, false and bool. 6440266059SGregory Neil Shapiro 6540266059SGregory Neil ShapiroSM_CONF_SYS_CDEFS_H 6640266059SGregory Neil Shapiro Set to 1 if the header file <sys/cdefs.h> exists, 6740266059SGregory Neil Shapiro and defines __P. You may need to do this to eliminate 6840266059SGregory Neil Shapiro warnings about __P being multiply defined. 6940266059SGregory Neil Shapiro 7040266059SGregory Neil ShapiroSM_CONF_STDDEF_H 7140266059SGregory Neil Shapiro Set to 0 if the header file <stddef.h> does not exist. 7240266059SGregory Neil Shapiro 7340266059SGregory Neil ShapiroSM_CONF_SETITIMER 7440266059SGregory Neil Shapiro Set to 0 if the setitimer function is not available. 7540266059SGregory Neil Shapiro 7640266059SGregory Neil ShapiroSM_CONF_SYSEXITS_H 7740266059SGregory Neil Shapiro Set to 1 if <sysexits.h> exists, and sets the EX_* macros 7840266059SGregory Neil Shapiro to values different from the default BSD values in <sm/sysexits.h>. 7940266059SGregory Neil Shapiro 8040266059SGregory Neil ShapiroSM_CONF_UID_GID 8140266059SGregory Neil Shapiro Set to 0 if <sys/types.h> does not define uid_t and gid_t. 8240266059SGregory Neil Shapiro 8340266059SGregory Neil ShapiroSM_CONF_SSIZE_T 8440266059SGregory Neil Shapiro Set to 0 if <sys/types.h> does not define ssize_t. 8540266059SGregory Neil Shapiro 8640266059SGregory Neil ShapiroSM_CONF_BROKEN_SIZE_T 8740266059SGregory Neil Shapiro Set to 1 if size_t is not unsigned. 8840266059SGregory Neil Shapiro 8940266059SGregory Neil ShapiroSM_CONF_LONGLONG 9040266059SGregory Neil Shapiro Set to 1 if your C compiler supports the 'long long' type. 9140266059SGregory Neil Shapiro This will be set automatically if you use gcc or a C compiler 9240266059SGregory Neil Shapiro that conforms to the 1999 ISO C standard. 9340266059SGregory Neil Shapiro 9440266059SGregory Neil ShapiroSM_CONF_QUAD_T 9540266059SGregory Neil Shapiro Set to 1 if your C compiler does not support 'long long', 9640266059SGregory Neil Shapiro but <sys/types.h> defines quad_t as an integral type. 9740266059SGregory Neil Shapiro 9840266059SGregory Neil ShapiroSM_CONF_SHM 9940266059SGregory Neil Shapiro Set to 1 if System V shared memory APIs are available. 10040266059SGregory Neil Shapiro 10140266059SGregory Neil ShapiroSM_CONF_MSG 10240266059SGregory Neil Shapiro Set to 1 if System V message queues are available. 10340266059SGregory Neil Shapiro 10440266059SGregory Neil ShapiroSM_CONF_SEM 10540266059SGregory Neil Shapiro Set to 1 if semaphores are available. 10640266059SGregory Neil Shapiro 10740266059SGregory Neil ShapiroSM_CONF_BROKEN_STRTOD 10840266059SGregory Neil Shapiro Set to 1 if your strtod() does not work properly. 10940266059SGregory Neil Shapiro 110e92d3f3fSGregory Neil ShapiroSM_CONF_LDAP_INITIALIZE 111e92d3f3fSGregory Neil Shapiro Set to 1 if your LDAP client libraries include ldap_initialize(3). 112e92d3f3fSGregory Neil Shapiro 113605302a5SGregory Neil ShapiroSM_CONF_LDAP_MEMFREE 114605302a5SGregory Neil Shapiro Set to 1 if your LDAP client libraries include ldap_memfree(3). 115605302a5SGregory Neil Shapiro 11640266059SGregory Neil ShapiroSM_IO_MAX_BUF_FILE 11740266059SGregory Neil Shapiro Set this to a useful buffer size for regular files if stat(2) 11840266059SGregory Neil Shapiro does not return a value for st_blksize that is the 11940266059SGregory Neil Shapiro "optimal blocksize for I/O". 12040266059SGregory Neil Shapiro 12140266059SGregory Neil ShapiroSM_IO_MAX_BUF 12240266059SGregory Neil Shapiro Set this to a useful maximum buffer size for other than 12340266059SGregory Neil Shapiro regular files if stat(2) does not return a value for 12440266059SGregory Neil Shapiro st_blksize that is the "optimal blocksize for I/O". 12540266059SGregory Neil Shapiro 12640266059SGregory Neil ShapiroSM_IO_MIN_BUF 12740266059SGregory Neil Shapiro Set this to a useful minimum buffer size for other than 12840266059SGregory Neil Shapiro regular files if stat(2) does not return a value for 12940266059SGregory Neil Shapiro st_blksize that is the "optimal blocksize for I/O". 13040266059SGregory Neil Shapiro 131