mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-01 23:40:28 +00:00
Add getgroups and setgroups (#619)
This commit is contained in:
parent
3665232d66
commit
4c40c500b8
17 changed files with 280 additions and 29 deletions
|
@ -17,9 +17,9 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
#include "libc/calls/syscall-sysv.internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/nt/accounting.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
|
@ -50,15 +50,15 @@ static textwindows dontinline uint32_t GetUserNameHash(void) {
|
|||
* @asyncsignalsafe
|
||||
* @vforksafe
|
||||
*/
|
||||
int getuid(void) {
|
||||
int rc;
|
||||
uint32_t getuid(void) {
|
||||
uint32_t rc;
|
||||
if (!IsWindows()) {
|
||||
rc = sys_getuid();
|
||||
} else {
|
||||
rc = GetUserNameHash();
|
||||
}
|
||||
|
||||
STRACE("%s() → %d% m", "getuid", rc);
|
||||
STRACE("%s() → %u% m", "getuid", rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -71,13 +71,13 @@ int getuid(void) {
|
|||
* @asyncsignalsafe
|
||||
* @vforksafe
|
||||
*/
|
||||
int getgid(void) {
|
||||
int rc;
|
||||
uint32_t getgid(void) {
|
||||
uint32_t rc;
|
||||
if (!IsWindows()) {
|
||||
rc = sys_getgid();
|
||||
} else {
|
||||
rc = GetUserNameHash();
|
||||
}
|
||||
STRACE("%s() → %d% m", "getgid", rc);
|
||||
STRACE("%s() → %u% m", "getgid", rc);
|
||||
return rc;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue