/* Copy the information in UTMPX to UTMP. */ void getutmp32 (const struct utmpx32 *utmpx, struct utmp32 *utmp) { struct utmpx in64; struct utmp out64; utmpx_convert32to64 (utmpx, &in64); __getutmp (&in64, &out64); utmp_convert64to32 (&out64, utmp); }
/* Read next entry from a utmp-like file. */ struct utmp32 * getutent32 (void) { struct utmp *out64; ALLOCATE_UTMP32_OUT (out32); out64 = __getutent (); if (!out64) return NULL; utmp_convert64to32 (out64, out32); return out32; }
int getutent32_r (struct utmp32 *buffer, struct utmp32 **result) { struct utmp out64; struct utmp *out64p; int ret; ret = __getutent_r (&out64, &out64p); if (ret == -1) { *result = NULL; return -1; } utmp_convert64to32 (out64p, buffer); *result = buffer; return 0; }
int getutid32_r (const struct utmp32 *id, struct utmp32 *buffer, struct utmp32 **result) { struct utmp in64; struct utmp out64; struct utmp *out64p; int ret; utmp_convert32to64 (id, &in64); ret = __getutid_r (&in64, &out64, &out64p); if (ret == -1) { *result = NULL; return -1; } utmp_convert64to32 (out64p, buffer); *result = buffer; return 0; }