Commit | Line | Data |
---|---|---|
805e021f CE |
1 | /* |
2 | * Copyright 2000, International Business Machines Corporation and others. | |
3 | * All Rights Reserved. | |
4 | * | |
5 | * This software has been released under the terms of the IBM Public | |
6 | * License. For details, see the LICENSE file in the top-level source | |
7 | * directory or online at http://www.openafs.org/dl/license10.html | |
8 | */ | |
9 | ||
10 | /* winsock.c contains winsock related routines. */ | |
11 | ||
12 | #include <afsconfig.h> | |
13 | #include <afs/param.h> | |
14 | ||
15 | #include <roken.h> | |
16 | ||
17 | #ifdef AFS_NT40_ENV | |
18 | #include <sys/timeb.h> | |
19 | #include <afs/afsutil.h> | |
20 | ||
21 | /* afs_wsInit - LWP version | |
22 | * Initialize the winsock 2 environment. | |
23 | * | |
24 | * Returns 0 on success, -1 on error. | |
25 | */ | |
26 | int | |
27 | afs_winsockInit(void) | |
28 | { | |
29 | int code; | |
30 | WSADATA data; | |
31 | WORD sockVersion; | |
32 | ||
33 | sockVersion = 2; | |
34 | code = WSAStartup(sockVersion, &data); | |
35 | if (code) | |
36 | return -1; | |
37 | ||
38 | if (data.wVersion != 2) | |
39 | return -1; | |
40 | return 0; | |
41 | } | |
42 | ||
43 | void | |
44 | afs_winsockCleanup(void) | |
45 | { | |
46 | WSACleanup(); | |
47 | } | |
48 | ||
49 | /* exported from libafsauthent.dll */ | |
50 | int | |
51 | afs_gettimeofday(struct timeval *tv, struct timezone *tz) | |
52 | { | |
53 | return rk_gettimeofday(tv, tz); | |
54 | } | |
55 | #endif |