summaryrefslogtreecommitdiff
path: root/defines.h
diff options
context:
space:
mode:
Diffstat (limited to 'defines.h')
-rw-r--r--defines.h58
1 files changed, 50 insertions, 8 deletions
diff --git a/defines.h b/defines.h
index 73fbe077b..e662966fb 100644
--- a/defines.h
+++ b/defines.h
@@ -1,7 +1,31 @@
1/*
2 * Copyright (c) 1999-2003 Damien Miller. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */
24
1#ifndef _DEFINES_H 25#ifndef _DEFINES_H
2#define _DEFINES_H 26#define _DEFINES_H
3 27
4/* $Id: defines.h,v 1.97 2003/01/24 00:50:32 djm Exp $ */ 28/* $Id: defines.h,v 1.103 2003/09/16 01:52:19 dtucker Exp $ */
5 29
6 30
7/* Constants */ 31/* Constants */
@@ -188,28 +212,21 @@ typedef unsigned long u_int32_t;
188#ifndef HAVE_INT64_T 212#ifndef HAVE_INT64_T
189# if (SIZEOF_LONG_INT == 8) 213# if (SIZEOF_LONG_INT == 8)
190typedef long int int64_t; 214typedef long int int64_t;
191# define HAVE_INT64_T 1
192# else 215# else
193# if (SIZEOF_LONG_LONG_INT == 8) 216# if (SIZEOF_LONG_LONG_INT == 8)
194typedef long long int int64_t; 217typedef long long int int64_t;
195# define HAVE_INT64_T 1
196# endif 218# endif
197# endif 219# endif
198#endif 220#endif
199#ifndef HAVE_U_INT64_T 221#ifndef HAVE_U_INT64_T
200# if (SIZEOF_LONG_INT == 8) 222# if (SIZEOF_LONG_INT == 8)
201typedef unsigned long int u_int64_t; 223typedef unsigned long int u_int64_t;
202# define HAVE_U_INT64_T 1
203# else 224# else
204# if (SIZEOF_LONG_LONG_INT == 8) 225# if (SIZEOF_LONG_LONG_INT == 8)
205typedef unsigned long long int u_int64_t; 226typedef unsigned long long int u_int64_t;
206# define HAVE_U_INT64_T 1
207# endif 227# endif
208# endif 228# endif
209#endif 229#endif
210#if !defined(HAVE_LONG_LONG_INT) && (SIZEOF_LONG_LONG_INT == 8)
211# define HAVE_LONG_LONG_INT 1
212#endif
213 230
214#ifndef HAVE_U_CHAR 231#ifndef HAVE_U_CHAR
215typedef unsigned char u_char; 232typedef unsigned char u_char;
@@ -304,6 +321,10 @@ struct winsize {
304# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" 321# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
305#endif 322#endif
306 323
324#ifndef SUPERUSER_PATH
325# define SUPERUSER_PATH _PATH_STDPATH
326#endif
327
307#ifndef _PATH_DEVNULL 328#ifndef _PATH_DEVNULL
308# define _PATH_DEVNULL "/dev/null" 329# define _PATH_DEVNULL "/dev/null"
309#endif 330#endif
@@ -420,6 +441,23 @@ struct winsize {
420#define CMSG_SPACE(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(len)) 441#define CMSG_SPACE(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(len))
421#endif 442#endif
422 443
444/* given pointer to struct cmsghdr, return pointer to data */
445#ifndef CMSG_DATA
446#define CMSG_DATA(cmsg) ((u_char *)(cmsg) + __CMSG_ALIGN(sizeof(struct cmsghdr)))
447#endif /* CMSG_DATA */
448
449/*
450 * RFC 2292 requires to check msg_controllen, in case that the kernel returns
451 * an empty list for some reasons.
452 */
453#ifndef CMSG_FIRSTHDR
454#define CMSG_FIRSTHDR(mhdr) \
455 ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
456 (struct cmsghdr *)(mhdr)->msg_control : \
457 (struct cmsghdr *)NULL)
458#endif /* CMSG_FIRSTHDR */
459
460
423/* Function replacement / compatibility hacks */ 461/* Function replacement / compatibility hacks */
424 462
425#if !defined(HAVE_GETADDRINFO) && (defined(HAVE_OGETADDRINFO) || defined(HAVE_NGETADDRINFO)) 463#if !defined(HAVE_GETADDRINFO) && (defined(HAVE_OGETADDRINFO) || defined(HAVE_NGETADDRINFO))
@@ -487,6 +525,10 @@ struct winsize {
487# define __func__ "" 525# define __func__ ""
488#endif 526#endif
489 527
528#if defined(KRB5) && !defined(HEIMDAL)
529# define krb5_get_err_text(context,code) error_message(code)
530#endif
531
490/* 532/*
491 * Define this to use pipes instead of socketpairs for communicating with the 533 * Define this to use pipes instead of socketpairs for communicating with the
492 * client program. Socketpairs do not seem to work on all systems. 534 * client program. Socketpairs do not seem to work on all systems.