MCPcopy Create free account
hub / github.com/coreutils/coreutils / uptime

Function uptime

src/uptime.c:124–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122 utmp file. */
123
124static _Noreturn void
125uptime (char const *filename, int options)
126{
127 idx_t n_users;
128 STRUCT_UTMP *utmp_buf;
129 int read_utmp_status = (read_utmp (filename, &n_users, &utmp_buf, options) < 0
130 ? EXIT_FAILURE : EXIT_SUCCESS);
131 if (read_utmp_status != EXIT_SUCCESS)
132 {
133 error (0, errno, "%s", quotef (filename));
134 n_users = 0;
135 utmp_buf = NULL;
136 }
137
138 int print_uptime_status = print_uptime (n_users, utmp_buf);
139 exit (MAX (read_utmp_status, print_uptime_status));
140}
141
142void
143usage (int status)

Callers 1

mainFunction · 0.85

Calls 1

print_uptimeFunction · 0.85

Tested by

no test coverage detected