home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Divers / samba-1.9.18p7.tar.gz / samba-1.9.18p7.tar / samba-1.9.18p7 / source / includes.h < prev    next >
C/C++ Source or Header  |  1998-05-12  |  27KB  |  1,380 lines

  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
  8.    
  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.
  13.    
  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.
  18.    
  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.
  22. */
  23. /*
  24.    This file does all the #includes's. This makes it easier to
  25.    port to a new unix. Hopefully a port will only have to edit the Makefile
  26.    and add a section for the new unix below.
  27. */
  28.  
  29. #ifdef NTDOMAIN
  30. #error WARNING: remove this option (-DNTDOMAIN) from your [Mm]akefile.
  31. #error Please read NTDOMAIN.txt with _this_ distribution.
  32. #endif
  33.  
  34.  
  35. /* the first OS dependent section is to setup what includes will be used.
  36.    the main OS dependent section comes later on 
  37. */
  38.  
  39. #ifdef ALTOS
  40. #define NO_UTIMEH
  41. #endif
  42.  
  43. #ifdef MIPS
  44. #define POSIX_H
  45. #define NO_UTIMEH
  46. #endif
  47.  
  48. #ifdef sun386
  49. #define NO_UTIMEH
  50. #endif
  51.  
  52. #ifdef NEXT2
  53. #define NO_UTIMEH
  54. #endif
  55.  
  56. #ifdef NEXT3_0
  57. #define NO_UTIMEH
  58. #define NO_UNISTDH
  59. #endif
  60.  
  61. #ifdef APOLLO
  62. #define NO_UTIMEH
  63. #define NO_SYSMOUNTH
  64. #define NO_UNISTDH
  65. #endif
  66.  
  67. #ifdef AIX
  68. #define NO_SYSMOUNTH
  69. #endif
  70.  
  71. #ifdef M88K_R3
  72. #define SVR3H
  73. #define NO_RESOURCEH
  74. #endif
  75.  
  76. #ifdef DNIX
  77. #define NO_SYSMOUNTH
  78. #define NO_NETIFH
  79. #define NO_RESOURCEH
  80. #define PRIME_NMBD 0
  81. #define NO_SETGROUPS
  82. #endif
  83.  
  84.  
  85. #ifdef ISC
  86. #define SYSSTREAMH
  87. #define NO_RESOURCEH
  88. #endif
  89.  
  90. #ifdef QNX
  91. #define NO_RESOURCEH
  92. #define NO_SYSMOUNTH
  93. #define USE_MMAP 1
  94. #ifdef __386__
  95.    #define __i386__
  96. #endif
  97. #endif
  98.  
  99. #ifdef NEWS42
  100. #define NO_UTIMEH
  101. #define NO_STRFTIME
  102. #define NO_UTIMBUF
  103. #define REPLACE_MKTIME
  104. #define NO_TM_NAME
  105. #endif
  106.  
  107. #ifdef OS2
  108. #define NO_SYSMOUNTH
  109. #define NO_NETIFH
  110. #endif
  111.  
  112. #ifdef LYNX
  113. #define NO_SYSMOUNTH
  114. #endif
  115.  
  116.  
  117. #if (defined(SHADOW_PWD)||defined(OSF1_ENH_SEC)||defined(SecureWare)||defined(PWDAUTH))
  118. #define PASSWORD_LENGTH 16
  119. #endif
  120.  
  121. /* here is the general includes section - with some ifdefs generated 
  122.    by the previous section 
  123. */
  124. #include "local.h"
  125. #include <stdio.h>
  126. #ifdef POSIX_STDLIBH
  127. #include <posix/stdlib.h>
  128. #else
  129. #include <stdlib.h>
  130. #endif
  131. #include <ctype.h>
  132. #include <time.h>
  133. #ifndef NO_UTIMEH
  134. #include <utime.h>
  135. #endif
  136. #include <sys/types.h>
  137.  
  138. #ifdef SVR3H
  139. #include <sys/statfs.h>
  140. #include <sys/stream.h>
  141. #include <netinet/types.h>
  142. #include <netinet/ether.h>
  143. #include <netinet/ip_if.h>
  144. #endif
  145.  
  146. #include <sys/socket.h>
  147. #ifdef AXPROC
  148. #include <termio.h>
  149. #endif
  150. #include <sys/ioctl.h>
  151. #include <stddef.h>
  152. #ifdef POSIX_H
  153. #include <posix/utime.h>
  154. #include <bsd/sys/time.h>
  155. #include <bsd/netinet/in.h>
  156. #else
  157. #include <sys/time.h>
  158. #include <netinet/in.h>
  159. #endif 
  160. #include <netdb.h>
  161. #include <signal.h>
  162. #include <errno.h>
  163. #include <sys/file.h>
  164. #include <sys/stat.h>
  165. #include <sys/param.h>
  166. #include <grp.h>
  167. #ifndef NO_RESOURCEH
  168. #include <sys/resource.h>
  169. #endif
  170. #ifndef NO_SYSMOUNTH
  171. #include <sys/mount.h>
  172. #endif
  173. #include <pwd.h>
  174. #ifdef __STDC__
  175. #include <stdarg.h>
  176. #else
  177. #include <varargs.h>
  178. #endif
  179. #ifndef NO_UNISTDH
  180. #include <unistd.h>
  181. #endif
  182. #include <sys/wait.h>
  183. #ifdef SYSSTREAMH
  184. #include <sys/stream.h>
  185. #endif
  186. #ifndef NO_NETIFH
  187. #ifdef POSIX_H
  188. #include <bsd/net/if.h>
  189. #else
  190. #include <net/if.h>
  191. #endif
  192. #endif
  193.  
  194. #if defined(GETPWANAM)
  195. #include <sys/types.h>
  196. #include <sys/label.h>
  197. #include <sys/audit.h>
  198. #include <pwdadj.h>
  199. #endif
  200.  
  201. #if defined(SHADOW_PWD) && !defined(NETBSD) && !defined(FreeBSD) && !defined(CONVEX) && !defined(__OpenBSD__)
  202. #include <shadow.h>
  203. #endif
  204.  
  205. #ifdef SYSLOG
  206. #include <syslog.h>
  207. #endif
  208.  
  209.  
  210.  
  211. /***************************************************************************
  212. Here come some platform specific sections
  213. ***************************************************************************/
  214.  
  215.  
  216. #ifdef LINUX
  217. #include <arpa/inet.h>
  218. #include <dirent.h>
  219. #include <string.h>
  220. #include <sys/vfs.h>
  221. #include <netinet/in.h>
  222. #ifdef GLIBC2
  223. #define _LINUX_C_LIB_VERSION_MAJOR     6
  224. #include <termios.h>
  225. #include <rpcsvc/ypclnt.h>
  226. #include <crypt.h>
  227. #include <netinet/tcp.h>
  228. #include <netinet/ip.h>
  229. #endif
  230. #ifndef QSORT_CAST
  231. #define QSORT_CAST (int (*)(const void *, const void *))
  232. #endif /* QSORT_CAST */
  233. #define SIGNAL_CAST (__sighandler_t)
  234. #define USE_GETCWD
  235. #define USE_SETSID
  236. #define HAVE_BZERO
  237. #define HAVE_MEMMOVE
  238. #define HAVE_VSNPRINTF
  239. #define USE_SIGPROCMASK
  240. #define USE_WAITPID
  241. #define USE_SYSV_IPC
  242. #if 0
  243. /* SETFS disabled until we can check on some bug reports */
  244. #if _LINUX_C_LIB_VERSION_MAJOR >= 5
  245. #define USE_SETFS
  246. #endif
  247. #endif
  248. #ifdef SHADOW_PWD
  249. #if _LINUX_C_LIB_VERSION_MAJOR < 5
  250. #ifndef crypt
  251. #define crypt pw_encrypt
  252. #endif
  253. #endif
  254. #endif
  255. #endif
  256.  
  257. #ifdef SUNOS4
  258. #define SIGNAL_CAST (void (*)(int))
  259. #include <netinet/tcp.h>
  260. #include <dirent.h>
  261. #include <sys/acct.h>
  262. #include <sys/vfs.h>
  263. #include <string.h>
  264. #include <strings.h>
  265. #include <errno.h>
  266. #include <sys/wait.h>
  267. #include <signal.h>
  268. /* #include <termios.h> */
  269. #ifdef sun386
  270. #define NO_STRFTIME
  271. #define NO_UTIMBUF
  272. #define mktime timelocal
  273. typedef unsigned short mode_t;
  274. #else
  275. #include <utime.h>
  276. #define NO_STRERROR
  277. #endif
  278. #ifndef REPLACE_GETPASS
  279. #define REPLACE_GETPASS
  280. #endif
  281. #ifndef BSD_TERMIO
  282. #define BSD_TERMIO
  283. #endif
  284. #ifndef USE_SIGPROCMASK
  285. #define USE_SIGPROCMASK
  286. #endif
  287. #ifndef USE_WAITPID
  288. #define USE_WAITPID
  289. #endif
  290. #define USE_SYSV_IPC
  291. /* SunOS doesn't have POSIX atexit */
  292. #define atexit on_exit
  293. #define NOSTRCASECMP
  294. #endif
  295.  
  296.  
  297. #ifdef SUNOS5
  298. #include <fcntl.h>
  299. #include <dirent.h>
  300. #include <sys/acct.h>
  301. #include <sys/statfs.h>
  302. #include <sys/statvfs.h>
  303. #include <sys/filio.h>
  304. #include <sys/sockio.h>
  305. #include <netinet/in_systm.h>
  306. #include <netinet/tcp.h>
  307. #include <netinet/ip.h>
  308. #include <string.h>
  309. #include <arpa/inet.h>
  310. #include <rpcsvc/ypclnt.h>
  311. #include <termios.h>
  312. #include <sys/stropts.h>
  313. #if !defined(USE_LIBDES) && !defined(KRB4_AUTH)
  314. #include <crypt.h>
  315. #endif /* !USE_LIBDES && !KRB4_AUTH */
  316. extern int gettimeofday (struct timeval *, void *);
  317. extern int gethostname (char *name, int namelen);
  318. extern int innetgr (const char *, const char *, const char *, const char *);
  319. #define USE_SETVBUF
  320. #define SIGNAL_CAST (void (*)(int))
  321. #ifndef SYSV
  322. #define SYSV
  323. #endif
  324. #define USE_WAITPID
  325. #define REPLACE_STRLEN
  326. #define USE_STATVFS
  327. #define USE_GETCWD
  328. #define USE_SETSID
  329. #define USE_SYSV_IPC
  330. #define NO_SEMUN
  331. #ifndef REPLACE_GETPASS
  332. #define REPLACE_GETPASS
  333. #endif /* REPLACE_GETPASS */
  334. #define USE_SIGPROCMASK
  335. #endif
  336.  
  337.  
  338. #ifdef ULTRIX
  339. #include <strings.h>
  340. #include <nfs/nfs_clnt.h>
  341. #include <nfs/vfs.h>
  342. #include <netinet/tcp.h>
  343. #ifdef ULTRIX_AUTH
  344. #include <auth.h>
  345. #endif
  346. char *getwd(char *);
  347. #define NOSTRDUP
  348. #ifdef __STDC__
  349. #define SIGNAL_CAST (void(*)(int))
  350. #endif
  351. #define USE_DIRECT
  352. #define USE_WAITPID
  353. #endif
  354.  
  355. #ifdef SGI4
  356. #include <netinet/tcp.h>
  357. #include <sys/statfs.h>
  358. #include <string.h>
  359. #include <signal.h>
  360. #ifndef SYSV
  361. #define SYSV
  362. #endif
  363. #define SIGNAL_CAST (void (*)())
  364. #define STATFS4
  365. #define USE_WAITPID
  366. #define USE_DIRECT
  367. #define USE_SETSID
  368. #define USE_SYSV_IPC
  369. #endif
  370.  
  371. #if defined(SGI5) || defined(SGI6)
  372. #include <arpa/inet.h>
  373. #include <netinet/tcp.h>
  374. #include <netinet/in_systm.h>
  375. #include <netinet/ip.h>
  376. #include <sys/statvfs.h>
  377. #include <string.h>
  378. #include <signal.h>
  379. #include <dirent.h>
  380. #define USE_WAITPID
  381. #define NETGROUP 
  382. #ifndef SYSV
  383. #define SYSV
  384. #endif
  385. #define SIGNAL_CAST (void (*)())
  386. #define USE_STATVFS
  387. #define USE_WAITPID
  388. #define USE_SETSID
  389. #define USE_SYSV_IPC
  390. #ifndef QSORT_CAST
  391. #define QSORT_CAST (int (*)(const void *, const void *))
  392. #endif /* QSORT_CAST */
  393. #endif
  394.  
  395.  
  396. #ifdef MIPS
  397. #include <bsd/net/soioctl.h>
  398. #include <string.h>
  399. #include <dirent.h>
  400. #include <fcntl.h>
  401. #include <sys/statfs.h>
  402. #include <sys/wait.h>
  403. #include <sys/termio.h>
  404. #define SIGNAL_CAST (void (*)())
  405. typedef int mode_t;
  406. extern struct group *getgrnam();
  407. extern struct passwd *getpwnam();
  408. #define STATFS4
  409. #define NO_STRERROR
  410. #define REPLACE_STRSTR
  411. #endif /* MIPS */
  412.  
  413.  
  414.  
  415. #ifdef DGUX
  416. #include <string.h>
  417. #include <dirent.h>
  418. #include <sys/statfs.h>
  419. #include <sys/statvfs.h>
  420. #include <fcntl.h>
  421. #include <termios.h>
  422. #define SYSV
  423. #define USE_WAITPID
  424. #define SIGNAL_CAST (void (*)(int))
  425. #define STATFS4
  426. #define USE_GETCWD
  427. #endif
  428.  
  429.  
  430. #ifdef SVR4
  431. #include <string.h>
  432. #include <sys/dir.h>
  433. #include <dirent.h>
  434. #include <sys/statfs.h>
  435. #include <sys/statvfs.h>
  436. #include <sys/vfs.h>
  437. #include <sys/filio.h>
  438. #include <fcntl.h>
  439. #include <sys/sockio.h>
  440. #include <netinet/tcp.h>
  441. #include <stropts.h>
  442. #include <termios.h>
  443. #define SYSV
  444. #define USE_WAITPID
  445. #define SIGNAL_CAST (void (*)(int))
  446. #define USE_STATVFS
  447. #define USE_GETCWD
  448. #define USE_SETSID
  449. #define USE_SYSV_IPC
  450. #define NO_SEMUN
  451. #endif
  452.  
  453.  
  454. #ifdef OSF1
  455. #include <termios.h>
  456. #include <strings.h>
  457. #include <dirent.h>
  458. char *getwd(char *);
  459. char *mktemp(char *); /* No standard include */
  460. #include <netinet/in.h>
  461. #include <arpa/inet.h> /* both for inet_ntoa */
  462. #define SIGNAL_CAST ( void (*) (int) )
  463. #define STATFS3
  464. #define USE_F_FSIZE
  465. #define USE_SETSID
  466. #include <netinet/tcp.h>
  467. #ifdef OSF1_ENH_SEC
  468. #include <pwd.h>
  469. #include <sys/types.h>
  470. #include <sys/security.h>
  471. #include <prot.h>
  472. #include <unistd.h>
  473. #define PASSWORD_LENGTH 16
  474. #define NEED_AUTH_PARAMETERS
  475. #endif  /* OSF1_ENH_SEC */
  476. #define USE_SYSV_IPC
  477. #define NO_SEMUN
  478. #endif
  479.  
  480.  
  481. #ifdef CLIX
  482. #include <dirent.h>
  483. #define SIGNAL_CAST    (void (*)())
  484. #include <sys/fcntl.h>
  485. #include <sys/statfs.h>
  486. #include <string.h>
  487. #define NO_EID
  488. #define USE_WAITPID
  489. #define STATFS4
  490. #define NO_FSYNC
  491. #define USE_GETCWD
  492. #define USE_SETSID
  493. #ifndef REPLACE_GETPASS
  494. #define REPLACE_GETPASS
  495. #endif /* REPLACE_GETPASS */
  496. #define NO_GETRLIMIT
  497. #endif    /* CLIX */
  498.  
  499.  
  500.  
  501. #ifdef BSDI
  502. #include <string.h>
  503. #include <netinet/tcp.h>
  504. #define SIGNAL_CAST (void (*)())
  505. #define USE_DIRECT
  506. #endif
  507.  
  508.  
  509. #ifdef NETBSD 
  510. #ifdef NetBSD1_3
  511. #include <string.h>
  512. #ifdef ALLOW_CHANGE_PASSWORD
  513. #include <termios.h>
  514. #endif /* ALLOW_CHANGE_PASSWORD */
  515. #else /* NetBSD1_3 */
  516. #include <strings.h>
  517. #endif /* NetBSD1_3 */
  518. #include <netinet/tcp.h>
  519. /* you may not need this */
  520. #define NO_GETSPNAM
  521. #define SIGNAL_CAST (void (*)())
  522. #define USE_DIRECT
  523. #define REPLACE_INNETGR
  524. #endif 
  525.  
  526.  
  527.  
  528. #ifdef FreeBSD
  529. #include <arpa/inet.h>
  530. #include <strings.h>
  531. #include <netinet/tcp.h>
  532. #include <netinet/in_systm.h>
  533. #include <netinet/ip.h>
  534. #include <termios.h>
  535. #if __FreeBSD__ >= 3
  536. #include <dirent.h>
  537. #else
  538. #define USE_DIRECT
  539. #endif
  540. #define SIGNAL_CAST (void (*)(int))
  541. #define USE_SETVBUF
  542. #define USE_SETSID
  543. #define USE_GETCWD
  544. #define USE_WAITPID
  545. #define HAVE_MEMMOVE
  546. #define HAVE_BZERO
  547. #define HAVE_GETTIMEOFDAY
  548. #define HAVE_PATHCONF
  549. #define HAVE_GETGRNAM 1
  550. #ifndef QSORT_CAST
  551. #define QSORT_CAST (int (*)(const void *, const void *))
  552. #endif /* QSORT_CAST */
  553. #if !defined(O_SYNC)
  554. #if defined(O_FSYNC)
  555. #define O_SYNC O_FSYNC
  556. #else /* defined(O_FSYNC) */
  557. #define O_SYNC 0
  558. #endif /* defined(O_FSYNC) */
  559. #endif /* !defined(O_SYNC) */
  560. #define HAVE_VSNPRINTF
  561. #endif /* FreeBSD */
  562.  
  563. #ifdef __OpenBSD__
  564. #include <strings.h>
  565. #include <netinet/tcp.h>
  566. #define NO_GETSPNAM
  567. #define SIGNAL_CAST (void (*)())
  568. #define USE_DIRECT
  569. #define REPLACE_INNETGR
  570. #define HAVE_BZERO
  571. #define HAVE_PATHCONF
  572. #define HAVE_GETGRNAM 1
  573. #define HAVE_GETTIMEOFDAY
  574. #define HAVE_MEMMOVE
  575. #define USE_GETCWD
  576. #define USE_SETSID
  577. #endif 
  578.  
  579. #ifdef AIX
  580. #include <strings.h>
  581. #include <sys/dir.h>
  582. #include <sys/select.h>
  583. #include <dirent.h>
  584. #include <sys/statfs.h>
  585. #include <sys/vfs.h>
  586. #include <sys/id.h>
  587. #include <sys/priv.h>
  588. /* According to AIX 4.1 man pages, inet_ntoa needs the following headers */
  589. #include <sys/socket.h>
  590. #include <netinet/in.h>
  591. #include <arpa/inet.h>
  592. #include <netinet/tcp.h>
  593. #include <locale.h>
  594. #define SYSV
  595. #define USE_WAITPID
  596. #define USE_SIGBLOCK
  597. #define SIGNAL_CAST (void (*)())
  598. #define DEFAULT_PRINTING PRINT_AIX
  599. /* we undef this because sys/param.h is broken in aix. uggh. */
  600. #undef MAXHOSTNAMELEN
  601. #endif
  602.  
  603.  
  604. #ifdef HPUX
  605. #include <string.h>
  606. #include <dirent.h>
  607. #include <fcntl.h>
  608. #include <sys/vfs.h>
  609. #include <sys/types.h>
  610. #include <sys/termios.h>
  611. #include <netinet/tcp.h>
  612. #include <arpa/inet.h>                /* needed for inet_ntoa proto */
  613. #include <stropts.h>
  614. #ifdef HPUX_10_TRUSTED
  615. #include <hpsecurity.h>
  616. #include <prot.h>
  617. #define NEED_AUTH_PARAMETERS
  618. #endif
  619. #define SIGNAL_CAST (void (*)(__harg))
  620. #ifndef HPUX10 /* This is only needed for HPUX 9.x */
  621. #define SELECT_CAST (int *)
  622. #endif /* HPUX10 */
  623. #define SYSV
  624. #define USE_WAITPID
  625. #define WAIT3_CAST2 (int *)
  626. #define USE_GETCWD
  627. #define USE_SETSID
  628. #define USE_SETRES
  629. #define USE_SYSV_IPC
  630. #define NO_SEMUN
  631. #define DEFAULT_PRINTING PRINT_HPUX
  632. /* Ken Weiss <krweiss@ucdavis.edu> tells us that SIGCLD_IGNORE is
  633.    not good for HPUX */
  634. /* #define SIGCLD_IGNORE */
  635. #define USE_SIGPROCMASK /* Needed to stop zombie processes on HPUX 9.x and 10.x.*/
  636. #endif /* HPUX */
  637.  
  638.  
  639. #ifdef SEQUENT
  640. #include <signal.h>
  641. #include <string.h>
  642. #include <dirent.h>
  643. #include <sys/types.h>
  644. #include <sys/statfs.h>
  645. #include <sys/stat.h>
  646. #include <sys/buf.h>
  647. #include <sys/socket.h>
  648. #include <unistd.h>
  649. #include <fcntl.h>
  650. #define SIGNAL_CAST (void (*)(int))
  651. #define USE_WAITPID
  652. #define USE_GETCWD
  653. #define NO_EID
  654. #define STATFS4
  655. #define USE_DIRECT
  656. #ifdef PTX4
  657. #undef USE_DIRECT
  658. #endif
  659. #endif
  660.  
  661.  
  662.  
  663. #ifdef SEQUENT_PTX4
  664. #include <string.h>
  665. #include <sys/dir.h>
  666. #include <dirent.h>
  667. #include <sys/statfs.h>
  668. #include <sys/statvfs.h>
  669. #include <sys/vfs.h>
  670. #include <fcntl.h>
  671. #include <sys/sockio.h>
  672. #include <netinet/tcp.h>
  673. #include <stropts.h>
  674. #include <termios.h>
  675. #define SYSV
  676. #define USE_WAITPID
  677. #define SIGNAL_CAST (void (*)(int))
  678. #define USE_STATVFS
  679. #define USE_GETCWD
  680. #ifndef seteuid
  681. #define seteuid(uid) setreuid(-1,uid)
  682. #endif
  683. #ifndef setegid
  684. #define setegid(gid) setregid(-1,gid)
  685. #endif
  686. #endif
  687.  
  688.  
  689. #ifdef NEXT2
  690. #include <sys/types.h>
  691. #include <strings.h>
  692. #include <dirent.h>
  693. #include <sys/vfs.h>
  694. #define bzero(b,len) memset(b,0,len)
  695. #define mode_t int
  696. #define NO_UTIMBUF
  697. #include <libc.h>
  698. #define NOSTRDUP
  699. #define USE_DIRECT
  700. #define USE_WAITPID
  701. #endif 
  702.  
  703.  
  704. #ifdef NEXT3_0
  705. #include <strings.h>
  706. #include <sys/dir.h>
  707. #include <sys/vfs.h>
  708. #define bzero(b,len) memset(b,0,len)
  709. #define NO_UTIMBUF
  710. #include <libc.h>
  711. #define NOSTRDUP
  712. #define USE_DIRECT
  713. #define mode_t int
  714. #define GID_TYPE int
  715. #define gid_t int
  716. #define pid_t int
  717. #define SIGNAL_CAST (void (*)(int))
  718. #define WAIT3_CAST1 (union wait *)
  719. #define HAVE_GMTOFF
  720. #endif
  721.  
  722.  
  723.  
  724. #ifdef APOLLO
  725. #include <string.h>
  726. #include <fcntl.h>
  727. #include <sys/statfs.h>
  728. #define NO_UTIMBUF
  729. #define USE_DIRECT
  730. #define USE_GETCWD
  731. #define SIGNAL_CAST     (void (*)())
  732. #define HAVE_FCNTL_LOCK 0
  733. #define HAVE_GETTIMEOFDAY
  734. #define STATFS4
  735. #endif
  736.  
  737.  
  738.  
  739. #ifdef SCO
  740. #include <sys/netinet/tcp.h>
  741. #include <sys/netinet/in_systm.h>
  742. #include <sys/netinet/ip.h>
  743. #include <dirent.h>
  744. #include <string.h>
  745. #include <termios.h>
  746. #include <fcntl.h>
  747. #include <sys/statfs.h>
  748. #include <sys/stropts.h>
  749. #include <limits.h>
  750. #include <locale.h>
  751. #ifdef EVEREST
  752. #include <unistd.h> 
  753. #endif /* EVEREST */
  754. #ifdef NETGROUP
  755. #include <rpcsvc/ypclnt.h>
  756. #endif /* NETGROUP */
  757. #ifdef SecureWare
  758. #include <sys/security.h>
  759. #include <sys/audit.h>
  760. #include <prot.h>
  761. #define crypt bigcrypt
  762. #endif /* SecureWare */
  763. #define SIGNAL_CAST (void (*)(int))
  764. #define USE_WAITPID
  765. #define USE_GETCWD
  766. #define USE_SETSID
  767. #ifdef SCO3_2_2
  768. #define setuid(u) setreuid(u,-1)
  769. #define seteuid(u) setreuid(-1,u)
  770. #else /* SCO3_2_2 */
  771. #ifndef EVEREST
  772. #define ftruncate(f,l) syscall(0x0a28,f,l)
  773. #define USE_IFREQ
  774. #define NO_INITGROUPS
  775. #endif /* EVEREST */
  776. #endif /* SCO3_2_2 */
  777. #define STATFS4
  778. #define NO_FSYNC
  779. #define HAVE_PATHCONF
  780. #define NO_GETRLIMIT
  781. #endif /* SCO */
  782.  
  783.  
  784.  
  785. /* Definitions for RiscIX */
  786. #ifdef RiscIX
  787. #define SIGNAL_CAST (void (*)(int))
  788. #include <sys/dirent.h>
  789. #include <sys/acct.h>
  790. #include <sys/vfs.h>
  791. #include <string.h>
  792. #include <utime.h>
  793. #include <signal.h>
  794. #define HAVE_GETTIMEOFDAY
  795. #define NOSTRCASECMP
  796. #define NOSTRDUP
  797. #endif
  798.  
  799.  
  800.  
  801. #ifdef ISC
  802. #include <net/errno.h>
  803. #include <string.h>
  804. #include <sys/dir.h>
  805. #include <dirent.h>
  806. #include <sys/statfs.h>
  807. #include <fcntl.h>
  808. #include <sys/sioctl.h>
  809. #include <stropts.h>
  810. #include <limits.h>
  811. #include <netinet/tcp.h>
  812. #define FIONREAD FIORDCHK
  813. #define SYSV
  814. #define USE_WAITPID
  815. #define SIGNAL_CAST (void (*)(int))
  816. #define USE_GETCWD
  817. #define USE_SETSID
  818. #define USE_IFREQ
  819. #define NO_FTRUNCATE
  820. #define STATFS4
  821. #define NO_FSYNC
  822. #endif
  823.  
  824.  
  825.  
  826. #ifdef AUX
  827. #include <fstab.h>
  828. #include <string.h>
  829. #include <dirent.h>
  830. #include <sys/vfs.h>
  831. #include <fcntl.h>
  832. #include <termios.h>
  833. #define SYSV
  834. #define USE_WAITPID
  835. #define SIGNAL_CAST (void (*)(int))
  836. char *strdup (char *);
  837. #define USE_GETCWD
  838. #endif
  839.  
  840.  
  841. #ifdef M88K_R3
  842. #include <string.h>
  843. #include <dirent.h>
  844. #include <fcntl.h>
  845. #include <termios.h>
  846. #define STATFS4
  847. #define SYSV
  848. #define USE_WAITPID
  849. #define SIGNAL_CAST (void (*)(int))
  850. char *strdup (char *);
  851. #define USE_GETCWD
  852. #define NO_FSYNC
  853. #define NO_EID
  854. #endif
  855.  
  856.  
  857. #ifdef DNIX
  858. #include <dirent.h>
  859. #include <string.h>
  860. #include <fcntl.h>
  861. #include <sys/statfs.h>
  862. #include <sys/stropts.h>
  863. #define NO_GET_BROADCAST
  864. #define USE_WAITPID
  865. #define USE_GETCWD
  866. #define USE_SETSID
  867. #define STATFS4
  868. #define NO_EID
  869. #define PF_INET AF_INET
  870. #define NO_STRERROR
  871. #define ftruncate(f,l) chsize(f,l)
  872. #endif /* DNIX */
  873.  
  874. #ifdef CONVEX
  875. #include <netinet/tcp.h>
  876. #include <arpa/inet.h>
  877. #include <dirent.h>
  878. #include <string.h>
  879. #include <sys/vfs.h>
  880. #include <fcntl.h>
  881. #define DONT_REINSTALL_SIG
  882. #define USE_SIGBLOCK
  883. #define USE_WAITPID
  884. #define SIGNAL_CAST (_SigFunc_Ptr_t)
  885. #define NO_GETSPNAM
  886. #define HAVE_MEMMOVE
  887. extern char *mktemp(char *);
  888. extern int  fsync(int);
  889. extern int  seteuid(uid_t);
  890. extern int  setgroups(int, int *);
  891. extern int  initgroups(char *, int);
  892. extern int  statfs(char *, struct statfs *);
  893. extern int  setegid(gid_t);
  894. extern int  getopt(int, char *const *, const char *);
  895. extern int  chroot(char *);
  896. extern int  gettimeofday(struct timeval *, struct timezone *);
  897. extern int  gethostname(char *, int);
  898. extern char *crypt(char *, char *);
  899. extern char *getpass(char *);
  900. #endif
  901.  
  902.  
  903. #ifdef CRAY
  904. #define MAXPATHLEN 1024
  905. #include <dirent.h>
  906. #include <string.h>
  907. #include <fcntl.h>
  908. #include <sys/statfs.h>
  909. #define SIGNAL_CAST (void (*)(int))
  910. #define SIGCLD_IGNORE
  911. #define HAVE_FCNTL_LOCK 1
  912. #define USE_SETSID
  913. #define STATFS4
  914. #endif
  915.  
  916.  
  917. #ifdef ALTOS
  918. #include <unistd.h>
  919. #include <string.h>
  920. #include <dirent.h>
  921. #include <sys/fcntl.h>
  922. #include <sys/statfs.h>
  923. #define        const
  924. #define        uid_t           int
  925. #define        gid_t           int
  926. #define        mode_t          int
  927. #define        ptrdiff_t       int
  928. #define HAVE_GETGRNAM  0
  929. #define NO_EID
  930. #define NO_FSYNC
  931. #define        NO_FTRUNCATE
  932. #define        NO_GETRLIMIT
  933. #define        NO_INITGROUPS
  934. #define NO_SELECT
  935. #define NO_SETGROUPS
  936. #define NO_STRERROR
  937. #define NO_STRFTIME
  938. #define        NO_TM_NAME
  939. #define NO_UTIMEH
  940. #define NOSTRCASECMP
  941. #define REPLACE_MKTIME
  942. #define REPLACE_RENAME
  943. #define REPLACE_STRSTR
  944. #define STATFS4
  945. #define        USE_GETCWD
  946. #endif
  947.  
  948. #ifdef QNX
  949. #define STATFS4
  950. #include <sys/statfs.h>
  951. #include <sys/select.h>
  952. #include <signal.h>
  953. #include <sys/dir.h>
  954. #define SIGNAL_CAST (void (*)())
  955. #define USE_WAITPID
  956. #define NO_INITGROUPS
  957. #define NO_SETGROUPS
  958. #define HAVE_TIMEZONE
  959. #define USE_GETCWD
  960. #define USE_SETSID
  961. #define HAVE_FCNTL_LOCK 1
  962. #define DEFAULT_PRINTING PRINT_QNX
  963. #endif
  964.  
  965.  
  966. #ifdef NEWS42
  967. #include <string.h>
  968. #include <dirent.h>
  969. #include <sys/vfs.h>
  970. #include <sys/timeb.h>
  971. typedef int mode_t;
  972. #endif
  973.  
  974. #ifdef OS2
  975. #include <dirent.h>
  976. #include <sys/statfs.h>
  977. #include <string.h>
  978. #include <limits.h>
  979. #define SIGNAL_CAST (void (*)())
  980. #define HAVE_FCNTL_LOCK 0
  981. #define USE_WAITPID
  982. #define NO_GET_BROADCAST
  983. #define NO_EID
  984. #define NO_SETGROUPS
  985. #define NO_INITGROUPS
  986. #define NO_CRYPT
  987. #define NO_STATFS
  988. #define NO_CHROOT
  989. #define NO_CHOWN
  990. #define strcasecmp stricmp
  991. #define strncasecmp strnicmp
  992. #endif
  993.  
  994.  
  995. #ifdef LYNX
  996. #define SIGNAL_CAST (void (*)())
  997. #define WAIT3_CAST1 (union wait *)
  998. #define STATFS4
  999. #include <fcntl.h>
  1000. #include <resource.h>
  1001. #include <stat.h>
  1002. #include <string.h>
  1003. #include <dirent.h>
  1004. #include <sys/statfs.h>
  1005. #define USE_GETCWD
  1006. #define USE_GETSID
  1007. #endif
  1008.  
  1009.  
  1010. #ifdef BOS
  1011. #define SIGNAL_CAST (void (*)(int))
  1012. #include <string.h>
  1013. #include <sys/dir.h>
  1014. #include <sys/select.h>
  1015. #include <dirent.h>
  1016. #include <fcntl.h>
  1017. #include <signal.h>
  1018. #include <sys/statfs.h>
  1019. #include <sys/bsdioctl.h>
  1020. #endif
  1021.  
  1022. #ifdef AMIGA
  1023. #include <arpa/inet.h>
  1024. #include <dirent.h>
  1025. #include <string.h>
  1026. #include <netinet/tcp.h>
  1027. #include <sys/acct.h>
  1028. #include <sys/fcntl.h>
  1029. #include <sys/filio.h>
  1030. #include <sys/sockio.h>
  1031. #include <netinet/in_systm.h>
  1032. #include <netinet/ip.h>
  1033. #include <sys/termios.h>
  1034. #include <limits.h>
  1035. #include <sys/timeb.h>
  1036.  
  1037. #define SIGNAL_CAST (void (*)(int))
  1038. #define USE_GETCWD
  1039. #define HAVE_BZERO
  1040. #define HAVE_MEMMOVE
  1041. #define USE_SIGPROCMASK
  1042. #define USE_WAITPID
  1043. #define USE_DIRECT
  1044. #define USE_F_FSIZE
  1045. #define HAVE_FCNTL_LOCK 0
  1046. #define HAVE_GETTIMEOFDAY
  1047. #define HAVE_PATHCONF
  1048.  
  1049. #define HAVE_NO_PROC
  1050. #define NO_FORK_DEBUG
  1051. #define HAVE_FORK 0
  1052. #define HAVE_VFORK 1
  1053. #endif
  1054.  
  1055. /* For UnixWare 2.x's ia_uinfo routines. (tangent@cyberport.com) */
  1056. #ifdef IA_UINFO
  1057. #include <iaf.h>
  1058. #include <ia.h>
  1059. #endif
  1060.  
  1061.  
  1062. /*******************************************************************
  1063. end of the platform specific sections
  1064. ********************************************************************/
  1065.  
  1066. #if defined(USE_MMAP) || defined(FAST_SHARE_MODES)
  1067. #include <sys/mman.h>
  1068. #endif
  1069.  
  1070. #ifdef SecureWare
  1071. #define NEED_AUTH_PARAMETERS
  1072. #endif
  1073.  
  1074. #ifdef REPLACE_GETPASS
  1075. extern char    *getsmbpass(char *);
  1076. #define getpass(s) getsmbpass(s)
  1077. #endif
  1078.  
  1079. #ifdef REPLACE_INNETGR
  1080. #define innetgr(group,host,user,dom) InNetGr(group,host,user,dom)
  1081. #endif
  1082.  
  1083. #ifndef FD_SETSIZE
  1084. #define FD_SETSIZE 255
  1085. #endif
  1086.  
  1087. #ifndef __STDC__
  1088. #define const
  1089. #endif
  1090.  
  1091. /* Now for some other grungy stuff */
  1092. #ifdef NO_GETSPNAM
  1093. struct spwd { /* fake shadow password structure */
  1094.        char *sp_pwdp;
  1095. };
  1096. #endif
  1097.  
  1098. #ifndef HAVE_BZERO
  1099. #ifndef bzero
  1100. #define bzero(p,s) memset(p,0,s)
  1101. #endif
  1102. #endif
  1103.  
  1104. #ifndef HAVE_MEMMOVE
  1105. #ifndef memmove
  1106. #define memmove(d,s,n) MemMove(d,s,n)
  1107. #endif
  1108. #endif
  1109.  
  1110. #ifdef USE_DIRECT
  1111. #include <sys/dir.h>
  1112. #endif
  1113.  
  1114. /* some unixes have ENOTTY instead of TIOCNOTTY */
  1115. #ifndef TIOCNOTTY
  1116. #ifdef ENOTTY
  1117. #define TIOCNOTTY ENOTTY
  1118. #endif
  1119. #endif
  1120.  
  1121. #ifndef SIGHUP
  1122. #define SIGHUP 1
  1123. #endif
  1124.  
  1125. /* if undefined then use bsd or sysv printing */
  1126. #ifndef DEFAULT_PRINTING
  1127. #ifdef SYSV
  1128. #define DEFAULT_PRINTING PRINT_SYSV
  1129. #else
  1130. #define DEFAULT_PRINTING PRINT_BSD
  1131. #endif
  1132. #endif
  1133.  
  1134. /* This defines the name of the printcap file. It is MOST UNLIKELY that
  1135.    this will change BUT! Specifying a file with the format of a printcap
  1136.    file but containing only a subset of the printers actually in your real 
  1137.    printcap file is a quick-n-dirty way to allow dynamic access to a subset
  1138.    of available printers.
  1139. */
  1140. #ifndef PRINTCAP_NAME
  1141. #ifdef AIX
  1142. #define PRINTCAP_NAME "/etc/qconfig"
  1143. #elif defined(SYSV)
  1144. #define PRINTCAP_NAME "lpstat"
  1145. #else
  1146. #define PRINTCAP_NAME "/etc/printcap"
  1147. #endif
  1148. #endif
  1149.  
  1150.  
  1151. #ifdef USE_SYSV_IPC
  1152. #include <sys/ipc.h>
  1153. #include <sys/sem.h>
  1154. #include <sys/shm.h>
  1155. #ifdef NO_SEMUN
  1156. union semun {
  1157.     int val;
  1158.     struct semid_ds *buf;
  1159.     unsigned short *array;
  1160. };
  1161. #endif
  1162. #if defined(HPUX) && defined(HPUX10)
  1163. #ifdef SEMMSL
  1164. #undef SEMMSL
  1165. #endif /* SEMMSL */
  1166. #endif /* HPUX && HPUX10 */
  1167. #endif
  1168.  
  1169. #ifdef AFS_AUTH
  1170. #include <afs/stds.h>
  1171. #include <afs/kautils.h>
  1172. #endif
  1173.  
  1174. #ifdef DFS_AUTH
  1175. #include <dce/dce_error.h>
  1176. #include <dce/sec_login.h>
  1177. #endif
  1178.  
  1179. #ifdef KRB5_AUTH
  1180. #include <krb5.h>
  1181. #endif
  1182.  
  1183. #ifdef KRB4_AUTH
  1184. #include <krb.h>
  1185. #endif
  1186.  
  1187. #ifdef NO_UTIMBUF
  1188. struct utimbuf {
  1189.   time_t actime;
  1190.   time_t modtime;
  1191. };
  1192. #endif
  1193.  
  1194. #ifdef NO_STRERROR
  1195. #ifndef strerror
  1196. extern char *sys_errlist[];
  1197. #define strerror(i) sys_errlist[i]
  1198. #endif
  1199. #endif
  1200.  
  1201. #ifndef perror
  1202. #define perror(m) printf("%s: %s\n",m,strerror(errno))
  1203. #endif
  1204.  
  1205. #ifndef MAXHOSTNAMELEN
  1206. #define MAXHOSTNAMELEN 255
  1207. #endif
  1208.  
  1209. #include "version.h"
  1210. #include "smb.h"
  1211. #include "nameserv.h"
  1212. #include "ubiqx/ubi_dLinkList.h"
  1213.  
  1214. #include "byteorder.h"
  1215.  
  1216. #include "kanji.h"
  1217. #include "charset.h"
  1218.  
  1219. #ifndef MAXCODEPAGELINES
  1220. #define MAXCODEPAGELINES 256
  1221. #endif
  1222.  
  1223. /***** automatically generated prototypes *****/
  1224. #include "proto.h"
  1225.  
  1226.  
  1227.  
  1228. #ifndef S_IFREG
  1229. #define S_IFREG 0100000
  1230. #endif
  1231.  
  1232. #ifndef S_ISREG
  1233. #define S_ISREG(x) ((S_IFREG & (x))!=0)
  1234. #endif
  1235.  
  1236. #ifndef S_ISDIR
  1237. #define S_ISDIR(x) ((S_IFDIR & (x))!=0)
  1238. #endif
  1239.  
  1240. #if !defined(S_ISLNK) && defined(S_IFLNK)
  1241. #define S_ISLNK(x) ((S_IFLNK & (x))!=0)
  1242. #endif
  1243.  
  1244. #ifdef UFC_CRYPT
  1245. #define crypt ufc_crypt
  1246. #endif
  1247.  
  1248. #ifdef REPLACE_STRLEN
  1249. #define strlen(s) Strlen(s)
  1250. #endif
  1251.  
  1252. #ifdef REPLACE_STRSTR
  1253. #define strstr(s,p) Strstr(s,p)
  1254. #endif
  1255.  
  1256. #ifdef REPLACE_MKTIME
  1257. #define mktime(t) Mktime(t)
  1258. #endif
  1259.  
  1260. #ifndef NGROUPS_MAX
  1261. #define NGROUPS_MAX 128
  1262. #endif
  1263.  
  1264. #ifndef EDQUOT
  1265. #define EDQUOT ENOSPC
  1266. #endif
  1267.  
  1268. #ifndef HAVE_GETGRNAM
  1269. #define HAVE_GETGRNAM 1
  1270. #endif
  1271.  
  1272. #ifndef SOL_TCP
  1273. #define SOL_TCP 6
  1274. #endif
  1275.  
  1276. /* default to using ftruncate workaround as this is safer than assuming
  1277. it works and getting lots of bug reports */
  1278. #ifndef FTRUNCATE_CAN_EXTEND
  1279. #define FTRUNCATE_CAN_EXTEND 0
  1280. #endif
  1281.  
  1282. /* maybe this unix doesn't separate RD and WR locks? */
  1283. #ifndef F_RDLCK
  1284. #define F_RDLCK F_WRLCK
  1285. #endif
  1286.  
  1287. #ifndef ENOTSOCK
  1288. #define ENOTSOCK EINVAL
  1289. #endif
  1290.  
  1291. #ifndef SIGCLD
  1292. #define SIGCLD SIGCHLD
  1293. #endif 
  1294.  
  1295. #ifndef MAP_FILE
  1296. #define MAP_FILE 0
  1297. #endif
  1298.  
  1299. #ifndef HAVE_FCNTL_LOCK
  1300. #define HAVE_FCNTL_LOCK 1
  1301. #endif
  1302.  
  1303. #ifndef WAIT3_CAST2
  1304. #define WAIT3_CAST2 (struct rusage *)
  1305. #endif
  1306.  
  1307. #ifndef WAIT3_CAST1
  1308. #define WAIT3_CAST1 (int *)
  1309. #endif
  1310.  
  1311. #ifndef QSORT_CAST
  1312. #define QSORT_CAST (int (*)(void *, void *))
  1313. #endif
  1314.  
  1315. #ifndef INADDR_LOOPBACK
  1316. #define INADDR_LOOPBACK 0x7f000001
  1317. #endif /* INADDR_LOOPBACK */
  1318.  
  1319. /* this is a rough check to see if this machine has a lstat() call.
  1320.    it is not guaranteed to work */
  1321. #if !defined(S_ISLNK)
  1322. #define lstat stat
  1323. #endif
  1324.  
  1325. /* Not all systems declare ERRNO in errno.h... and some systems #define it! */
  1326. #ifndef errno
  1327. extern int errno;
  1328. #endif 
  1329.  
  1330.  
  1331. #ifdef NO_EID
  1332. #define geteuid() getuid()
  1333. #define getegid() getgid()
  1334. #define seteuid(x) setuid(x)
  1335. #define setegid(x) setgid(x)
  1336. #endif
  1337.  
  1338.  
  1339. #if (HAVE_FCNTL_LOCK == 0)
  1340. /* since there is no locking available, system includes  */
  1341. /* for DomainOS 10.4 do not contain any of the following */
  1342. /* #define's. So, to satisfy the compiler, add these     */
  1343. /* #define's, although they arn't really necessary.      */
  1344. #define F_GETLK 0
  1345. #define F_SETLK 0
  1346. #define F_WRLCK 0
  1347. #define F_UNLCK 0
  1348. #endif /* HAVE_FCNTL_LOCK == 0 */
  1349.  
  1350. #ifdef NOSTRCASECMP
  1351. #define strcasecmp(s1,s2) StrCaseCmp(s1,s2)
  1352. #define strncasecmp(s1,s2,n) StrnCaseCmp(s1,s2,n)
  1353. #endif
  1354.  
  1355. #ifdef strcpy
  1356. #undef strcpy
  1357. #endif /* strcpy */
  1358. #define strcpy(dest,src) __ERROR__XX__NEVER_USE_STRCPY___;
  1359.    
  1360. #ifdef strcat
  1361. #undef strcat
  1362. #endif /* strcat */
  1363. #define strcat(dest,src) __ERROR__XX__NEVER_USE_STRCAT___;
  1364.    
  1365. #ifdef sprintf
  1366. #undef sprintf
  1367. #endif /* sprintf */
  1368. #define sprintf __ERROR__XX__NEVER_USE_SPRINTF__;
  1369.  
  1370. #define pstrcpy(d,s) safe_strcpy((d),(s),sizeof(pstring)-1)
  1371. #define pstrcat(d,s) safe_strcat((d),(s),sizeof(pstring)-1)
  1372. #define fstrcpy(d,s) safe_strcpy((d),(s),sizeof(fstring)-1)
  1373. #define fstrcat(d,s) safe_strcat((d),(s),sizeof(fstring)-1)
  1374.  
  1375. #if MEM_MAN
  1376. #include "mem_man/mem_man.h"
  1377. #endif
  1378.  
  1379. #endif
  1380.