getutxent() not returning values when using 10.4u SDK
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Why would they be empty when the only change is the SDK? --- Sincerely, Rosyna Keller Technical Support/Carbon troll/Always needs a hug Unsanity: Unsane Tools for Insanely Great People It's either this, or imagining Phil Schiller in a thong. _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... If I call setutxent()/getutxent()/endutxent() when using the 10.5 SDK while on 10.5, I correctly get the various fields filled out. If I use the 10.4u SDK only the username is filled out. The ut_type and ut_pid and ut_tv fields are all empty. #include <utmpx.h> #include <stdio.h> inline const char * getType(short type) { char * result = NULL; switch (type) { case BOOT_TIME: result = "Boot Time"; break; case DEAD_PROCESS: result = "Dead Process"; break; case EMPTY: result = "Empty"; break; case INIT_PROCESS: result = "Init Process"; break; case LOGIN_PROCESS: result = "Login Process"; break; case NEW_TIME: result = "New Time"; break; case OLD_TIME: result = "Old Time"; break; case RUN_LVL: result = "Run Level"; break; case USER_PROCESS: result = "User Process"; break; default: result = "Unknown"; break; } return result; } int main() { int nlines = 0; struct utmpx * ux = NULL; setutxent(); while (ux = getutxent()) { printf("Line[%i]: %s @ %s (%s)\n", nlines++, ux->ut_user, ux->ut_host, getType(ux->ut_type)); } endutxent(); return 0; } This email sent to site_archiver@lists.apple.com
participants (1)
-
Rosyna