Skip to content

Instantly share code, notes, and snippets.

@briangreenery
Created November 22, 2013 23:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save briangreenery/7608410 to your computer and use it in GitHub Desktop.
Save briangreenery/7608410 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <utmp.h>
int main()
{
setutent();
struct utmp* entry;
for ( entry = getutent(); entry; entry = getutent() )
{
if ( entry->ut_type == USER_PROCESS )
printf( "User: %s\n", entry->ut_user );
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment