home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Unix / Shells / tcsh / Source / tc.os.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-21  |  14.8 KB  |  619 lines

  1. /* $Header: /u/christos/src/tcsh-6.03/RCS/tc.os.h,v 3.40 1992/11/14 20:40:02 christos Exp $ */
  2. /*
  3.  * tc.os.h: Shell os dependent defines
  4.  */
  5. /*-
  6.  * Copyright (c) 1980, 1991 The Regents of the University of California.
  7.  * All rights reserved.
  8.  *
  9.  * Redistribution and use in source and binary forms, with or without
  10.  * modification, are permitted provided that the following conditions
  11.  * are met:
  12.  * 1. Redistributions of source code must retain the above copyright
  13.  *    notice, this list of conditions and the following disclaimer.
  14.  * 2. Redistributions in binary form must reproduce the above copyright
  15.  *    notice, this list of conditions and the following disclaimer in the
  16.  *    documentation and/or other materials provided with the distribution.
  17.  * 3. All advertising materials mentioning features or use of this software
  18.  *    must display the following acknowledgement:
  19.  *    This product includes software developed by the University of
  20.  *    California, Berkeley and its contributors.
  21.  * 4. Neither the name of the University nor the names of its contributors
  22.  *    may be used to endorse or promote products derived from this software
  23.  *    without specific prior written permission.
  24.  *
  25.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  26.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  27.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  28.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  29.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  30.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  31.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  32.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  33.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  34.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  35.  * SUCH DAMAGE.
  36.  */
  37. #ifndef _h_tc_os
  38. #define _h_tc_os
  39.  
  40. #define NEEDstrerror        /* Too hard to find which systems have it */
  41.  
  42.  
  43. #ifdef notdef 
  44. /*
  45.  * for SVR4 and linux we used to fork pipelines backwards. 
  46.  * This should not be needed any more.
  47.  * more info in sh.sem.c
  48.  */
  49. # define BACKPIPE
  50. #endif /* notdef */
  51.  
  52. #ifdef   _VMS_POSIX
  53. # ifndef  NOFILE 
  54. #  define  NOFILE 64
  55. # endif
  56. # define  nice(a)       setprio((getpid()),a)
  57. # undef   NEEDstrerror    /* won't get sensible error messages otherwise */
  58. # define  NEEDgethostname 
  59. # include <sys/time.h>    /* for time stuff in tc.prompt.c */
  60. # include <limits.h>
  61. #endif /*atp vmsposix*/
  62.  
  63. #ifndef NOFILE
  64. # ifdef OPEN_MAX
  65. #  define NOFILE OPEN_MAX
  66. # else
  67. #  define NOFILE 256
  68. # endif
  69. #endif /* NOFILE */
  70.  
  71. #ifdef linux
  72. # undef NEEDstrerror
  73. #endif /* linux */
  74.  
  75. #ifdef OREO
  76. # include <sys/time.h>
  77. # include <sys/resource.h>
  78. # ifdef POSIX
  79. #  include <sys/tty.h>
  80. #  include <termios.h>
  81. # endif /* POSIX */
  82. #endif /* OREO */
  83.  
  84. #ifndef NCARGS
  85. # ifdef ARG_MAX
  86. #  define NCARGS ARG_MAX
  87. # else
  88. #  ifdef _MINIX
  89. #   define NCARGS 80
  90. #  else /* !_MINIX */
  91. #   define NCARGS 1024
  92. #  endif /* _MINIX */
  93. # endif /* ARG_MAX */
  94. #endif /* NCARGS */
  95.  
  96. #ifdef titan
  97. extern int end;
  98. #endif /* titan */
  99.  
  100. #ifdef hpux
  101. # ifdef lint
  102. /*
  103.  * Hpux defines struct ucred, in <sys/user.h>, but if I include that
  104.  * then I need to include the *world*
  105.  * [all this to pass lint cleanly!!!]
  106.  * so I define struct ucred here...
  107.  */
  108. struct ucred {
  109.     int     foo;
  110. };
  111. # endif /* lint */
  112.  
  113. /*
  114.  * hpux 7.0 does not define it
  115.  */
  116. # ifndef CSUSP
  117. #  define CSUSP 032
  118. # endif    /* CSUSP */
  119.  
  120. # ifndef hp9000s500
  121. #  include <sys/bsdtty.h>
  122. # endif
  123.  
  124. # ifndef POSIX
  125. #  ifdef BSDJOBS
  126. #   define getpgrp(a) getpgrp2(a)
  127. #   define setpgrp(a, b) setpgrp2(a, b)
  128. #  endif /* BSDJOBS */
  129. # endif    /* POSIX */
  130. #endif /* hpux */
  131.  
  132. /*
  133.  * ISC does not define CSUSP
  134.  */
  135. #ifdef ISC
  136. # ifndef CSUSP
  137. #  define CSUSP 032
  138. # endif    /* CSUSP */
  139. #endif /* ISC */
  140.  
  141. #ifdef ISC202
  142. # undef TIOCGWINSZ
  143. #endif /* ISC202 */
  144.  
  145. /*
  146.  * XXX: This will be changed soon to 
  147.  * #if (SYSVREL > 0) && defined(TIOCGWINSZ)
  148.  * If that breaks on your machine, let me know.
  149.  *
  150.  * It would break on linux, where all this is
  151.  * defined in <termios.h>. Wrapper added.
  152.  */
  153. #if !defined(linux) && !defined(_VMS_POSIX)
  154. # if defined(INTEL) || defined(u3b2) || defined (u3b5) || defined(ub15) || defined(u3b20d) || defined(ISC) || defined(SCO) 
  155. #  ifdef TIOCGWINSZ
  156. /*
  157.  * for struct winsiz
  158.  */
  159. #   include <sys/stream.h>
  160. #   include <sys/ptem.h>
  161. #  endif /* TIOCGWINSZ */
  162. #  ifndef ODT
  163. #   define NEEDgethostname
  164. #  endif /* ODT */
  165. # endif /* INTEL || att || isc || sco */
  166. #endif /* !linux && !_VMS_POSIX */
  167.  
  168. #if defined(UNIXPC) || defined(COHERENT)
  169. # define NEEDgethostname
  170. #endif /* UNIXPC || COHERENT */
  171.  
  172. #ifdef IRIS4D
  173. # include <sys/time.h>
  174. # include <sys/resource.h>
  175. # ifndef POSIX
  176. /*
  177.  * BSDsetpgrp() and BSDgetpgrp() are BSD versions of setpgrp, etc.
  178.  */
  179. #  define setpgrp BSDsetpgrp
  180. #  define getpgrp BSDgetpgrp
  181. # endif
  182. #endif /* IRIS4D */
  183.  
  184. /*
  185.  * For some versions of system V software, specially ones that use the 
  186.  * Wollongong Software TCP/IP, the FIOCLEX, FIONCLEX, FIONBIO calls
  187.  * might not work correctly for file descriptors [they work only for
  188.  * sockets]. So we try to use first the fcntl() and we only use the
  189.  * ioctl() form, only if we don't have the fcntl() one.
  190.  *
  191.  * From: scott@craycos.com (Scott Bolte)
  192.  */
  193. #ifdef F_SETFD
  194. # define close_on_exec(fd, v)    \
  195.     ((v) ? fcntl((fd), F_SETFD, 1) : fcntl((fd), F_SETFD, 0))
  196. #else /* !F_SETFD */
  197. # ifdef FIOCLEX
  198. # define close_on_exec(fd, v)    \
  199.     ((v) ? ioctl((fd), FIOCLEX, NULL) : ioctl((fd), FIONCLEX, NULL))
  200. # else /* Nothing */
  201. # define close_on_exec(fd, v)    /* Nothing */
  202. # endif /* FIOCLEX */
  203. #endif /* F_SETFD */
  204.  
  205. /*
  206.  * Stat
  207.  */
  208. #ifdef ISC
  209. /* these are not defined for _POSIX_SOURCE under ISC 2.2 */
  210. # ifndef S_IFMT
  211. #  define S_IFMT  0170000        /* type of file */
  212. #  define S_IFDIR 0040000        /* directory */
  213. #  define S_IFCHR 0020000        /* character special */
  214. #  define S_IFBLK 0060000        /* block special */
  215. #  define S_IFREG 0100000        /* regular */
  216. #  define S_IFIFO 0010000        /* fifo */
  217. #  define S_IFNAM 0050000        /* special named file */
  218. # endif /* S_IFMT */
  219. #endif /* ISC */
  220.  
  221. #if defined(uts) || defined(UTekV) || defined(sysV88)
  222. /*
  223.  * The uts 2.1.2 macros (Amdahl) are busted!
  224.  * You should fix <sys/stat.h>, cause other programs will break too!
  225.  *
  226.  * From: creiman@ncsa.uiuc.edu (Charlie Reiman)
  227.  */
  228.  
  229. /*
  230.  * The same applies to Motorola MPC (System V/88 R32V2, UTekV 3.2e) 
  231.  * workstations, the stat macros are broken.
  232.  * Kaveh Ghazi (ghazi@caip.rutgers.edu)
  233.  */
  234. # undef S_ISDIR
  235. # undef S_ISCHR
  236. # undef S_ISBLK
  237. # undef S_ISREG
  238. # undef S_ISFIFO
  239. # undef S_ISNAM
  240. # undef S_ISLNK
  241. # undef S_ISSOCK
  242. #endif /* uts || UTekV */
  243.  
  244. #ifdef S_IFMT
  245. # if !defined(S_ISDIR) && defined(S_IFDIR)
  246. #  define S_ISDIR(a)    (((a) & S_IFMT) == S_IFDIR)
  247. # endif    /* ! S_ISDIR && S_IFDIR */
  248. # if !defined(S_ISCHR) && defined(S_IFCHR)
  249. #  define S_ISCHR(a)    (((a) & S_IFMT) == S_IFCHR)
  250. # endif /* ! S_ISCHR && S_IFCHR */
  251. # if !defined(S_ISBLK) && defined(S_IFBLK)
  252. #  define S_ISBLK(a)    (((a) & S_IFMT) == S_IFBLK)
  253. # endif    /* ! S_ISBLK && S_IFBLK */
  254. # if !defined(S_ISREG) && defined(S_IFREG)
  255. #  define S_ISREG(a)    (((a) & S_IFMT) == S_IFREG)
  256. # endif    /* ! S_ISREG && S_IFREG */
  257. # if !defined(S_ISFIFO) && defined(S_IFIFO)
  258. #  define S_ISFIFO(a)    (((a) & S_IFMT) == S_IFIFO)
  259. # endif    /* ! S_ISFIFO && S_IFIFO */
  260. # if !defined(S_ISNAM) && defined(S_IFNAM)
  261. #  define S_ISNAM(a)    (((a) & S_IFMT) == S_IFNAM)
  262. # endif    /* ! S_ISNAM && S_IFNAM */
  263. # if !defined(S_ISLNK) && defined(S_IFLNK)
  264. #  define S_ISLNK(a)    (((a) & S_IFMT) == S_IFLNK)
  265. # endif    /* ! S_ISLNK && S_IFLNK */
  266. # if !defined(S_ISSOCK) && defined(S_IFSOCK)
  267. #  define S_ISSOCK(a)    (((a) & S_IFMT) == S_IFSOCK)
  268. # endif    /* ! S_ISSOCK && S_IFSOCK */
  269. #endif /* S_IFMT */
  270.  
  271.  
  272. #ifndef S_IREAD
  273. # define S_IREAD 0000400
  274. #endif /* S_IREAD */
  275. #ifndef S_IROTH
  276. # define S_IROTH (S_IREAD >> 6)
  277. #endif /* S_IROTH */
  278. #ifndef S_IRGRP
  279. # define S_IRGRP (S_IREAD >> 3)
  280. #endif /* S_IRGRP */
  281. #ifndef S_IRUSR
  282. # define S_IRUSR S_IREAD
  283. #endif /* S_IRUSR */
  284.  
  285. #ifndef S_IWRITE
  286. # define S_IWRITE 0000200
  287. #endif /* S_IWRITE */
  288. #ifndef S_IWOTH
  289. # define S_IWOTH (S_IWRITE >> 6)
  290. #endif /* S_IWOTH */
  291. #ifndef S_IWGRP
  292. # define S_IWGRP (S_IWRITE >> 3)
  293. #endif /* S_IWGRP */
  294. #ifndef S_IWUSR
  295. # define S_IWUSR S_IWRITE
  296. #endif /* S_IWUSR */
  297.  
  298. #ifndef S_IEXEC
  299. # define S_IEXEC 0000100
  300. #endif /* S_IEXEC */
  301. #ifndef S_IXOTH
  302. # define S_IXOTH (S_IEXEC >> 6)
  303. #endif /* S_IXOTH */
  304. #ifndef S_IXGRP
  305. # define S_IXGRP (S_IEXEC >> 3)
  306. #endif /* S_IXGRP */
  307. #ifndef S_IXUSR
  308. # define S_IXUSR S_IEXEC
  309. #endif /* S_IXUSR */
  310.  
  311. #ifndef S_ISUID
  312. # define S_ISUID 0004000     /* setuid */
  313. #endif /* S_ISUID */
  314. #ifndef S_ISGID    
  315. # define S_ISGID 0002000    /* setgid */
  316. #endif /* S_ISGID */
  317. #ifndef S_ISVTX
  318. # define S_ISVTX 0001000    /* sticky */
  319. #endif /* S_ISVTX */
  320.  
  321. /*
  322.  * Access()
  323.  */
  324. #ifndef F_OK
  325. # define F_OK 0
  326. #endif /* F_OK */
  327. #ifndef X_OK
  328. # define X_OK 1
  329. #endif /* X_OK */
  330. #ifndef W_OK
  331. # define W_OK 2
  332. #endif /* W_OK */
  333. #ifndef R_OK
  334. # define R_OK 4
  335. #endif /* R_OK */
  336.  
  337. /*
  338.  * Open()
  339.  */
  340. #ifndef O_RDONLY
  341. # define O_RDONLY    0
  342. #endif /* O_RDONLY */
  343. #ifndef O_WRONLY
  344. # define O_WRONLY    1
  345. #endif /* O_WRONLY */
  346. #ifndef O_RDWR
  347. # define O_RDWR        2
  348. #endif /* O_RDWR */
  349.  
  350. /*
  351.  * Lseek()
  352.  */
  353. #ifndef L_SET
  354. # ifdef SEEK_SET
  355. #  define L_SET        SEEK_SET
  356. # else
  357. #  define L_SET        0
  358. # endif    /* SEEK_SET */
  359. #endif /* L_SET */
  360. #ifndef L_INCR
  361. # ifdef SEEK_CUR
  362. #  define L_INCR    SEEK_CUR
  363. # else
  364. #  define L_INCR    1
  365. # endif    /* SEEK_CUR */
  366. #endif /* L_INCR */
  367. #ifndef L_XTND
  368. # ifdef SEEK_END
  369. #  define L_XTND    SEEK_END
  370. # else
  371. #  define L_XTND    2
  372. # endif /* SEEK_END */
  373. #endif /* L_XTND */
  374.  
  375. #ifdef _SEQUENT_
  376. # define NEEDgethostname
  377. #endif /* _SEQUENT_ */
  378.  
  379. #if defined(BSD) && defined(POSIXJOBS) 
  380. # define setpgid(pid, pgrp)    setpgrp(pid, pgrp)
  381. #endif /* BSD && POSIXJOBS */
  382.  
  383. #if defined(BSDJOBS) && !(defined(POSIX) && defined(POSIXJOBS))
  384. # if !defined(_AIX370) && !defined(_AIXPS2)
  385. #  define setpgid(pid, pgrp)    setpgrp(pid, pgrp)
  386. # endif /* !_AIX370 && !_AIXPS2 */
  387. # define NEEDtcgetpgrp
  388. #endif /* BSDJOBS && !(POSIX && POSIXJOBS) */
  389.  
  390. #ifdef RENO 
  391. /*
  392.  * RENO has this broken. It is fixed on 4.4BSD
  393.  */
  394. # define NEEDtcgetpgrp
  395. #endif /* RENO */
  396.  
  397. #ifdef DGUX
  398. # define setpgrp(a, b) setpgrp2(a, b)
  399. # define getpgrp(a) getpgrp2(a)
  400. #endif /* DGUX */
  401.  
  402. #ifdef SXA
  403. # ifndef _BSDX_
  404. /*
  405.  * Only needed in the system V environment.
  406.  */
  407. #  define setrlimit     bsd_setrlimit
  408. #  define getrlimit    bsd_getrlimit
  409. # endif    /* _BSDX_ */
  410. #endif /* SXA */
  411.  
  412. #if defined(_MINIX) || defined(__EMX__)
  413. # define NEEDgethostname
  414. # define NEEDnice
  415. # define HAVENOLIMIT
  416. /*
  417.  * Minix does not have these, so...
  418.  */
  419. # define getpgrp        getpid
  420. #endif /* _MINIX || __EMX__ */
  421.  
  422. #ifdef __EMX__
  423. /* XXX: How can we get the tty name in emx? */
  424. # define ttyname(fd) (isatty(fd) ? "/dev/tty" : NULL)
  425. #endif /* __EMX__ */
  426.  
  427. #ifndef POSIX
  428. # define mygetpgrp()    getpgrp(0)
  429. #else /* POSIX */
  430. # if defined(BSD) || defined(SUNOS4) || defined(IRIS4D)
  431. #  define mygetpgrp()    getpgrp(0)
  432. # else /* BSD || SUNOS4 || IRIS4D */
  433. #  define mygetpgrp()    getpgrp()
  434. # endif    /* BSD || SUNOS4 */
  435. #endif /* POSIX */
  436.  
  437.  
  438. #if SYSVREL > 0 && !defined(OREO) && !defined(sgi) && !defined(linux)
  439. # define NEEDgetwd
  440. #endif /* SYSVREL > 0 && !OREO && !sgi && !linux */
  441.  
  442. #ifndef S_IFLNK
  443. # define lstat stat
  444. #endif /* S_IFLNK */
  445.  
  446.  
  447. #if defined(BSDTIMES) && !defined(_SEQUENT_)
  448. typedef struct timeval timeval_t;
  449. #endif /* BSDTIMES && ! _SEQUENT_ */
  450.  
  451. #ifdef NeXT
  452. /*
  453.  * From Tony_Mason@transarc.com, override NeXT's malloc stuff.
  454.  */
  455. # define malloc tcsh_malloc
  456. # define calloc tcsh_calloc
  457. # define realloc tcsh_realloc
  458. # define free tcsh_free
  459. #endif /* NeXT */
  460.  
  461.  
  462. #if !defined(POSIX) || defined(SUNOS4) || defined(UTekV) || defined(sysV88)
  463. extern time_t time();
  464. extern char *getenv();
  465. extern int atoi();
  466. #ifndef __EMX__
  467. extern char *ttyname();
  468. #endif
  469.  
  470. #if defined(SUNOS4)
  471. # ifndef toupper
  472. extern int toupper __P((int));
  473. # endif
  474. # ifndef tolower
  475. extern int tolower __P((int));
  476. # endif
  477. extern caddr_t sbrk __P((int));
  478. # if SYSVREL == 0
  479. extern int qsort();
  480. # endif
  481. #else
  482. # ifndef hpux
  483. #  if __GNUC__ != 2
  484. extern int abort();
  485. #  endif /* __GNUC__ != 2 */
  486. # ifndef fps500
  487. extern int qsort();
  488. # endif /* fps500 */
  489. # else
  490. extern void abort();
  491. extern void qsort();
  492. # endif
  493. #endif    /* SUNOS4 */
  494. extern void perror();
  495.  
  496. #ifndef NEEDgethostname
  497. extern int gethostname();
  498. #endif
  499.  
  500. # ifdef BSDSIGS
  501. #  if defined(_AIX370) || defined(MACH) || defined(NeXT) || defined(_AIXPS2) || defined(ardent)
  502. extern int sigvec();
  503. extern int sigpause();
  504. #  else    /* _AIX370 || MACH || NeXT || _AIXPS2 || ardent */
  505. #   if !defined(apollo) || !defined(__STDC__)
  506. #    ifndef fps500
  507. extern sigret_t sigvec();
  508. extern void sigpause();
  509. #    endif /* fps500 */
  510. #   endif /* !apollo || !__STDC__ */
  511. #  endif /* _AIX370 || MACH || NeXT || _AIXPS2 */
  512. extern sigmask_t sigblock();
  513. extern sigmask_t sigsetmask();
  514. # endif    /* BSDSIGS */
  515.  
  516. # ifndef killpg
  517. extern int killpg();
  518. # endif    /* killpg */
  519.  
  520. # ifndef lstat
  521. extern int lstat();
  522. # endif    /* lstat */
  523.  
  524. #ifdef BSD
  525. extern uid_t getuid(), geteuid();
  526. extern gid_t getgid(), getegid();
  527. #endif /* BSD */
  528.  
  529. # ifdef SYSMALLOC
  530. extern memalign_t malloc();
  531. extern memalign_t realloc();
  532. extern memalign_t calloc();
  533. extern void free();
  534. # endif    /* SYSMALLOC */
  535.  
  536. # ifdef BSDTIMES
  537. extern int getrlimit();
  538. extern int setrlimit();
  539. extern int getrusage();
  540. extern int gettimeofday();
  541. # endif    /* BSDTIMES */
  542.  
  543. # if defined(NLS) && !defined(NOSTRCOLL) && !defined(NeXT)
  544. extern int strcoll();
  545. # endif
  546.  
  547. # ifdef BSDJOBS
  548. #  ifdef BSDTIMES
  549. extern int wait3();
  550. #  else    /* ! BSDTIMES */
  551. #   if !defined(POSIXJOBS) && !defined(_SEQUENT_)
  552. extern int wait3();
  553. #   else /* POSIXJOBS || _SEQUENT_ */
  554. extern int waitpid();
  555. #   endif /* POSIXJOBS || _SEQUENT_ */
  556. #  endif /* ! BSDTIMES */
  557. # else /* !BSDJOBS */
  558. #  if SYSVREL < 3
  559. extern int ourwait();
  560. #  else    /* SYSVREL >= 3 */
  561. extern int wait();
  562. #  endif /* SYSVREL >= 3 */
  563. # endif    /* ! BSDJOBS */
  564.  
  565. # ifdef BSDNICE
  566. extern int setpriority();
  567. # else /* !BSDNICE */
  568. extern int nice();
  569. # endif    /* !BSDNICE */
  570.  
  571. # if (!defined(fps500) && !defined(apollo))
  572. extern void setpwent();
  573. extern void endpwent();
  574. # endif /* fps500 */
  575.  
  576. #ifndef __STDC__
  577. extern struct passwd *getpwuid(), *getpwnam(), *getpwent();
  578. #ifdef PW_SHADOW
  579. extern struct spwd *getspnam(), *getspent();
  580. #endif /* PW_SHADOW */
  581. #ifdef PW_AUTH
  582. extern struct authorization *getauthuid();
  583. #endif /* PW_AUTH */
  584. #endif /* __STDC__ */
  585.  
  586. # ifndef getwd
  587. extern char *getwd();
  588. # endif    /* getwd */
  589. #else /* POSIX */
  590.  
  591. # if (defined(SUNOS4) && !defined(__GNUC__)) || defined(_IBMR2) || defined(_IBMESA)
  592. extern char *getwd();
  593. # endif    /* (SUNOS4 && ! __GNUC__) || _IBMR2 || _IBMESA */
  594.  
  595. # ifdef SCO
  596. extern char *ttyname();   
  597. # endif /* SCO */
  598.  
  599. #endif /* POSIX */
  600.  
  601. # if defined(SUNOS4) && __GNUC__ == 2
  602. /*
  603.  * Somehow these are missing
  604.  */
  605. extern int ioctl __P((int, int, ...));
  606. extern int readlink __P((const char *, char *, size_t));
  607. # endif /* SUNOS4 && __GNUC__ == 2 */
  608.  
  609. #if (defined(BSD) && !defined(__386BSD__))  || defined(SUNOS4) 
  610. extern void bcopy    __P((const void *, void *, size_t));
  611. # define memmove(a, b, c) (bcopy((char *) (b), (char *) (a), (int) (c)), a)
  612. #endif
  613.  
  614. #if !defined(hpux) && !defined(COHERENT) && ((SYSVREL < 4) || defined(_SEQUENT_)) && !defined(__386BSD__) && !defined(memmove)
  615. # define NEEDmemmove
  616. #endif
  617.  
  618. #endif /* _h_tc_os */
  619.