2 * Copyright (c) 1993, 1994, 1995, 1996
3 * The Regents of the University of California. All rights reserved.
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
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.
21 * @(#) $Header: os-solaris2.h,v 1.16 96/07/05 22:11:23 leres Locked $ (LBL)
24 /* Signal routines are this type */
26 /* Signal routines use "return SIGRETVAL;" */
28 /* The wait() status variable is this type */
29 #define WAITSTATUS int
31 #define major(x) ((int)(((unsigned)(x)>>8)&0377))
32 #define minor(x) ((int)((x)&0377))
34 /* Prototypes missing in SunOS 5 */
36 int dn_expand(u_char *, u_char *, u_char *, u_char *, int);
37 int dn_skipname(u_char *, u_char *);
39 int getdtablesize(void);
40 int gethostname(char *, int);
41 int getpagesize(void);
42 char *getusershell(void);
44 int iruserok(u_int, int, char *, char *);
47 void login(struct utmp *);
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 *);
58 int snprintf(char *, size_t, const char *, ...);
59 int strcasecmp(const char *, const char *);
60 void unsetenv(const char *);
64 int utimes(const char *, struct timeval *);
66 /* Solaris signal compat */
68 #define sigmask(m) (1 << ((m)-1))
71 #define signal(s, f) sigset(s, f)
74 /* Solaris random compat */
76 #define srandom(seed) srand48((long)seed)
79 #define random() lrand48()
84 #define CBREAK O_CBREAK
87 #define TBDELAY O_TBDELAY
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 */
102 #ifndef STDERR_FILENO
103 #define STDERR_FILENO 2
104 #define STDOUT_FILENO 1
105 #define STDIN_FILENO 0
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)
116 #define S_ISTXT S_ISVTX