Lines Matching refs:u

231 	struct utmpx u;  in utmpx_set_runlevel()  local
241 bzero(&u, sizeof (struct utmpx)); in utmpx_set_runlevel()
243 u.ut_id[0] = u.ut_id[1] = u.ut_id[2] = u.ut_id[3] = '\0'; in utmpx_set_runlevel()
244 u.ut_pid = 0; in utmpx_set_runlevel()
245 u.ut_type = RUN_LVL; in utmpx_set_runlevel()
247 (void) time(&u.ut_tv.tv_sec); in utmpx_set_runlevel()
252 if ((oup = getutxid(&u)) != NULL) { in utmpx_set_runlevel()
253 bcopy(oup->ut_host, u.ut_host, sizeof (u.ut_host)); in utmpx_set_runlevel()
254 bcopy(oup->ut_line, u.ut_line, sizeof (u.ut_line)); in utmpx_set_runlevel()
255 bcopy(oup->ut_user, u.ut_user, sizeof (u.ut_user)); in utmpx_set_runlevel()
257 tmplen = strlen(u.ut_host); in utmpx_set_runlevel()
259 u.ut_syslen = min(tmplen + 1, sizeof (u.ut_host)); in utmpx_set_runlevel()
261 u.ut_syslen = 0; in utmpx_set_runlevel()
265 u.ut_exit.e_exit = oldrl; in utmpx_set_runlevel()
267 u.ut_exit.e_exit = oup->ut_exit.e_termination; in utmpx_set_runlevel()
269 u.ut_exit.e_exit = '0'; in utmpx_set_runlevel()
271 u.ut_exit.e_termination = runlevel; in utmpx_set_runlevel()
278 u.ut_pid = n_prev[i]; in utmpx_set_runlevel()
282 if (rlevels[i] == u.ut_exit.e_exit) in utmpx_set_runlevel()
289 (void) sprintf(u.ut_line, RUNLVL_MSG, runlevel); in utmpx_set_runlevel()
291 if (pututxline(&u) == NULL) { in utmpx_set_runlevel()
298 updwtmpx(WTMPX_FILE, &u); in utmpx_set_runlevel()
309 struct utmpx u; in utmpx_write_entry() local
313 bzero(&u, sizeof (struct utmpx)); in utmpx_write_entry()
315 u.ut_id[0] = u.ut_id[1] = u.ut_id[2] = u.ut_id[3] = '\0'; in utmpx_write_entry()
316 u.ut_pid = 0; in utmpx_write_entry()
318 u.ut_exit.e_termination = WTERMSIG(0); in utmpx_write_entry()
319 u.ut_exit.e_exit = WEXITSTATUS(0); in utmpx_write_entry()
320 u.ut_type = type; in utmpx_write_entry()
321 u.ut_tv.tv_sec = tstamp; in utmpx_write_entry()
326 if ((oup = getutxid(&u)) != NULL) { in utmpx_write_entry()
327 bcopy(oup->ut_user, u.ut_user, sizeof (u.ut_user)); in utmpx_write_entry()
328 bcopy(oup->ut_line, u.ut_line, sizeof (u.ut_line)); in utmpx_write_entry()
329 bcopy(oup->ut_host, u.ut_host, sizeof (u.ut_host)); in utmpx_write_entry()
331 tmplen = strlen(u.ut_host); in utmpx_write_entry()
333 u.ut_syslen = min(tmplen + 1, sizeof (u.ut_host)); in utmpx_write_entry()
335 u.ut_syslen = 0; in utmpx_write_entry()
338 (void) sprintf(u.ut_line, "%.12s", msg); in utmpx_write_entry()
340 if (pututxline(&u) == NULL) { in utmpx_write_entry()
347 updwtmpx(WTMPX_FILE, &u); in utmpx_write_entry()