When I have sizeof(utmp)
, 384 is returned. So when I try to find out the size of the individual members, I get a different result. Using the method below, I come up with 382 bytes. Anyone know where I'm missing the other 2 bytes?
#include <iostream>
using std::cout;
using std::endl;
#include <utmp.h>
void size();
int main()
{
size();
return 0;
}
void size()
{
utmp uLine;
cout << "ut_type: " << sizeof(uLine.ut_type) << " bytes." << endl;
cout << "ut_pid: " << sizeof(uLine.ut_pid) << " bytes." << endl;
cout << "ut_line: " << sizeof(uLine.ut_line) << " bytes." << endl;
cout << "ut_id: " << sizeof(uLine.ut_id) << " bytes." << endl;
cout << "ut_user: " << sizeof(uLine.ut_user) << " bytes." << endl;
cout << "ut_host: " << sizeof(uLine.ut_host) << " bytes." << endl;
cout << "ut_session: " << sizeof(uLine.ut_session) << " bytes." << endl;
cout << "ut_tv: " << sizeof(uLine.ut_tv) << " bytes." << endl;
cout << "ut_addr_v6: " << sizeof(uLine.ut_addr_v6) << " bytes." << endl;
cout << "ut_exit: " << sizeof(uLine.ut_exit) << " bytes." << endl;
cout << "ut__unused: " << sizeof(uLine.__unused) << " bytes." << endl;
}