Lines Matching defs:utmpx

51 #include <utmpx.h>
66 #define MAXFILE 79 /* Maximum pathname length for "utmpx" file */
73 #define ETC_UTMPX_FILE "/etc/utmpx"
91 static void utmpx_frec2api(const struct futmpx *, struct utmpx *);
92 static void utmpx_api2frec(const struct utmpx *, struct futmpx *);
101 static struct utmpx *invoke_utmp_update(const struct utmpx *);
103 static void putoneutx(const struct utmpx *, off_t);
118 static int fd = -1; /* File descriptor for the utmpx file. */
123 static FILE *fp = NULL; /* Buffered file descriptior for utmpx file */
124 static int changed_name = 0; /* Flag set when not using utmpx file */
130 static struct utmpx ubuf; /* Last entry returned to client */
134 * In the 64-bit world, the utmpx data structure grows because of
138 utmpx_frec2api(const struct futmpx *src, struct utmpx *dst)
159 utmpx_api2frec(const struct utmpx *src, struct futmpx *dst)
180 * "getutxent_frec" gets the raw version of the next entry in the utmpx file.
186 * If the "utmpx" file is not open, attempt to open it for
223 * Try to read in the next entry from the utmpx file.
254 * "getutxent" gets the next entry in the utmpx file.
256 struct utmpx *
273 struct utmpx *utmpx;
284 if ((utmpx = getutxent()) == NULL)
287 getutmp(utmpx, &utmpcompat);
292 * "getutxid" finds the specified entry in the utmpx file. If
295 struct utmpx *
296 getutxid(const struct utmpx *entry)
305 * the same utmpx structure over and over again."
388 struct utmpx utmpx;
389 struct utmpx *utmpx2;
399 getutmpx(entry, &utmpx);
400 if ((utmpx2 = getutxid(&utmpx)) == NULL)
407 * "getutxline" searches the "utmpx" file for a LOGIN_PROCESS or
410 struct utmpx *
411 getutxline(const struct utmpx *entry)
418 * the same utmpx structure over and over again."
451 struct utmpx utmpx;
452 struct utmpx *utmpx2;
463 getutmpx(entry, &utmpx);
464 if ((utmpx2 = getutxline(&utmpx)) == NULL)
480 static struct utmpx *
481 invoke_utmp_update(const struct utmpx *entryx)
496 struct utmpx *curx = NULL;
604 * "pututxline" writes the structure sent into the utmpx file.
607 * utmpx file.
610 struct utmpx *
611 pututxline(const struct utmpx *entry)
613 struct utmpx *answer;
615 struct utmpx tmpxbuf;
632 return ((struct utmpx *)NULL);
643 * Find the proper entry in the utmpx file. Start at the current
672 * utmpx file.
675 answer = (struct utmpx *)NULL;
698 * the utmp record to a utmpx record.
703 struct utmpx utmpx;
704 struct utmpx *utmpx2;
709 getutmpx(entry, &utmpx);
710 if ((utmpx2 = pututxline(&utmpx)) == NULL)
717 * "setutxent" just resets the utmpx file back to the beginning.
751 * "endutxent" closes the utmpx file.
786 * normal "utmpx" file.
800 * The name of the utmpx file has to end with 'x'
816 * If the file is being changed to UTMPX_FILE, /etc/utmpx or
817 * /var/adm/utmpx then we clear the flag so pututxline invokes
834 * or "/var/adm/wtmp", it is translated to the corresponding "utmpx"
836 * to the equivalent "utmpx" routines, with data conversions
868 updwtmpx(const char *filex, struct utmpx *utx)
893 struct utmpx utmpx;
899 getutmpx(ut, &utmpx);
900 updwtmpx((const char *)&xfile, &utmpx);
906 * modutx - modify a utmpx entry. Also notify init about new pids or
909 * args: utp- point to utmpx structure to be created
911 struct utmpx *
912 modutx(const struct utmpx *utp)
915 struct utmpx utmp; /* holding area */
916 struct utmpx *ucp = &utmp; /* and a pointer to it */
917 struct utmpx *up; /* "current" utmpx entry */
926 * copy the supplied utmpx structure someplace safe
961 struct utmpx utmpx;
962 struct utmpx *utmpx2;
964 getutmpx(utp, &utmpx);
965 if ((utmpx2 = modutx(&utmpx)) == NULL)
1076 * lockutx - lock utmpx file
1102 * unlockutx - unlock utmpx file
1140 * makeutx - create a utmpx entry, recycling an id if a wild card is
1143 * args: utmpx - point to utmpx structure to be created
1146 struct utmpx *
1147 makeutx(const struct utmpx *utmp)
1149 struct utmpx *utp;
1150 struct futmpx *ut; /* "current" utmpx being examined */
1161 * try to lock the utmpx file, only needed if
1192 * just go to that offset utmpx and write it out.
1198 updwtmpx(WTMPX_FILE, (struct utmpx *)utmp);
1201 return ((struct utmpx *)utmp);
1214 * and also update the utmpx file.
1220 updwtmpx(WTMPX_FILE, (struct utmpx *)utmp);
1223 return ((struct utmpx *)utmp);
1245 struct utmpx utmpx;
1246 struct utmpx *utmpx2;
1251 getutmpx(utmp, &utmpx);
1252 if ((utmpx2 = makeutx(&utmpx)) == NULL)
1264 * Buffered read routine to get one entry from utmpx file
1324 putoneutx(const struct utmpx *utpx, off_t off)
1329 (void) lseek(fd, off, SEEK_SET); /* seek in the utmpx file */
1361 * getutmpx - convert a utmp record into a utmpx record
1364 getutmpx(const struct utmp *ut, struct utmpx *utx)
1385 * getutmp - convert a utmpx record into a utmp record
1388 getutmp(const struct utmpx *utx, struct utmp *ut)