1 /* NFSv4.1 client for Windows
2 * Copyright © 2012 The Regents of the University of Michigan
4 * Olga Kornievskaia <aglo@umich.edu>
5 * Casey Bodley <cbodley@umich.edu>
7 * This library is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation; either version 2.1 of the License, or (at
10 * your option) any later version.
12 * This library is distributed in the hope that it will be useful, but
13 * without any warranty; without even the implied warranty of merchantability
14 * or fitness for a particular purpose. See the GNU Lesser General Public
15 * License for more details.
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this library; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 #ifndef _TIRPC_WINTIRPC_H
23 #define _TIRPC_WINTIRPC_H
26 * Eliminate warnings about possibly unsafe uses of snprintf and friends
27 * XXX Think about cleaning these up and removing this later XXX
29 #define _CRT_SECURE_NO_WARNINGS 1
33 /* use visual studio's debug heap */
34 # define _CRTDBG_MAP_ALLOC
41 /* Common Windows includes */
48 #define snprintf _snprintf
49 //#define vsnprintf _vsnprintf
50 #define strcasecmp _stricmp
51 //#define strdup _strdup
52 #define getpid _getpid
55 #define bcopy(d,s,l) memcpy(d,s,l)
56 #define bzero(d,s) memset(d,0,s)
57 #define strtok_r strtok_s
60 #define ioctl ioctlsocket
67 * Hash of Windows Socket Handle values
69 #define WINSOCK_HANDLE_HASH_SIZE 1024
70 #define WINSOCK_HANDLE_HASH(x) (((x) >> 2) % WINSOCK_HANDLE_HASH_SIZE)
73 * Functions imported from BSD
77 int tz_minuteswest
; /* minutes W of Greenwich */
78 int tz_dsttime
; /* type of dst correction */
81 extern int gettimeofday(struct timeval
*tv
, struct timezone
*tz
);
82 extern int asprintf(char **str
, const char *fmt
, ...);
84 #define SOL_IPV6 IPPROTO_IPV6
86 #define MAXHOSTNAMELEN 256
90 char sun_path
[MAX_PATH
];
92 /* Evaluate to actual length of the sockaddr_un structure */
93 /* XXX Should this return size_t or unsigned int ?? */
94 #define SUN_LEN(ptr) ((unsigned int)(sizeof(int) + strlen ((ptr)->sun_path)))
96 /* Debugging function */
97 void wintirpc_debug(char *fmt
, ...);
99 #endif /* !_TIRPC_WINTIRPC_H */