char username[LOGIN_NAME_MAX];
getlogin_r(username, LOGIN_NAME_MAX);
+ // Get current working directory
+ char cwd[PATH_MAX];
+ getcwd(cwd, PATH_MAX);
+
// Get assorted system info
struct sysinfo info;
sysinfo(&info);
// Display
printf("%s@%s\n", username, hostname);
+ printf("%s\n", cwd);
printf("%d-%02d-%02d %02d:%02d:%02d\n", wtime->tm_year + 1900, wtime->tm_mon,
wtime->tm_mday, wtime->tm_hour, wtime->tm_min, wtime->tm_sec);
printf("%0.0f/%0.0f MB RAM\n", (total_kb - avail_kb)/1024.0, total_kb/1024.0);