imapext-2007

view src/osdep/unix/os_vu2.c @ 0:ada5e610ab86

imap-2007e
author yuuji@gentei.org
date Mon, 14 Sep 2009 15:17:45 +0900
parents
children
line source
1 /* ========================================================================
2 * Copyright 1988-2007 University of Washington
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 *
11 * ========================================================================
12 */
14 /*
15 * Program: Operating-system dependent routines -- VAX Ultrix 2.3 version
16 *
17 * Author: Mark Crispin
18 * Networks and Distributed Computing
19 * Computing & Communications
20 * University of Washington
21 * Administration Building, AG-44
22 * Seattle, WA 98195
23 *
24 * Date: 11 May 1989
25 * Last Edited: 16 August 2007
26 */
28 #include "tcp_unix.h" /* must be before osdep includes tcp.h */
29 #include "mail.h"
30 #include "osdep.h"
31 #include <stdio.h>
32 #include <sys/stat.h>
33 #include <sys/time.h>
34 #include <sys/socket.h>
35 #include <netinet/in.h>
36 #include <arpa/inet.h>
37 #include <netdb.h>
38 #include <ctype.h>
39 #include <errno.h>
40 extern int errno; /* just in case */
41 #include <pwd.h>
42 #include "misc.h"
44 #define NFDBITS (sizeof(long) * 8)
46 #define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= \
47 (1 << ((n) % NFDBITS)))
48 #define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= \
49 ~(1 << ((n) % NFDBITS)))
50 #define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & \
51 (1 << ((n) % NFDBITS)))
52 #define FD_ZERO(p) bzero((char *)(p), sizeof(*(p)))
55 /* Old Ultrix has its own wierd inet_addr() that returns a in_addr struct. */
57 /* Portable inet_addr () that returns a u_long
58 * Accepts: dotted host string
59 * Returns: u_long
60 */
62 u_long portable_inet_addr (char *hostname)
63 {
64 struct in_addr *in = &inet_addr (hostname);
65 return in->s_addr;
66 }
69 #define inet_addr portable_inet_addr
71 #include "fs_unix.c"
72 #include "ftl_unix.c"
73 #include "nl_unix.c"
74 #include "env_unix.c"
75 #define fork vfork
76 #include "tcp_unix.c"
77 #include "gr_wait.c"
78 #include "memmove.c"
79 #include "strerror.c"
80 #include "strstr.c"
81 #include "strtoul.c"
82 #include "tz_nul.c"

UW-IMAP'd extensions by yuuji