Permalink
Cannot retrieve contributors at this time
Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up
Find file
Copy path
linux_embedded_articles/library-versioning/no_method_build_fail/libusrmgr.so.1.0.0/usrmgr.c
Find file
Copy path
Fetching contributors…

#include "usrmgr.h" | |
/* Retourne la liste des utilisateurs connectés */ | |
void getLoggedUsers(){ | |
struct utmpx *utmpUser; | |
setutxent(); // Ouverture du fichier /var/run/utmp | |
/* Parcours de la liste des utilisateurs */ | |
while ((utmpUser = getutxent()) != NULL) { | |
printf("Utilisateur : %s <=> PID : %ld at : %s", utmpUser->ut_user, | |
(long) utmpUser->ut_pid, ctime((time_t *) &(utmpUser->ut_tv.tv_sec))); | |
} | |
} | |