Lines Matching defs:utmp
43 * binary compatibility routines to support the old utmp interfaces
66 #define IDLEN 4 /* length of id field in utmp */
67 #define SC_WILDC 0xff /* wild char for utmp ids */
108 * prototypes for utmp compatibility routines (in getut.c)
110 extern struct utmp *_compat_getutent(void);
111 extern struct utmp *_compat_getutid(const struct utmp *);
112 extern struct utmp *_compat_getutline(const struct utmp *);
113 extern struct utmp *_compat_pututline(const struct utmp *);
116 extern void _compat_updwtmp(const char *, struct utmp *);
117 extern struct utmp *_compat_makeut(struct utmp *);
133 static struct utmp utmpcompat; /* Buffer for returning utmp-format data */
239 * or not. If MAXPID won't fit in a signed short, the utmp.ut_pid
269 * "getutent" gets the next entry in the utmp file.
271 struct utmp *
383 * "getutid" finds the specified entry in the utmp file. If
386 struct utmp *
387 getutid(const struct utmp *entry)
446 * "getutline" searches the "utmp" file for a LOGIN_PROCESS or
449 struct utmp *
450 getutline(const struct utmp *entry)
475 * to the /etc/utmp file.
504 * Convert the utmp struct to strings for command line arguments.
637 * If we are not the superuser than we can't write to /etc/utmp,
649 * utmp structures into the file incase the file is scribbled.)
699 * the utmp record to a utmpx record.
701 struct utmp *
702 pututline(const struct utmp *entry)
771 * and clears the utmp compatibility buffer.
832 * normal "utmp" file. If the file specified is "/var/adm/utmp"
834 * format name, and all "utmp" operations become wrapped calls
837 * an actual "old" utmp file (named something other than /var/adm/utmp),
839 * mode, where we actually call the old utmp routines to operate on
850 if (strcmp(newfile, "/var/adm/utmp") == 0 ||
886 * use the old utmp compatibility routine to write a utmp-format
890 updwtmp(const char *file, struct utmp *ut)
914 struct utmpx utmp; /* holding area */
915 struct utmpx *ucp = &utmp; /* and a pointer to it */
927 (void) memcpy(&utmp, utp, sizeof (utmp));
952 * modut - modify a utmp entry. Also notify init about new pids or
955 * args: utmp - point to utmp structure to be created
957 struct utmp *
958 modut(struct utmp *utp)
989 * allocid - allocate an unused id for utmp, either by recycling a
1145 makeutx(const struct utmpx *utmp)
1157 if (memchr(utmp->ut_id, SC_WILDC, IDLEN) != NULL) {
1171 if (idcmp(utmp->ut_id, ut->ut_id)) {
1192 (void) memcpy((caddr_t)utmp->ut_id, ut->ut_id, IDLEN);
1194 putoneutx(utmp, offset);
1195 updwtmpx(WTMPX_FILE, (struct utmpx *)utmp);
1197 sendpid(ADDPID, (pid_t)utmp->ut_pid);
1198 return ((struct utmpx *)utmp);
1205 if (allocid((char *)utmp->ut_id, saveid)) {
1216 putoneutx(utmp, offset);
1217 updwtmpx(WTMPX_FILE, (struct utmpx *)utmp);
1219 sendpid(ADDPID, (pid_t)utmp->ut_pid);
1220 return ((struct utmpx *)utmp);
1224 utp = pututxline(utmp);
1228 sendpid(ADDPID, (pid_t)utmp->ut_pid);
1234 * makeut - create a utmp entry, recycling an id if a wild card is
1237 * args: utmp - point to utmp structure to be created
1239 struct utmp *
1240 makeut(struct utmp *utmp)
1246 return (_compat_makeut(utmp));
1248 getutmpx(utmp, &utmpx);
1252 getutmp(utmpx2, utmp);
1253 return (utmp);
1340 int pfd; /* file desc. for utmp pipe */
1344 * if for some reason utmp didn't open utmppipe, open it read/write
1358 * getutmpx - convert a utmp record into a utmpx record
1361 getutmpx(const struct utmp *ut, struct utmpx *utx)
1382 * getutmp - convert a utmpx record into a utmp record
1385 getutmp(const struct utmpx *utx, struct utmp *ut)