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