getlogin_r and getutxent equivalent in mingw for windows
I am porting my old code from *ix to Windows (on mingw).
A part of the old code contains functionality which gets information about users who logged in from the terminal - using getlogin_r and getutxent functions provided at *ix.I am not able to find equivalent in 开发者_Python百科MINGW.
Can somebody please help me to find the equivalent in Mingw for windows programming?Take a look at gnulib, it supports MinGW too (but not all modules are available there).
getutxent
: not available on MinGW
("This function is missing on some platforms: Mac OS X 10.3, FreeBSD 6.0, OpenBSD 3.8, Minix 3.1.8, mingw, MSVC 9, BeOS.")getlogin_r
: available on MinGW
("Portability problems fixed by Gnulib: This function is missing on some platforms: NetBSD 3.0, Minix 3.1.8, mingw, MSVC 9.")
As an alternative you can emulate them with Win API.
- How to get the username in MinGW?
- LoadUserProfile function / PROFILEINFO structure
- NetUserGetLocalGroups function
- Windows Shell documentation
精彩评论