void setutxent(void);
#ifdef __BSD_VISIBLE
-int updwtmpx(const char *, const struct utmpx *);
+int _updwtmpx(const char *, const struct utmpx *);
+void updwtmpx(const char *, const struct utmpx *);
struct lastlogx *getlastlogx(const char *, uid_t, struct lastlogx *);
int updlastlogx(const char *, uid_t, struct lastlogx *);
struct utmp;
.Nm getutmpx ,
.Nm updlastlogx ,
.Nm updwtmpx ,
+.Nm _updwtmpx ,
.Nm utmpxname
.Nd user accounting database functions
.Sh LIBRARY
.Fn getutmpx "const struct utmp *u" "struct utmpx *ux"
.Ft int
.Fn updlastlogx "const char *fname" "uid_t uid" "struct lastlogx *ll"
-.Ft int
+.Ft void
.Fn updwtmpx "const char *file" "const struct utmpx *utx"
.Ft int
+.Fn _updwtmpx "const char *file" "const struct utmpx *utx"
+.Ft int
.Fn utmpxname "const char *fname"
.Sh DESCRIPTION
The
.Pp
The
.Fn updwtmpx
-function updates the
+and
+.Fn _updwtmpx
+functions update the
.Xr wtmpx 5
file
.Fa file
.Pp
.Fn updlastlogx
and
-.Fn updwtmpx
+.Fn _updwtmpx
return 0 on success, or \-1 in case the database or file respectively
could not be opened or the data not written into it.
.Sh SEE ALSO
.Fn getutmp ,
.Fn getutmpx ,
.Fn updwtmpx ,
+.Fn _updwtmpx
and
.Fn utmpxname
first appeared in
/*
* The following are extensions and not part of the X/Open spec.
*/
-int
+void
updwtmpx(const char *file, const struct utmpx *utx)
{
+ (void)_updwtmpx(file, utx);
+}
+
+int
+_updwtmpx(const char *file, const struct utmpx *utx)
+{
int fd;
int saved_errno;
if (pututxline(&utmpx) == NULL)
logit(LOG_NOTICE, "Cannot update utmpx %m");
endutxent();
- if (updwtmpx(_PATH_WTMPX, &utmpx) != 0)
+ if (_updwtmpx(_PATH_WTMPX, &utmpx) != 0)
logit(LOG_NOTICE, "Cannot update wtmpx %m");
}