1 /** **************************************************************************
4 * Copyright 2008 Bryan Ischo <bryan@ischo.com>
6 * This file is part of libs3.
8 * libs3 is free software: you can redistribute it and/or modify it under the
9 * terms of the GNU General Public License as published by the Free Software
10 * Foundation, version 3 of the License.
12 * In addition, as a special exception, the copyright holders give
13 * permission to link the code of this library and its programs with the
14 * OpenSSL library, and distribute linked combinations including the two.
16 * libs3 is distributed in the hope that it will be useful, but WITHOUT ANY
17 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21 * You should have received a copy of the GNU General Public License version 3
22 * along with libs3, in a file named COPYING. If not, see
23 * <http://www.gnu.org/licenses/>.
25 ************************************************************************** **/
28 #include <sys/utsname.h>
30 unsigned long pthread_self()
32 return (unsigned long) GetCurrentThreadId();
36 int pthread_mutex_init(pthread_mutex_t *mutex, void *v)
40 InitializeCriticalSection(&(mutex->criticalSection));
46 int pthread_mutex_lock(pthread_mutex_t *mutex)
48 EnterCriticalSection(&(mutex->criticalSection));
54 int pthread_mutex_unlock(pthread_mutex_t *mutex)
56 LeaveCriticalSection(&(mutex->criticalSection));
62 int pthread_mutex_destroy(pthread_mutex_t *mutex)
64 DeleteCriticalSection(&(mutex->criticalSection));
70 int uname(struct utsname *u)
73 info.dwOSVersionInfoSize = sizeof(info);
75 if (!GetVersionEx(&info)) {
81 switch (info.dwMajorVersion) {
83 switch (info.dwMinorVersion) {
85 u->sysname = "Microsoft Windows NT 4.0";
88 u->sysname = "Microsoft Windows 98";
91 u->sysname = "Microsoft Windows Me";
99 switch (info.dwMinorVersion) {
101 u->sysname = "Microsoft Windows 2000";
104 u->sysname = "Microsoft Windows XP";
107 u->sysname = "Microsoft Server 2003";