--- /dev/null
+/*
+ * Copyright (c) 2009 Intel Corp, Inc. All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses. You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * - Redistributions of source code must retain the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _UNISTD_H_
+#define _UNISTD_H_
+
+#include <stdio.h>
+
+#define sleep(s) SleepEx(s * 1000, TRUE)
+
+static __inline int getdomainname(char *name, size_t len)
+{
+ return -1;
+}
+
+static __inline char* getpass(char *message)
+{
+ static char password[128];
+
+ printf("%s", message);
+ scanf_s("%127s", password, 128);
+ return password;
+}
+
+#endif /* _UNISTD_H_ */
\r
return TRUE;\r
}\r
+\r
+__declspec(dllexport)\r
+int ibvw_errno(HRSULT hr)\r
+{\r
+ switch (hr) {\r
+ case WV_SUCCESS: _set_errno(0); return 0;\r
+ case WV_PENDING: _set_errno(EALREADY); break;\r
+ case WV_IO_PENDING: _set_errno(EALREADY); break;\r
+ case WV_TIMEOUT: _set_errno(ETIMEDOUT); break;\r
+ case WV_BUFFER_OVERFLOW: _set_errno(EOVERFLOW); break;\r
+ case WV_DEVICE_BUSY: _set_errno(EBUSY); break;\r
+ case WV_ACCESS_VIOLATION: _set_errno(EACCES); break;\r
+ case WV_INVALID_HANDLE: _set_errno(EINVAL); break;\r
+ case WV_INVALID_PARAMETER: _set_errno(EINVAL); break;\r
+ case WV_NO_MEMORY: _set_errno(ENOMEM); break;\r
+ case WV_INSUFFICIENT_RESOURCES: _set_errno(ENOSPC); break;\r
+ case WV_IO_TIMEOUT: _set_errno(ETIMEDOUT); break;\r
+ case WV_NOT_SUPPORTED: _set_errno(ENOSYS); break;\r
+ case WV_CANCELLED: _set_errno(ECANCELED); break\r
+ case WV_INVALID_ADDRESS: _set_errno(EADDRNOTAVAIL); break;\r
+ case WV_ADDRESS_ALREADY_EXISTS: _set_errno(EADDRINUSE); break;\r
+ case WV_CONNECTION_REFUSED: _set_errno(ECONNREFUSED); break;\r
+ case WV_CONNECTION_INVALID: _set_errno(ENOTCONN); break;\r
+ case WV_CONNECTION_ACTIVE: _set_errno(EISCONN); break;\r
+ case WV_HOST_UNREACHABLE: _set_errno(ENETUNREACH); break;\r
+ case WV_CONNECTION_ABORTED: _set_errno(ECONNABORTED); break;\r
+ case WV_REMOTE_OP_ERROR: _set_errno(EREMOTEIO); break;\r
+ case WV_UNKNOWN_ERROR: _set_errno(eio); break;\r
+ }\r
+ return -1;\r
+}\r