{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/BashOnWindows/issues/888","repository_url":"https://api.github.com/repos/Microsoft/BashOnWindows","labels_url":"https://api.github.com/repos/Microsoft/BashOnWindows/issues/888/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/BashOnWindows/issues/888/comments","events_url":"https://api.github.com/repos/Microsoft/BashOnWindows/issues/888/events","html_url":"https://github.com/Microsoft/BashOnWindows/issues/888","id":171027243,"number":888,"title":"`int getlogin_r(char *buf, size_t len)` broken","user":{"login":"isavegas","id":3105000,"avatar_url":"https://avatars.githubusercontent.com/u/3105000?v=3","gravatar_id":"","url":"https://api.github.com/users/isavegas","html_url":"https://github.com/isavegas","followers_url":"https://api.github.com/users/isavegas/followers","following_url":"https://api.github.com/users/isavegas/following{/other_user}","gists_url":"https://api.github.com/users/isavegas/gists{/gist_id}","starred_url":"https://api.github.com/users/isavegas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isavegas/subscriptions","organizations_url":"https://api.github.com/users/isavegas/orgs","repos_url":"https://api.github.com/users/isavegas/repos","events_url":"https://api.github.com/users/isavegas/events{/privacy}","received_events_url":"https://api.github.com/users/isavegas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-13T20:59:56Z","updated_at":"2016-08-13T23:31:25Z","closed_at":null,"body":"Please use the following bug reporting template to help produce actionable and reproducible issues:\r\n\r\n* A brief description\r\n    Attempting to use the function to get the login id of the user running the executable returns garbled strings, with a different return value each time.\r\n* Expected results\r\n```C\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <sys/types.h>\r\n#include <unistd.h>\r\n\r\nint main(){\r\n        size_t len = 10;\r\n        char buf[len];\r\n        size_t ret = getlogin_r(buf, len);\r\n        puts(buf);\r\n        return 0;\r\n}\r\n```\r\nshould print out my username, with ret set to 0 to indicate success.\r\n\r\n* Actual results (with terminal output if applicable)\r\n\r\nThe value of ret is 2, indicating an error.\r\nDepending on the C compiler used, it outputs garbage strings.\r\n\u0001\u0001\u0001If compiled with GCC or Clang, it prints out a single \"unknown char\" box.\r\nIf compiled with [TCC](http://bellard.org/tcc/), it prints out a string the size of one's username, composed of aforementioned boxes and random numbers, letters, and symbols.\r\n\r\n* Your Windows build number\r\n\r\n14393\r\n\r\n* Steps / commands required to reproduce the error\r\n\r\n```gcc test.c -o test && ./test```\r\n\r\n* Strace of the failing command\r\n\r\nCommand doesn't fail in this sense.\r\n\r\n* Required packages and commands to install\r\n\r\n```sudo apt-get install build-essential```\r\n\r\n![image](https://cloud.githubusercontent.com/assets/3105000/17645650/981a3d0a-6171-11e6-83ee-2df5e9ff60f4.png)\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/BashOnWindows/issues/comments/239647154","html_url":"https://github.com/Microsoft/BashOnWindows/issues/888#issuecomment-239647154","issue_url":"https://api.github.com/repos/Microsoft/BashOnWindows/issues/888","id":239647154,"user":{"login":"therealkenc","id":7049700,"avatar_url":"https://avatars.githubusercontent.com/u/7049700?v=3","gravatar_id":"","url":"https://api.github.com/users/therealkenc","html_url":"https://github.com/therealkenc","followers_url":"https://api.github.com/users/therealkenc/followers","following_url":"https://api.github.com/users/therealkenc/following{/other_user}","gists_url":"https://api.github.com/users/therealkenc/gists{/gist_id}","starred_url":"https://api.github.com/users/therealkenc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/therealkenc/subscriptions","organizations_url":"https://api.github.com/users/therealkenc/orgs","repos_url":"https://api.github.com/users/therealkenc/repos","events_url":"https://api.github.com/users/therealkenc/events{/privacy}","received_events_url":"https://api.github.com/users/therealkenc/received_events","type":"User","site_admin":false},"created_at":"2016-08-13T23:31:25Z","updated_at":"2016-08-13T23:31:25Z","body":"It's in the `strace`.  WSL has no `/proc/self/loginuid`.\r\n```\r\nopen(\"/proc/self/loginuid\", O_RDONLY)   = -1 ENOENT (No such file or directory)\r\n```\r\n"}}
{"actor":{"display_login":"therealkenc"}}