make the default printing model on all Linux systems BSD
[Samba/gbeck.git] / source / include / includes.h
blob3b8339e8fc80774793c6ff3d16ade491912c28d1
1 #ifndef _INCLUDES_H
2 #define _INCLUDES_H
3 /*
4 Unix SMB/Netbios implementation.
5 Version 1.9.
6 Machine customisation and include handling
7 Copyright (C) Andrew Tridgell 1994-1998
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #ifndef NO_CONFIG_H /* for some tests */
25 #include "config.h"
26 #endif
28 #include "local.h"
30 #ifdef AIX
31 #define DEFAULT_PRINTING PRINT_AIX
32 #define PRINTCAP_NAME "/etc/qconfig"
33 #endif
35 #ifdef HPUX
36 #define DEFAULT_PRINTING PRINT_HPUX
37 #endif
39 #ifdef QNX
40 #define DEFAULT_PRINTING PRINT_QNX
41 #endif
43 #ifdef SUNOS4
44 /* on SUNOS4 termios.h conflicts with sys/ioctl.h */
45 #undef HAVE_TERMIOS_H
46 #endif
48 #ifdef LINUX
49 #define DEFAULT_PRINTING PRINT_BSD
50 #define PRINTCAP_NAME "/etc/printcap"
51 #endif
53 #ifdef RELIANTUNIX
55 * <unistd.h> has to be included before any other to get
56 * large file support on Reliant UNIX
58 #ifdef HAVE_UNISTD_H
59 #include <unistd.h>
60 #endif
61 #endif /* RELIANTUNIX */
63 #ifdef HAVE_SYSV_IPC
64 #define USE_SYSV_IPC
65 #endif
67 #ifdef HAVE_SHARED_MMAP
68 #define USE_SHARED_MMAP
69 #endif
72 /* if we have both SYSV IPC and shared mmap then we need to choose */
73 #if (defined(USE_SYSV_IPC) && defined(USE_SHARED_MMAP))
74 # undef USE_SHARED_MMAP
75 #endif
77 #include <sys/types.h>
79 #ifdef TIME_WITH_SYS_TIME
80 #include <sys/time.h>
81 #include <time.h>
82 #else
83 #ifdef HAVE_SYS_TIME_H
84 #include <sys/time.h>
85 #else
86 #include <time.h>
87 #endif
88 #endif
90 #ifdef HAVE_SYS_RESOURCE_H
91 #include <sys/resource.h>
92 #endif
94 #ifdef HAVE_UNISTD_H
95 #include <unistd.h>
96 #endif
98 #include <stdio.h>
99 #include <stddef.h>
101 #ifdef HAVE_SYS_PARAM_H
102 #include <sys/param.h>
103 #endif
105 #ifdef HAVE_STDLIB_H
106 #include <stdlib.h>
107 #endif
109 #ifdef HAVE_SYS_SOCKET_H
110 #include <sys/socket.h>
111 #endif
113 #ifdef HAVE_SYS_SYSCALL_H
114 #include <sys/syscall.h>
115 #elif HAVE_SYSCALL_H
116 #include <syscall.h>
117 #endif
119 #ifdef HAVE_STRING_H
120 #include <string.h>
121 #endif
123 #ifdef HAVE_STRINGS_H
124 #include <strings.h>
125 #endif
127 #ifdef HAVE_MEMORY_H
128 #include <memory.h>
129 #endif
131 #ifdef MEM_MAN
132 #include "../mem_man/mem_man.h"
133 #else
134 #ifdef HAVE_MALLOC_H
135 #include <malloc.h>
136 #endif
137 #endif
139 #ifdef HAVE_FCNTL_H
140 #include <fcntl.h>
141 #else
142 #ifdef HAVE_SYS_FCNTL_H
143 #include <sys/fcntl.h>
144 #endif
145 #endif
147 #include <sys/stat.h>
149 #ifdef HAVE_LIMITS_H
150 #include <limits.h>
151 #endif
153 #ifdef HAVE_SYS_IOCTL_H
154 #include <sys/ioctl.h>
155 #endif
157 #ifdef HAVE_SYS_FILIO_H
158 #include <sys/filio.h>
159 #endif
161 #include <signal.h>
163 #ifdef HAVE_SYS_WAIT_H
164 #include <sys/wait.h>
165 #endif
166 #ifdef HAVE_CTYPE_H
167 #include <ctype.h>
168 #endif
169 #ifdef HAVE_GRP_H
170 #include <grp.h>
171 #endif
172 #ifdef HAVE_SYS_ID_H
173 #include <sys/id.h>
174 #endif
176 /* AIX 4.1 and previous needs this for setpriv */
177 #if defined(HAVE_SETPRIV) && defined(HAVE_SYS_PRIV_H)
178 #include <sys/priv.h>
179 #endif
181 #include <errno.h>
183 #ifdef HAVE_UTIME_H
184 #include <utime.h>
185 #endif
187 #ifdef HAVE_SYS_SELECT_H
188 #include <sys/select.h>
189 #endif
191 #ifdef HAVE_SYS_MODE_H
192 /* apparently AIX needs this for S_ISLNK */
193 #ifndef S_ISLNK
194 #include <sys/mode.h>
195 #endif
196 #endif
198 #ifdef HAVE_GLOB_H
199 #include <glob.h>
200 #endif
202 #include <pwd.h>
203 #include <grp.h>
205 #ifdef HAVE_STDARG_H
206 #include <stdarg.h>
207 #else
208 #include <varargs.h>
209 #endif
211 #include <netinet/in.h>
212 #include <arpa/inet.h>
213 #include <netdb.h>
214 #include <syslog.h>
215 #include <sys/file.h>
217 #ifdef HAVE_NETINET_TCP_H
218 #include <netinet/tcp.h>
219 #endif
222 * The next three defines are needed to access the IPTOS_* options
223 * on some systems.
226 #ifdef HAVE_NETINET_IN_SYSTM_H
227 #include <netinet/in_systm.h>
228 #endif
230 #ifdef HAVE_NETINET_IN_IP_H
231 #include <netinet/in_ip.h>
232 #endif
234 #ifdef HAVE_NETINET_IP_H
235 #include <netinet/ip.h>
236 #endif
238 #if defined(HAVE_TERMIOS_H)
239 /* POSIX terminal handling. */
240 #include <termios.h>
241 #elif defined(HAVE_TERMIO_H)
242 /* Older SYSV terminal handling - don't use if we can avoid it. */
243 #include <termio.h>
244 #elif defined(HAVE_SYS_TERMIO_H)
245 /* Older SYSV terminal handling - don't use if we can avoid it. */
246 #include <sys/termio.h>
247 #endif
249 #if HAVE_DIRENT_H
250 # include <dirent.h>
251 # define NAMLEN(dirent) strlen((dirent)->d_name)
252 #else
253 # define dirent direct
254 # define NAMLEN(dirent) (dirent)->d_namlen
255 # if HAVE_SYS_NDIR_H
256 # include <sys/ndir.h>
257 # endif
258 # if HAVE_SYS_DIR_H
259 # include <sys/dir.h>
260 # endif
261 # if HAVE_NDIR_H
262 # include <ndir.h>
263 # endif
264 #endif
266 #ifdef HAVE_SYS_MMAN_H
267 #include <sys/mman.h>
268 #endif
270 #ifdef HAVE_SYSV_IPC
271 #include <sys/ipc.h>
272 #include <sys/shm.h>
273 #include <sys/sem.h>
274 #endif
276 #ifdef HAVE_NET_IF_H
277 #include <net/if.h>
278 #endif
281 #ifdef HAVE_SYS_MOUNT_H
282 #include <sys/mount.h>
283 #endif
285 #ifdef HAVE_SYS_VFS_H
286 #include <sys/vfs.h>
287 #endif
289 #ifdef HAVE_SYS_ACL_H
290 #include <sys/acl.h>
291 #endif
293 #ifdef HAVE_SYS_FS_S5PARAM_H
294 #include <sys/fs/s5param.h>
295 #endif
297 #if defined (HAVE_SYS_FILSYS_H) && !defined (_CRAY)
298 #include <sys/filsys.h>
299 #endif
301 #ifdef HAVE_SYS_STATFS_H
302 # include <sys/statfs.h>
303 #endif
305 #ifdef HAVE_DUSTAT_H
306 #include <sys/dustat.h>
307 #endif
309 #ifdef HAVE_SYS_STATVFS_H
310 #include <sys/statvfs.h>
311 #endif
313 #ifdef HAVE_SHADOW_H
314 #include <shadow.h>
315 #endif
317 #ifdef HAVE_GETPWANAM
318 #include <sys/label.h>
319 #include <sys/audit.h>
320 #include <pwdadj.h>
321 #endif
323 #ifdef HAVE_SYS_SECURITY_H
324 #include <sys/security.h>
325 #include <prot.h>
326 #define PASSWORD_LENGTH 16
327 #endif /* HAVE_SYS_SECURITY_H */
329 #ifdef HAVE_COMPAT_H
330 #include <compat.h>
331 #endif
333 #ifdef HAVE_STROPTS_H
334 #include <stropts.h>
335 #endif
337 #ifdef HAVE_POLL_H
338 #include <poll.h>
339 #endif
341 #ifdef HAVE_SYS_CAPABILITY_H
342 #include <sys/capability.h>
343 #endif
345 #if defined(HAVE_RPC_RPC_H)
347 * Check for AUTH_ERROR define conflict with rpc/rpc.h in prot.h.
349 #if defined(HAVE_SYS_SECURITY_H) && defined(HAVE_RPC_AUTH_ERROR_CONFLICT)
350 #undef AUTH_ERROR
351 #endif
352 #include <rpc/rpc.h>
353 #endif
355 #if defined(HAVE_YP_GET_DEFAULT_DOMAIN) && defined(HAVE_SETNETGRENT) && defined(HAVE_ENDNETGRENT) && defined(HAVE_GETNETGRENT)
356 #define HAVE_NETGROUP 1
357 #endif
359 #if defined (HAVE_NETGROUP)
360 #if defined(HAVE_RPCSVC_YP_PROT_H)
361 #include <rpcsvc/yp_prot.h>
362 #endif
363 #if defined(HAVE_RPCSVC_YPCLNT_H)
364 #include <rpcsvc/ypclnt.h>
365 #endif
366 #endif /* HAVE_NETGROUP */
369 * Define VOLATILE if needed.
372 #if defined(HAVE_VOLATILE)
373 #define VOLATILE volatile
374 #else
375 #define VOLATILE
376 #endif
379 * Define SIG_ATOMIC_T if needed.
382 #if defined(HAVE_SIG_ATOMIC_T_TYPE)
383 #define SIG_ATOMIC_T sig_atomic_t
384 #else
385 #define SIG_ATOMIC_T int
386 #endif
388 #ifndef uchar
389 #define uchar unsigned char
390 #endif
392 #ifdef HAVE_UNSIGNED_CHAR
393 #define schar signed char
394 #else
395 #define schar char
396 #endif
399 Samba needs type definitions for int16, int32, uint16 and uint32.
401 Normally these are signed and unsigned 16 and 32 bit integers, but
402 they actually only need to be at least 16 and 32 bits
403 respectively. Thus if your word size is 8 bytes just defining them
404 as signed and unsigned int will work.
407 #ifndef uint8
408 #define uint8 unsigned char
409 #endif
411 #if !defined(int16) && !defined(HAVE_INT16_FROM_RPC_RPC_H)
412 #if (SIZEOF_SHORT == 4)
413 #define int16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16;
414 #else /* SIZEOF_SHORT != 4 */
415 #define int16 short
416 #endif /* SIZEOF_SHORT != 4 */
417 #endif
420 * Note we duplicate the size tests in the unsigned
421 * case as int16 may be a typedef from rpc/rpc.h
424 #if !defined(uint16) && !defined(HAVE_UINT16_FROM_RPC_RPC_H)
425 #if (SIZEOF_SHORT == 4)
426 #define uint16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16;
427 #else /* SIZEOF_SHORT != 4 */
428 #define uint16 unsigned short
429 #endif /* SIZEOF_SHORT != 4 */
430 #endif
432 #if !defined(int32) && !defined(HAVE_INT32_FROM_RPC_RPC_H)
433 #if (SIZEOF_INT == 4)
434 #define int32 int
435 #elif (SIZEOF_LONG == 4)
436 #define int32 long
437 #elif (SIZEOF_SHORT == 4)
438 #define int32 short
439 #endif
440 #endif
443 * Note we duplicate the size tests in the unsigned
444 * case as int32 may be a typedef from rpc/rpc.h
447 #if !defined(uint32) && !defined(HAVE_UINT32_FROM_RPC_RPC_H)
448 #if (SIZEOF_INT == 4)
449 #define uint32 unsigned int
450 #elif (SIZEOF_LONG == 4)
451 #define uint32 unsigned long
452 #elif (SIZEOF_SHORT == 4)
453 #define uint32 unsigned short
454 #endif
455 #endif
458 * Types for devices, inodes and offsets.
461 #ifndef SMB_DEV_T
462 #define SMB_DEV_T dev_t
463 #endif
466 * Setup the correctly sized inode type.
469 #ifndef SMB_INO_T
470 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_INO64_T)
471 # define SMB_INO_T ino64_t
472 # else
473 # define SMB_INO_T ino_t
474 # endif
475 #endif
477 #ifndef LARGE_SMB_INO_T
478 # if (defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_INO64_T)) || (defined(SIZEOF_INO_T) && (SIZEOF_INO_T == 8))
479 # define LARGE_SMB_INO_T 1
480 # endif
481 #endif
483 #ifdef LARGE_SMB_INO_T
484 #define SINO_T(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,(v)>>32))
485 #else
486 #define SINO_T(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0))
487 #endif
489 #ifndef SMB_OFF_T
490 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_OFF64_T)
491 # define SMB_OFF_T off64_t
492 # else
493 # define SMB_OFF_T off_t
494 # endif
495 #endif
497 #define SMB_OFF_T_BITS (sizeof(SMB_OFF_T)*8)
500 * Set the define that tells us if we can do 64 bit
501 * NT SMB calls.
504 #ifndef LARGE_SMB_OFF_T
505 # if (defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_OFF64_T)) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8))
506 # define LARGE_SMB_OFF_T 1
507 # endif
508 #endif
510 #ifdef LARGE_SMB_OFF_T
511 #define SOFF_T(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,(v)>>32))
512 #else
513 #define SOFF_T(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0))
514 #endif
517 * Type for stat structure.
520 #ifndef SMB_STRUCT_STAT
521 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STAT64) && defined(HAVE_OFF64_T)
522 # define SMB_STRUCT_STAT struct stat64
523 # else
524 # define SMB_STRUCT_STAT struct stat
525 # endif
526 #endif
529 * Type for dirent structure.
532 #ifndef SMB_STRUCT_DIRENT
533 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_DIRENT64)
534 # define SMB_STRUCT_DIRENT struct dirent64
535 # else
536 # define SMB_STRUCT_DIRENT struct dirent
537 # endif
538 #endif
541 * Defines for 64 bit fcntl locks.
544 #ifndef SMB_STRUCT_FLOCK
545 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T)
546 # define SMB_STRUCT_FLOCK struct flock64
547 # else
548 # define SMB_STRUCT_FLOCK struct flock
549 # endif
550 #endif
552 #ifndef SMB_F_SETLKW
553 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T)
554 # define SMB_F_SETLKW F_SETLKW64
555 # else
556 # define SMB_F_SETLKW F_SETLKW
557 # endif
558 #endif
560 #ifndef SMB_F_SETLK
561 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T)
562 # define SMB_F_SETLK F_SETLK64
563 # else
564 # define SMB_F_SETLK F_SETLK
565 # endif
566 #endif
568 #ifndef SMB_F_GETLK
569 # if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T)
570 # define SMB_F_GETLK F_GETLK64
571 # else
572 # define SMB_F_GETLK F_GETLK
573 # endif
574 #endif
576 #if defined(HAVE_LONGLONG)
577 #define SMB_BIG_UINT unsigned long long
578 #define SMB_BIG_INT long long
579 #define SBIG_UINT(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,(v)>>32))
580 #else
581 #define SMB_BIG_UINT unsigned long
582 #define SMB_BIG_INT long
583 #define SBIG_UINT(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0))
584 #endif
586 #ifndef MIN
587 #define MIN(a,b) ((a)<(b)?(a):(b))
588 #endif
590 #ifndef MAX
591 #define MAX(a,b) ((a)>(b)?(a):(b))
592 #endif
594 #ifndef HAVE_STRERROR
595 extern char *sys_errlist[];
596 #define strerror(i) sys_errlist[i]
597 #endif
599 #ifndef HAVE_STRCHR
600 # define strchr index
601 # define strrchr rindex
602 #endif
604 #ifndef HAVE_ERRNO_DECL
605 extern int errno;
606 #endif
608 #ifdef HAVE_BROKEN_GETGROUPS
609 #define GID_T int
610 #else
611 #define GID_T gid_t
612 #endif
615 /* Lists, trees, caching, datbase... */
616 #include "ubi_sLinkList.h"
617 #include "ubi_dLinkList.h"
618 #include "dlinklist.h"
620 #ifndef UBI_BINTREE_H
621 #include "ubi_Cache.h"
622 #endif /* UBI_BINTREE_H */
624 #include "debugparse.h"
626 #include "version.h"
627 #include "smb.h"
628 #include "smbw.h"
629 #include "nameserv.h"
631 #include "byteorder.h"
633 #include "kanji.h"
634 #include "charset.h"
636 #include "nterr.h"
638 #ifndef MAXCODEPAGELINES
639 #define MAXCODEPAGELINES 256
640 #endif
642 /***** automatically generated prototypes *****/
643 #include "proto.h"
645 #ifdef strcpy
646 #undef strcpy
647 #endif /* strcpy */
648 #define strcpy(dest,src) __ERROR__XX__NEVER_USE_STRCPY___;
650 #ifdef strcat
651 #undef strcat
652 #endif /* strcat */
653 #define strcat(dest,src) __ERROR__XX__NEVER_USE_STRCAT___;
655 #ifdef sprintf
656 #undef sprintf
657 #endif /* sprintf */
658 #define sprintf __ERROR__XX__NEVER_USE_SPRINTF__;
660 #define pstrcpy(d,s) safe_strcpy((d),(s),sizeof(pstring)-1)
661 #define pstrcat(d,s) safe_strcat((d),(s),sizeof(pstring)-1)
662 #define fstrcpy(d,s) safe_strcpy((d),(s),sizeof(fstring)-1)
663 #define fstrcat(d,s) safe_strcat((d),(s),sizeof(fstring)-1)
665 #ifdef __COMPAR_FN_T
666 #define QSORT_CAST (__compar_fn_t)
667 #endif
669 #ifndef QSORT_CAST
670 #define QSORT_CAST (int (*)(const void *, const void *))
671 #endif
673 /* this guess needs to be improved (tridge) */
674 #if (defined(STAT_STATVFS) || defined(STAT_STATVFS64)) && !defined(SYSV)
675 #define SYSV 1
676 #endif
678 #ifndef DEFAULT_PRINTING
679 #ifdef SYSV
680 #define DEFAULT_PRINTING PRINT_SYSV
681 #define PRINTCAP_NAME "lpstat"
682 #else
683 #define DEFAULT_PRINTING PRINT_BSD
684 #define PRINTCAP_NAME "/etc/printcap"
685 #endif
686 #endif
688 #ifndef PRINTCAP_NAME
689 #define PRINTCAP_NAME "/etc/printcap"
690 #endif
692 #ifndef SIGCLD
693 #define SIGCLD SIGCHLD
694 #endif
696 #if (defined(HAVE_SYSV_IPC) || defined(HAVE_SHARED_MMAP))
697 #define FAST_SHARE_MODES 1
698 #endif
700 #ifndef MAP_FILE
701 #define MAP_FILE 0
702 #endif
704 #ifdef HAVE_SYSV_IPC
705 #ifndef HAVE_UNION_SEMUN
706 union semun {
707 int val;
708 struct semid_ds *buf;
709 unsigned short *array;
711 #endif
712 #endif
714 #if (!defined(WITH_NISPLUS) && !defined(WITH_LDAP))
715 #define USE_SMBPASS_DB 1
716 #endif
718 #if defined(HAVE_PUTPRPWNAM) && defined(AUTH_CLEARTEXT_SEG_CHARS)
719 #define OSF1_ENH_SEC 1
720 #endif
722 #ifndef ALLOW_CHANGE_PASSWORD
723 #if (defined(HAVE_TERMIOS_H) && defined(HAVE_DUP2) && defined(HAVE_SETSID))
724 #define ALLOW_CHANGE_PASSWORD 1
725 #endif
726 #endif
728 /* what is the longest significant password available on your system?
729 Knowing this speeds up password searches a lot */
730 #ifndef PASSWORD_LENGTH
731 #define PASSWORD_LENGTH 8
732 #endif
734 #ifdef REPLACE_INET_NTOA
735 #define inet_ntoa rep_inet_ntoa
736 #endif
738 #ifndef HAVE_PIPE
739 #define SYNC_DNS 1
740 #endif
742 #ifndef MAXPATHLEN
743 #define MAXPATHLEN 256
744 #endif
746 #ifndef SEEK_SET
747 #define SEEK_SET 0
748 #endif
750 #ifndef INADDR_LOOPBACK
751 #define INADDR_LOOPBACK 0x7f000001
752 #endif
754 #ifndef INADDR_NONE
755 #define INADDR_NONE 0xffffffff
756 #endif
758 #ifndef HAVE_CRYPT
759 #define crypt ufc_crypt
760 #endif
762 #ifndef O_ACCMODE
763 #define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
764 #endif
766 #if defined(HAVE_CRYPT16) && defined(HAVE_GETAUTHUID)
767 #define ULTRIX_AUTH 1
768 #endif
770 #ifdef HAVE_LIBREADLINE
771 # ifdef HAVE_READLINE_READLINE_H
772 # include <readline/readline.h>
773 # ifdef HAVE_READLINE_HISTORY_H
774 # include <readline/history.h>
775 # endif
776 # else
777 # ifdef HAVE_READLINE_H
778 # include <readline.h>
779 # ifdef HAVE_HISTORY_H
780 # include <history.h>
781 # endif
782 # else
783 # undef HAVE_LIBREADLINE
784 # endif
785 # endif
786 #endif
788 #ifndef HAVE_STRDUP
789 char *strdup(const char *s);
790 #endif
792 #ifndef HAVE_MEMMOVE
793 void *memmove(void *dest,const void *src,int size);
794 #endif
796 #ifndef HAVE_INITGROUPS
797 int initgroups(char *name,gid_t id);
798 #endif
800 #ifndef HAVE_RENAME
801 int rename(const char *zfrom, const char *zto);
802 #endif
804 #ifndef HAVE_MKTIME
805 time_t mktime(struct tm *t);
806 #endif
808 #ifndef HAVE_FTRUNCATE
809 int ftruncate(int f,long l);
810 #endif
812 #ifndef HAVE_STRTOUL
813 unsigned long strtoul(const char *nptr, char **endptr, int base);
814 #endif
816 #if (defined(HAVE_SETRESUID) && !defined(HAVE_SETRESUID_DECL))
817 /* stupid glibc */
818 int setresuid(uid_t ruid, uid_t euid, uid_t suid);
819 #endif
820 #if (defined(HAVE_SETRESGID) && !defined(HAVE_SETRESGID_DECL))
821 int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
822 #endif
824 #if (defined(HAVE_CRYPT) && !defined(HAVE_CRYPT_DECL) && !defined(KRB4_AUTH))
825 /* stupid glibc */
826 int crypt(const char *key, const char *salt);
827 #endif
829 #if !defined(HAVE_BZERO) && defined(HAVE_MEMSET)
830 #define bzero(a,b) memset((a),'\0',(b))
831 #endif
833 #ifdef REPLACE_GETPASS
834 #define getpass(prompt) getsmbpass((prompt))
835 #endif
838 * Some older systems seem not to have MAXHOSTNAMELEN
839 * defined.
841 #ifndef MAXHOSTNAMELEN
842 #define MAXHOSTNAMELEN 254
843 #endif
845 /* yuck, I'd like a better way of doing this */
846 #define DIRP_SIZE (256 + 32)
849 * glibc on linux doesn't seem to have MSG_WAITALL
850 * defined. I think the kernel has it though..
853 #ifndef MSG_WAITALL
854 #define MSG_WAITALL 0
855 #endif
857 #endif /* _INCLUDES_H */