#include
#include
struct utmp foo;
main()
{
printf("%lu\n", sizeof foo);
return 0;
}
Perl:
$utmp_size = utmp_record_size_goes_here;
$wtmp_file = "wtmp filename goes here";
open WTMP, "+<", $wtmp_file or die "$wtmp_file: ", $!;
seek WTMP, -10 * $utmp_size, 2;
truncate WTMP, tell(WTMP);
close WTMP;