Lines Matching defs:utmp
32 * utmp-like files. These routines are only used in
34 * other than /var/adm/utmp or /var/adm/wtmp. In this case,
35 * we assume that someone really wants to read old utmp-format
57 #define IDLEN 4 /* length of id field in utmp */
58 #define SC_WILDC 0xff /* wild char for utmp ids */
65 static void utmp_frec2api(const struct futmp *, struct utmp *);
66 static void utmp_api2frec(const struct utmp *, struct futmp *);
67 struct utmp *_compat_getutent(void);
68 struct utmp *_compat_getutid(const struct utmp *);
69 struct utmp *_compat_getutline(const struct utmp *);
70 struct utmp *_compat_pututline(const struct utmp *);
73 void _compat_updwtmp(const char *, struct utmp *);
74 struct utmp *_compat_makeut(struct utmp *);
75 struct utmp *_compat_modut(struct utmp *);
83 static int fd = -1; /* File descriptor for the utmp file. */
85 * name of the current utmp-like file - set by utmpname (getutx.c)
92 static long loc_utmp; /* Where in "utmp" the current "ubuf" was found. */
96 static struct utmp ubuf; /* Last entry returned to client */
99 * In the 64-bit world, the utmp data structure grows because of
103 utmp_frec2api(const struct futmp *src, struct utmp *dst)
119 utmp_api2frec(const struct utmp *src, struct futmp *dst)
135 * "getutent_frec" gets the raw version of the next entry in the utmp file.
141 * If the "utmp" file is not open, attempt to open it for
159 /* Try to read in the next entry from the utmp file. */
173 * "_compat_getutent" gets the next entry in the utmp file.
175 struct utmp *
188 * "_compat_getutid" finds the specified entry in the utmp file. If
191 struct utmp *
192 _compat_getutid(const struct utmp *entry)
269 * "_compat_getutline" searches the "utmp" file for a LOGIN_PROCESS or
272 struct utmp *
273 _compat_getutline(const struct utmp *entry)
297 * "_compat_pututline" writes the structure sent into the utmp file
300 * utmp file.
302 struct utmp *
303 _compat_pututline(const struct utmp *entry)
306 struct utmp *answer;
307 struct utmp tmpbuf;
321 gdebug("pututline: Unable to create utmp file.\n");
332 * Find the proper entry in the utmp file. Start at the current
337 * utmp structures into the file incase the file is scribbled.)
360 * utmp file.
389 * "_compat_setutent" just resets the utmp file back to the beginning.
406 * "_compat_endutent" closes the utmp file.
424 _compat_updwtmp(const char *file, struct utmp *ut)
448 * makeut - create a utmp entry, recycling an id if a wild card is
451 * args: utmp - point to utmp structure to be created
453 struct utmp *
454 _compat_makeut(struct utmp *utmp)
457 struct utmp *utp; /* "current" utmp entry being examined */
465 if ((unsigned char)utmp->ut_id[i] == SC_WILDC) {
473 * try to lock the utmp file, only needed if we're
489 if (idcmp(utmp->ut_id, utp->ut_id))
500 (void) memcpy(utmp->ut_id, utp->ut_id, IDLEN);
501 utp = _compat_pututline(utmp);
512 if (allocid(utmp->ut_id, saveid)) {
517 utp = _compat_pututline(utmp);
526 utp = _compat_pututline(utmp);
536 * _compat_modut - modify a utmp entry.
538 * args: utmp - point to utmp structure to be created
540 struct utmp *
541 _compat_modut(struct utmp *utp)
544 struct utmp utmp; /* holding area */
545 struct utmp *ucp = &utmp; /* and a pointer to it */
546 struct utmp *up; /* "current" utmp entry being examined */
553 /* copy the supplied utmp structure someplace safe */
554 utmp = *utp;
588 * allocid - allocate an unused id for utmp, either by recycling a
664 * lockut - lock utmp file
682 * unlockut - unlock utmp file