master
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6#include <stddef.h>
7#include <errno.h>
8#include <unistd.h>
9#include <windows.h>
10
11char *getlogin(void);
12
13char *getlogin(void)
14{
15 static char user_name[MAX_PATH];
16 DWORD length = sizeof (user_name);
17
18 if (GetUserName (user_name, &length))
19 return user_name;
20 return NULL;
21}
22