blob: 0f11cec71645d8a3d5eaa49d806e098456633248 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#include "user.h"
#include "common.h"
const char *display_user_name() {
return run_command_s("whoami");
}
const char *display_user_host() {
#if defined(__OpenBSD__)
return run_command_s("cat /etc/myname");
#elif defined(__NetBSD__)
return run_command_s("hostname");
#elif defined(__FreeBSD__)
return run_command_s("sysctl -n kern.hostname");
#else
return run_command_s("cat /etc/hostname");
#endif
}
|