190792Sgshapiro/* 2261363Sgshapiro * Copyright (c) 1998-2001, 2003 Proofpoint, Inc. and its suppliers. 390792Sgshapiro * All rights reserved. 490792Sgshapiro * 590792Sgshapiro * By using this file, you agree to the terms and conditions set 690792Sgshapiro * forth in the LICENSE file which can be found at the top level of 790792Sgshapiro * the sendmail distribution. 890792Sgshapiro * 9266692Sgshapiro * $Id: errstring.h,v 1.11 2013-11-22 20:51:31 ca Exp $ 1090792Sgshapiro */ 1190792Sgshapiro 1290792Sgshapiro/* 1390792Sgshapiro** Error codes. 1490792Sgshapiro*/ 1590792Sgshapiro 1690792Sgshapiro#ifndef SM_ERRSTRING_H 1790792Sgshapiro# define SM_ERRSTRING_H 1890792Sgshapiro 19168515Sgshapiro#if defined(__QNX__) 20168515Sgshapiro# define E_PSEUDOBASE 512 21168515Sgshapiro#endif /* defined(__QNX__) */ 22168515Sgshapiro 2390792Sgshapiro#include <errno.h> 24132943Sgshapiro#if NEEDINTERRNO 2590792Sgshapiroextern int errno; 26132943Sgshapiro#endif /* NEEDINTERRNO */ 2790792Sgshapiro 2890792Sgshapiro/* 2990792Sgshapiro** These are used in a few cases where we need some special 3090792Sgshapiro** error codes, but where the system doesn't provide something 3190792Sgshapiro** reasonable. They are printed in sm_errstring. 3290792Sgshapiro*/ 3390792Sgshapiro 3490792Sgshapiro#ifndef E_PSEUDOBASE 3590792Sgshapiro# define E_PSEUDOBASE 256 3690792Sgshapiro#endif /* ! E_PSEUDOBASE */ 3790792Sgshapiro 3890792Sgshapiro#define E_SM_OPENTIMEOUT (E_PSEUDOBASE + 0) /* Timeout on file open */ 3990792Sgshapiro#define E_SM_NOSLINK (E_PSEUDOBASE + 1) /* Symbolic links not allowed */ 4090792Sgshapiro#define E_SM_NOHLINK (E_PSEUDOBASE + 2) /* Hard links not allowed */ 4190792Sgshapiro#define E_SM_REGONLY (E_PSEUDOBASE + 3) /* Regular files only */ 4290792Sgshapiro#define E_SM_ISEXEC (E_PSEUDOBASE + 4) /* Executable files not allowed */ 4390792Sgshapiro#define E_SM_WWDIR (E_PSEUDOBASE + 5) /* World writable directory */ 4490792Sgshapiro#define E_SM_GWDIR (E_PSEUDOBASE + 6) /* Group writable directory */ 4590792Sgshapiro#define E_SM_FILECHANGE (E_PSEUDOBASE + 7) /* File changed after open */ 4690792Sgshapiro#define E_SM_WWFILE (E_PSEUDOBASE + 8) /* World writable file */ 4790792Sgshapiro#define E_SM_GWFILE (E_PSEUDOBASE + 9) /* Group writable file */ 4890792Sgshapiro#define E_SM_GRFILE (E_PSEUDOBASE + 10) /* g readable file */ 4990792Sgshapiro#define E_SM_WRFILE (E_PSEUDOBASE + 11) /* o readable file */ 5090792Sgshapiro#define E_DNSBASE (E_PSEUDOBASE + 20) /* base for DNS h_errno */ 5190792Sgshapiro#define E_SMDBBASE (E_PSEUDOBASE + 40) /* base for libsmdb errors */ 5290792Sgshapiro#define E_LDAPBASE (E_PSEUDOBASE + 70) /* base for LDAP errors */ 53132943Sgshapiro#define E_LDAPURLBASE (E_PSEUDOBASE + 200) /* base for LDAP URL errors */ 5490792Sgshapiro 55120256Sgshapiro 5690792Sgshapiro/* libsmdb */ 5790792Sgshapiro#define SMDBE_OK 0 5890792Sgshapiro#define SMDBE_MALLOC (E_SMDBBASE + 1) 5990792Sgshapiro#define SMDBE_GDBM_IS_BAD (E_SMDBBASE + 2) 6090792Sgshapiro#define SMDBE_UNSUPPORTED (E_SMDBBASE + 3) 6190792Sgshapiro#define SMDBE_DUPLICATE (E_SMDBBASE + 4) 6290792Sgshapiro#define SMDBE_BAD_OPEN (E_SMDBBASE + 5) 6390792Sgshapiro#define SMDBE_NOT_FOUND (E_SMDBBASE + 6) 6490792Sgshapiro#define SMDBE_UNKNOWN_DB_TYPE (E_SMDBBASE + 7) 6590792Sgshapiro#define SMDBE_UNSUPPORTED_DB_TYPE (E_SMDBBASE + 8) 6690792Sgshapiro#define SMDBE_INCOMPLETE (E_SMDBBASE + 9) 6790792Sgshapiro#define SMDBE_KEY_EMPTY (E_SMDBBASE + 10) 6890792Sgshapiro#define SMDBE_KEY_EXIST (E_SMDBBASE + 11) 6990792Sgshapiro#define SMDBE_LOCK_DEADLOCK (E_SMDBBASE + 12) 7090792Sgshapiro#define SMDBE_LOCK_NOT_GRANTED (E_SMDBBASE + 13) 7190792Sgshapiro#define SMDBE_LOCK_NOT_HELD (E_SMDBBASE + 14) 7290792Sgshapiro#define SMDBE_RUN_RECOVERY (E_SMDBBASE + 15) 7390792Sgshapiro#define SMDBE_IO_ERROR (E_SMDBBASE + 16) 7490792Sgshapiro#define SMDBE_READ_ONLY (E_SMDBBASE + 17) 7590792Sgshapiro#define SMDBE_DB_NAME_TOO_LONG (E_SMDBBASE + 18) 7690792Sgshapiro#define SMDBE_INVALID_PARAMETER (E_SMDBBASE + 19) 7790792Sgshapiro#define SMDBE_ONLY_SUPPORTS_ONE_CURSOR (E_SMDBBASE + 20) 7890792Sgshapiro#define SMDBE_NOT_A_VALID_CURSOR (E_SMDBBASE + 21) 7990792Sgshapiro#define SMDBE_LAST_ENTRY (E_SMDBBASE + 22) 8090792Sgshapiro#define SMDBE_OLD_VERSION (E_SMDBBASE + 23) 81120256Sgshapiro#define SMDBE_VERSION_MISMATCH (E_SMDBBASE + 24) 8290792Sgshapiro 83120256Sgshapiroextern const char *sm_errstring __P((int _errno)); 8490792Sgshapiro 85120256Sgshapiro 8690792Sgshapiro#endif /* SM_ERRSTRING_H */ 87