{"action":"opened","issue":{"url":"https://api.github.com/repos/rust-lang/libc/issues/338","repository_url":"https://api.github.com/repos/rust-lang/libc","labels_url":"https://api.github.com/repos/rust-lang/libc/issues/338/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/libc/issues/338/comments","events_url":"https://api.github.com/repos/rust-lang/libc/issues/338/events","html_url":"https://github.com/rust-lang/libc/issues/338","id":167267251,"number":338,"title":"Add struct utmp","user":{"login":"knight42","id":4237254,"avatar_url":"https://avatars.githubusercontent.com/u/4237254?v=3","gravatar_id":"","url":"https://api.github.com/users/knight42","html_url":"https://github.com/knight42","followers_url":"https://api.github.com/users/knight42/followers","following_url":"https://api.github.com/users/knight42/following{/other_user}","gists_url":"https://api.github.com/users/knight42/gists{/gist_id}","starred_url":"https://api.github.com/users/knight42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knight42/subscriptions","organizations_url":"https://api.github.com/users/knight42/orgs","repos_url":"https://api.github.com/users/knight42/repos","events_url":"https://api.github.com/users/knight42/events{/privacy}","received_events_url":"https://api.github.com/users/knight42/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-25T01:38:19Z","updated_at":"2016-07-25T01:38:19Z","closed_at":null,"body":"Since utmp structure and its related functions are missing, I want to add them to libc. However, the definition of struct utmp is a bit tricky:\r\n\r\n```C\r\n           struct utmp {\r\n           ...\r\n           ...\r\n\r\n               /* The ut_session and ut_tv fields must be the same size when\r\n                  compiled 32- and 64-bit.  This allows data files and shared\r\n                  memory to be shared between 32- and 64-bit applications. */\r\n           #if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32\r\n               int32_t ut_session;           /* Session ID (getsid(2)),\r\n                                                used for windowing */\r\n               struct {\r\n                   int32_t tv_sec;           /* Seconds */\r\n                   int32_t tv_usec;          /* Microseconds */\r\n               } ut_tv;                      /* Time entry was made */\r\n           #else\r\n                long   ut_session;           /* Session ID */\r\n                struct timeval ut_tv;        /* Time entry was made */\r\n           #endif\r\n\r\n           ...\r\n           };\r\n```\r\n\r\nI wonder is it safe to assume all 64-bit platforms are 32-bit compatible? If not, how should I handle this case?"}}
{"actor":{"display_login":"knight42"}}