Initial import from FreeBSD RELENG_4:
[dragonfly.git] / contrib / traceroute / lbl / os-solaris2.h
1 /*
2  * Copyright (c) 1993, 1994, 1995, 1996
3  *      The Regents of the University of California.  All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that: (1) source code distributions
7  * retain the above copyright notice and this paragraph in its entirety, (2)
8  * distributions including binary code include the above copyright notice and
9  * this paragraph in its entirety in the documentation or other materials
10  * provided with the distribution, and (3) all advertising materials mentioning
11  * features or use of this software display the following acknowledgement:
12  * ``This product includes software developed by the University of California,
13  * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
14  * the University nor the names of its contributors may be used to endorse
15  * or promote products derived from this software without specific prior
16  * written permission.
17  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
18  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
19  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20  *
21  * @(#) $Header: os-solaris2.h,v 1.16 96/07/05 22:11:23 leres Locked $ (LBL)
22  */
23
24 /* Signal routines are this type */
25 #define SIGRET void
26 /* Signal routines use "return SIGRETVAL;" */
27 #define SIGRETVAL
28 /* The wait() status variable is this type */
29 #define WAITSTATUS int
30
31 #define major(x)        ((int)(((unsigned)(x)>>8)&0377))
32 #define minor(x)        ((int)((x)&0377))
33
34 /* Prototypes missing in SunOS 5 */
35 int     daemon(int, int);
36 int     dn_expand(u_char *, u_char *, u_char *, u_char *, int);
37 int     dn_skipname(u_char *, u_char *);
38 int     flock(int, int);
39 int     getdtablesize(void);
40 int     gethostname(char *, int);
41 int     getpagesize(void);
42 char    *getusershell(void);
43 char    *getwd(char *);
44 int     iruserok(u_int, int, char *, char *);
45 #ifdef __STDC__
46 struct  utmp;
47 void    login(struct utmp *);
48 #endif
49 int     logout(const char *);
50 int     res_query(char *, int, int, u_char *, int);
51 int     setenv(const char *, const char *, int);
52 #if defined(_STDIO_H) && defined(HAVE_SETLINEBUF)
53 int     setlinebuf(FILE *);
54 #endif
55 int     sigblock(int);
56 int     sigsetmask(int);
57 char    *strerror(int);
58 int     snprintf(char *, size_t, const char *, ...);
59 int     strcasecmp(const char *, const char *);
60 void    unsetenv(const char *);
61 #ifdef __STDC__
62 struct  timeval;
63 #endif
64 int     utimes(const char *, struct timeval *);
65
66 /* Solaris signal compat */
67 #ifndef sigmask
68 #define sigmask(m)      (1 << ((m)-1))
69 #endif
70 #ifndef signal
71 #define signal(s, f)    sigset(s, f)
72 #endif
73
74 /* Solaris random compat */
75 #ifndef srandom
76 #define srandom(seed) srand48((long)seed)
77 #endif
78 #ifndef random
79 #define random() lrand48()
80 #endif
81
82 #ifdef notdef
83 #ifndef CBREAK
84 #define CBREAK  O_CBREAK
85 #define CRMOD   O_CRMOD
86 #define RAW     O_RAW
87 #define TBDELAY O_TBDELAY
88 #endif
89 #endif
90
91 #ifndef TIOCPKT_DATA
92 #define         TIOCPKT_DATA            0x00    /* data packet */
93 #define         TIOCPKT_FLUSHREAD       0x01    /* flush packet */
94 #define         TIOCPKT_FLUSHWRITE      0x02    /* flush packet */
95 #define         TIOCPKT_STOP            0x04    /* stop output */
96 #define         TIOCPKT_START           0x08    /* start output */
97 #define         TIOCPKT_NOSTOP          0x10    /* no more ^S, ^Q */
98 #define         TIOCPKT_DOSTOP          0x20    /* now do ^S ^Q */
99 #define         TIOCPKT_IOCTL           0x40    /* state change of pty driver */
100 #endif
101
102 #ifndef STDERR_FILENO
103 #define STDERR_FILENO 2
104 #define STDOUT_FILENO 1
105 #define STDIN_FILENO 0
106 #endif
107
108 #ifndef FD_SET
109 #define FD_SET(n, p)    ((p)->fds_bits[0] |= (1<<(n)))
110 #define FD_CLR(n, p)    ((p)->fds_bits[0] &= ~(1<<(n)))
111 #define FD_ISSET(n, p)  ((p)->fds_bits[0] & (1<<(n)))
112 #define FD_ZERO(p)      ((p)->fds_bits[0] = 0)
113 #endif
114
115 #ifndef S_ISTXT
116 #define S_ISTXT S_ISVTX
117 #endif