summaryrefslogtreecommitdiffstats
path: root/apps/s_apps.h
diff options
context:
space:
mode:
authorUlf Möller <ulf@openssl.org>1999-05-13 11:37:32 +0000
committerUlf Möller <ulf@openssl.org>1999-05-13 11:37:32 +0000
commit7d7d2cbcb02206f3393681f2bce198e11e2e185b (patch)
tree93410fafc5aa977c748ea492994da3f581d11278 /apps/s_apps.h
parent8d111f4a476896a417069d16597ce3009f9bb992 (diff)
VMS support.
Submitted by: Richard Levitte <richard@levitte.org>
Diffstat (limited to 'apps/s_apps.h')
-rw-r--r--apps/s_apps.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/apps/s_apps.h b/apps/s_apps.h
index 68d6a73b9b..1a0e9f9f92 100644
--- a/apps/s_apps.h
+++ b/apps/s_apps.h
@@ -56,6 +56,30 @@
* [including the GNU Public Licence.]
*/
+#include <sys/types.h>
+#if (defined(VMS) || defined(__VMS)) && !defined(FD_SET)
+/* VAX C does not defined fd_set and friends, but it's actually quite simple */
+/* These definitions are borrowed from SOCKETSHR. /Richard Levitte */
+#define MAX_NOFILE 32
+#define NBBY 8 /* number of bits in a byte */
+
+#ifndef FD_SETSIZE
+#define FD_SETSIZE MAX_NOFILE
+#endif /* FD_SETSIZE */
+
+/* How many things we'll allow select to use. 0 if unlimited */
+#define MAXSELFD MAX_NOFILE
+typedef int fd_mask; /* int here! VMS prototypes int, not long */
+#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask (power of 2!)*/
+#define NFDSHIFT 5 /* Shift based on above */
+
+typedef fd_mask fd_set;
+#define FD_SET(n, p) (*(p) |= (1 << ((n) % NFDBITS)))
+#define FD_CLR(n, p) (*(p) &= ~(1 << ((n) % NFDBITS)))
+#define FD_ISSET(n, p) (*(p) & (1 << ((n) % NFDBITS)))
+#define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p)))
+#endif
+
#define PORT 4433
#define PORT_STR "4433"
#define PROTOCOL "tcp"