Skip to content

Instantly share code, notes, and snippets.

/*
* Author: NagaChaitanya Vellanki
*
*
* ./sysconf_limits
*
* Sample output
* ---------------------------------------------------------------------------
* _SC_ARG_MAX value is 131072
/*
* Author: NagaChaitanya Vellanki
*
*
*
*/
#include <errno.h>
#include <stdarg.h>
/*
* Author: NagaChaitanya Vellanki
*
*
* TZ environment variable affects ctime(), mktime(), localtime() and
* strftime()
*
* Sample outputs
* --------------------------------------------------------------------------
/*
* Author: NagaChaitanya Vellanki
*
* strptime example listing 10-3 of LPI book
*/
#define _XOPEN_SOURCE
#define BUF_SIZE 1000
/*
* Author: NagaChaitanya Vellanki
*
*see listing 10-2 of LPI book
*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
/*
* Author: NagaChaitanya Vellanki
*
*
*
* uptime command implementation
*/
#include <errno.h>
/*
* Author: NagaChaitanya Vellanki
*
* Refer to Listing 8-2 of LPI book
*
* Authenticate user against the /etc/shadow
* gcc -Wall -pedantic -o check_user_password check_user_password.c -lcrypt
*
* sudo ./check_user_password
/*
* Author: NagaChaitanya Vellanki
*
*
* Read entries in the groups file one at a time
*/
#include <grp.h>
#include <stdio.h>
/*
* Author: NagaChaitanya Vellanki
*
*
* ./read_group_file sys 0
*
* sample output
* ---------------------
/*
*
* Author: NagaChaitanya Vellanki
*
*
* Read entries in the passwd one at a time using getpwent
*/
#include <pwd.h>