Lines Matching defs:utmp
31 * utmp-like files. These routines are only used in
33 * other than /var/adm/utmp or /var/adm/wtmp. In this case,
34 * we assume that someone really wants to read old utmp-format
62 static void utmp_frec2api(const struct futmp *, struct utmp *);
63 static void utmp_api2frec(const struct utmp *, struct futmp *);
64 struct utmp *_compat_getutent(void);
65 struct utmp *_compat_getutid(const struct utmp *);
66 struct utmp *_compat_getutline(const struct utmp *);
67 struct utmp *_compat_pututline(const struct utmp *);
70 void _compat_updwtmp(const char *, struct utmp *);
71 struct utmp *_compat_makeut(struct utmp *);
72 struct utmp *_compat_modut(struct utmp *);
80 static int fd = -1; /* File descriptor for the utmp file. */
82 * name of the current utmp-like file - set by utmpname (getutx.c)
89 static long loc_utmp; /* Where in "utmp" the current "ubuf" was found. */
93 static struct utmp ubuf; /* Last entry returned to client */
96 * In the 64-bit world, the utmp data structure grows because of
100 utmp_frec2api(const struct futmp *src, struct utmp *dst)
116 utmp_api2frec(const struct utmp *src, struct futmp *dst)
132 * "getutent_frec" gets the raw version of the next entry in the utmp file.
138 * If the "utmp" file is not open, attempt to open it for
156 /* Try to read in the next entry from the utmp file. */
170 * "_compat_getutent" gets the next entry in the utmp file.
172 struct utmp *
185 * "_compat_getutid" finds the specified entry in the utmp file. If
188 struct utmp *
189 _compat_getutid(const struct utmp *entry)
266 * "_compat_getutline" searches the "utmp" file for a LOGIN_PROCESS or
269 struct utmp *
270 _compat_getutline(const struct utmp *entry)
294 * "_compat_pututline" writes the structure sent into the utmp file
297 * utmp file.
299 struct utmp *
300 _compat_pututline(const struct utmp *entry)
303 struct utmp *answer;
304 struct utmp tmpbuf;
318 gdebug("pututline: Unable to create utmp file.\n");
329 * Find the proper entry in the utmp file. Start at the current
334 * utmp structures into the file incase the file is scribbled.)
357 * utmp file.
386 * "_compat_setutent" just resets the utmp file back to the beginning.
403 * "_compat_endutent" closes the utmp file.
421 _compat_updwtmp(const char *file, struct utmp *ut)
445 * makeut - create a utmp entry, recycling an id if a wild card is
448 * args: utmp - point to utmp structure to be created
450 struct utmp *
451 _compat_makeut(struct utmp *utmp)
454 struct utmp *utp; /* "current" utmp entry being examined */
462 if (utmp->ut_id[i] == _UTMP_ID_WILDCARD) {
470 * try to lock the utmp file, only needed if we're
486 if (idcmp(utmp->ut_id, utp->ut_id))
497 (void) memcpy(utmp->ut_id, utp->ut_id, _UTMP_ID_LEN);
498 utp = _compat_pututline(utmp);
509 if (allocid(utmp->ut_id, saveid)) {
514 utp = _compat_pututline(utmp);
523 utp = _compat_pututline(utmp);
533 * _compat_modut - modify a utmp entry.
535 * args: utmp - point to utmp structure to be created
537 struct utmp *
538 _compat_modut(struct utmp *utp)
541 struct utmp utmp; /* holding area */
542 struct utmp *ucp = &utmp; /* and a pointer to it */
543 struct utmp *up; /* "current" utmp entry being examined */
550 /* copy the supplied utmp structure someplace safe */
551 utmp = *utp;
585 * allocid - allocate an unused id for utmp, either by recycling a
661 * lockut - lock utmp file
679 * unlockut - unlock utmp file