Lines Matching defs:utmp
50 #include <utmp.h>
317 struct utmp utmp;
323 (void) time(&utmp.ut_time);
324 utmp.ut_type = USER_PROCESS;
325 utmp.ut_pid = getpid();
326 strncpy(utmp.ut_user,myname,sizeof(utmp.ut_user));
327 strncpy(utmp.ut_host,hostname,sizeof(utmp.ut_host));
328 strncpy(utmp.ut_line,linet+5,sizeof(utmp.ut_line));
329 strncpy(utmp.ut_id,linet+8,sizeof(utmp.ut_id));
330 if (pututline(&utmp) == NULL) {
392 struct utmp utmp;
396 (void) strncpy(utmp.ut_id, linet + strlen(linet) - 4,
397 sizeof (utmp.ut_id));
398 utmp.ut_type = USER_PROCESS;
400 /* position to entry in utmp file */
401 if(getutid(&utmp) == NULL) {
402 expDiagLog("resetptyutmp: no utmp entry for %s\n",linet);
403 return(-1); /* no utmp entry for this line ??? */
407 strncpy(utmp.ut_name,"",sizeof(utmp.ut_name));
408 strncpy(utmp.ut_host,"",sizeof(utmp.ut_host));
409 time(&utmp.ut_time);
410 utmp.ut_type = DEAD_PROCESS;
411 utmp.ut_exit.e_exit = 0;
414 pututline(&utmp);