This commit is contained in:
gandc 2025-02-23 01:01:17 +03:00
parent 573887adce
commit 3e202bc314
Signed by: gandc
GPG Key ID: 9F77B03D43C42CB4
2 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,12 @@
#include "users.h"
#include <stdio.h>
#include <stdlib.h>
#include <pwd.h>
void list_users(FILE *output) {
struct passwd *pw;
while ((pw = getpwent()) != NULL) {
fprintf(output, "%s: %s\n", pw->pw_name, pw->pw_dir);
}
endpwent();
}

View File

@ -0,0 +1,5 @@
#ifndef USERS_H
#define USERS_H
#include <stdio.h>
void list_users(FILE *output);
#endif