17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * Copyright (c) 1998-2001, 2003 Sendmail, Inc. and its suppliers. 37c478bd9Sstevel@tonic-gate * All rights reserved. 47c478bd9Sstevel@tonic-gate * 57c478bd9Sstevel@tonic-gate * By using this file, you agree to the terms and conditions set 67c478bd9Sstevel@tonic-gate * forth in the LICENSE file which can be found at the top level of 77c478bd9Sstevel@tonic-gate * the sendmail distribution. 87c478bd9Sstevel@tonic-gate * 9*4aac33d3Sjbeck * $Id: errstring.h,v 1.10 2007/03/21 23:56:19 ca Exp $ 107c478bd9Sstevel@tonic-gate */ 117c478bd9Sstevel@tonic-gate 127c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 137c478bd9Sstevel@tonic-gate 147c478bd9Sstevel@tonic-gate /* 157c478bd9Sstevel@tonic-gate ** Error codes. 167c478bd9Sstevel@tonic-gate */ 177c478bd9Sstevel@tonic-gate 187c478bd9Sstevel@tonic-gate #ifndef SM_ERRSTRING_H 197c478bd9Sstevel@tonic-gate # define SM_ERRSTRING_H 207c478bd9Sstevel@tonic-gate 21*4aac33d3Sjbeck #if defined(__QNX__) 22*4aac33d3Sjbeck # define E_PSEUDOBASE 512 23*4aac33d3Sjbeck #endif /* defined(__QNX__) */ 24*4aac33d3Sjbeck 257c478bd9Sstevel@tonic-gate #include <errno.h> 267c478bd9Sstevel@tonic-gate #if NEEDINTERRNO 277c478bd9Sstevel@tonic-gate extern int errno; 287c478bd9Sstevel@tonic-gate #endif /* NEEDINTERRNO */ 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate /* 317c478bd9Sstevel@tonic-gate ** These are used in a few cases where we need some special 327c478bd9Sstevel@tonic-gate ** error codes, but where the system doesn't provide something 337c478bd9Sstevel@tonic-gate ** reasonable. They are printed in sm_errstring. 347c478bd9Sstevel@tonic-gate */ 357c478bd9Sstevel@tonic-gate 367c478bd9Sstevel@tonic-gate #ifndef E_PSEUDOBASE 377c478bd9Sstevel@tonic-gate # define E_PSEUDOBASE 256 387c478bd9Sstevel@tonic-gate #endif /* ! E_PSEUDOBASE */ 397c478bd9Sstevel@tonic-gate 407c478bd9Sstevel@tonic-gate #define E_SM_OPENTIMEOUT (E_PSEUDOBASE + 0) /* Timeout on file open */ 417c478bd9Sstevel@tonic-gate #define E_SM_NOSLINK (E_PSEUDOBASE + 1) /* Symbolic links not allowed */ 427c478bd9Sstevel@tonic-gate #define E_SM_NOHLINK (E_PSEUDOBASE + 2) /* Hard links not allowed */ 437c478bd9Sstevel@tonic-gate #define E_SM_REGONLY (E_PSEUDOBASE + 3) /* Regular files only */ 447c478bd9Sstevel@tonic-gate #define E_SM_ISEXEC (E_PSEUDOBASE + 4) /* Executable files not allowed */ 457c478bd9Sstevel@tonic-gate #define E_SM_WWDIR (E_PSEUDOBASE + 5) /* World writable directory */ 467c478bd9Sstevel@tonic-gate #define E_SM_GWDIR (E_PSEUDOBASE + 6) /* Group writable directory */ 477c478bd9Sstevel@tonic-gate #define E_SM_FILECHANGE (E_PSEUDOBASE + 7) /* File changed after open */ 487c478bd9Sstevel@tonic-gate #define E_SM_WWFILE (E_PSEUDOBASE + 8) /* World writable file */ 497c478bd9Sstevel@tonic-gate #define E_SM_GWFILE (E_PSEUDOBASE + 9) /* Group writable file */ 507c478bd9Sstevel@tonic-gate #define E_SM_GRFILE (E_PSEUDOBASE + 10) /* g readable file */ 517c478bd9Sstevel@tonic-gate #define E_SM_WRFILE (E_PSEUDOBASE + 11) /* o readable file */ 527c478bd9Sstevel@tonic-gate #define E_DNSBASE (E_PSEUDOBASE + 20) /* base for DNS h_errno */ 537c478bd9Sstevel@tonic-gate #define E_SMDBBASE (E_PSEUDOBASE + 40) /* base for libsmdb errors */ 547c478bd9Sstevel@tonic-gate #define E_LDAPBASE (E_PSEUDOBASE + 70) /* base for LDAP errors */ 557c478bd9Sstevel@tonic-gate #define E_LDAPURLBASE (E_PSEUDOBASE + 200) /* base for LDAP URL errors */ 567c478bd9Sstevel@tonic-gate 577c478bd9Sstevel@tonic-gate 587c478bd9Sstevel@tonic-gate /* libsmdb */ 597c478bd9Sstevel@tonic-gate #define SMDBE_OK 0 607c478bd9Sstevel@tonic-gate #define SMDBE_MALLOC (E_SMDBBASE + 1) 617c478bd9Sstevel@tonic-gate #define SMDBE_GDBM_IS_BAD (E_SMDBBASE + 2) 627c478bd9Sstevel@tonic-gate #define SMDBE_UNSUPPORTED (E_SMDBBASE + 3) 637c478bd9Sstevel@tonic-gate #define SMDBE_DUPLICATE (E_SMDBBASE + 4) 647c478bd9Sstevel@tonic-gate #define SMDBE_BAD_OPEN (E_SMDBBASE + 5) 657c478bd9Sstevel@tonic-gate #define SMDBE_NOT_FOUND (E_SMDBBASE + 6) 667c478bd9Sstevel@tonic-gate #define SMDBE_UNKNOWN_DB_TYPE (E_SMDBBASE + 7) 677c478bd9Sstevel@tonic-gate #define SMDBE_UNSUPPORTED_DB_TYPE (E_SMDBBASE + 8) 687c478bd9Sstevel@tonic-gate #define SMDBE_INCOMPLETE (E_SMDBBASE + 9) 697c478bd9Sstevel@tonic-gate #define SMDBE_KEY_EMPTY (E_SMDBBASE + 10) 707c478bd9Sstevel@tonic-gate #define SMDBE_KEY_EXIST (E_SMDBBASE + 11) 717c478bd9Sstevel@tonic-gate #define SMDBE_LOCK_DEADLOCK (E_SMDBBASE + 12) 727c478bd9Sstevel@tonic-gate #define SMDBE_LOCK_NOT_GRANTED (E_SMDBBASE + 13) 737c478bd9Sstevel@tonic-gate #define SMDBE_LOCK_NOT_HELD (E_SMDBBASE + 14) 747c478bd9Sstevel@tonic-gate #define SMDBE_RUN_RECOVERY (E_SMDBBASE + 15) 757c478bd9Sstevel@tonic-gate #define SMDBE_IO_ERROR (E_SMDBBASE + 16) 767c478bd9Sstevel@tonic-gate #define SMDBE_READ_ONLY (E_SMDBBASE + 17) 777c478bd9Sstevel@tonic-gate #define SMDBE_DB_NAME_TOO_LONG (E_SMDBBASE + 18) 787c478bd9Sstevel@tonic-gate #define SMDBE_INVALID_PARAMETER (E_SMDBBASE + 19) 797c478bd9Sstevel@tonic-gate #define SMDBE_ONLY_SUPPORTS_ONE_CURSOR (E_SMDBBASE + 20) 807c478bd9Sstevel@tonic-gate #define SMDBE_NOT_A_VALID_CURSOR (E_SMDBBASE + 21) 817c478bd9Sstevel@tonic-gate #define SMDBE_LAST_ENTRY (E_SMDBBASE + 22) 827c478bd9Sstevel@tonic-gate #define SMDBE_OLD_VERSION (E_SMDBBASE + 23) 837c478bd9Sstevel@tonic-gate #define SMDBE_VERSION_MISMATCH (E_SMDBBASE + 24) 847c478bd9Sstevel@tonic-gate 857c478bd9Sstevel@tonic-gate extern const char *sm_errstring __P((int _errno)); 867c478bd9Sstevel@tonic-gate 877c478bd9Sstevel@tonic-gate 887c478bd9Sstevel@tonic-gate #endif /* SM_ERRSTRING_H */ 89