{"action":"created","comment":{"url":"https://api.github.com/repos/libuv/libuv/pulls/comments/43198806","id":43198806,"diff_hunk":"@@ -188,9 +193,38 @@ static ssize_t uv__fs_futime(uv_fs_t* req) {\n   }\n \n   return r;\n+#elif defined(__APPLE__)\n+  struct attrlist attr_list;\n+  struct timespec times[3];\n+  unsigned i = 0;\n+\n+  bzero(&attr_list, sizeof(attr_list));\n+\n+  attr_list.bitmapcount = ATTR_BIT_MAP_COUNT;\n+\n+  if (!isnan(req->btime)) {\n+    attr_list.commonattr |= ATTR_CMN_CRTIME;\n+\n+    times[i++].tv_sec = req->btime;\n+    times[i].tv_nsec = (unsigned long)(req->btime * 1000000) % 1000000 * 1000;\n+  }\n+\n+  if (!isnan(req->atime)) {\n+    attr_list.commonattr |= ATTR_CMN_ACCTIME;\n+\n+    times[i++].tv_sec = req->atime;\n+    times[i].tv_nsec = (unsigned long)(req->atime * 1000000) % 1000000 * 1000;\n+  }\n \n-#elif defined(__APPLE__)                                                      \\\n-    || defined(__DragonFly__)                                                 \\\n+  if (!isnan(req->mtime)) {\n+    attr_list.commonattr |= ATTR_CMN_MODTIME;\n+\n+    times[i++].tv_sec = req->mtime;\n+    times[i].tv_nsec = (unsigned long)(req->mtime * 1000000) % 1000000 * 1000;\n+  }\n+\n+  return fsetattrlist(req->file, &attr_list, times, i * sizeof(times), 0);","path":"src/unix/fs.c","position":55,"original_position":55,"commit_id":"d224828c2f117d8e16ca7b5e48151b13cfaa3734","original_commit_id":"d224828c2f117d8e16ca7b5e48151b13cfaa3734","user":{"login":"whitlockjc","id":98899,"avatar_url":"https://avatars.githubusercontent.com/u/98899?v=3","gravatar_id":"","url":"https://api.github.com/users/whitlockjc","html_url":"https://github.com/whitlockjc","followers_url":"https://api.github.com/users/whitlockjc/followers","following_url":"https://api.github.com/users/whitlockjc/following{/other_user}","gists_url":"https://api.github.com/users/whitlockjc/gists{/gist_id}","starred_url":"https://api.github.com/users/whitlockjc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whitlockjc/subscriptions","organizations_url":"https://api.github.com/users/whitlockjc/orgs","repos_url":"https://api.github.com/users/whitlockjc/repos","events_url":"https://api.github.com/users/whitlockjc/events{/privacy}","received_events_url":"https://api.github.com/users/whitlockjc/received_events","type":"User","site_admin":false},"body":"My fault, I meant for it to be `i * sizeof(timespec)`.","created_at":"2015-10-27T22:49:41Z","updated_at":"2015-10-27T22:49:41Z","html_url":"https://github.com/libuv/libuv/pull/590#discussion_r43198806","pull_request_url":"https://api.github.com/repos/libuv/libuv/pulls/590","_links":{"self":{"href":"https://api.github.com/repos/libuv/libuv/pulls/comments/43198806"},"html":{"href":"https://github.com/libuv/libuv/pull/590#discussion_r43198806"},"pull_request":{"href":"https://api.github.com/repos/libuv/libuv/pulls/590"}}},"pull_request":{"url":"https://api.github.com/repos/libuv/libuv/pulls/590","id":48932343,"html_url":"https://github.com/libuv/libuv/pull/590","diff_url":"https://github.com/libuv/libuv/pull/590.diff","patch_url":"https://github.com/libuv/libuv/pull/590.patch","issue_url":"https://api.github.com/repos/libuv/libuv/issues/590","number":590,"state":"open","locked":false,"title":"fs: add uv_fs_utime_ex and uv_fs_futime_ex","user":{"login":"whitlockjc","id":98899,"avatar_url":"https://avatars.githubusercontent.com/u/98899?v=3","gravatar_id":"","url":"https://api.github.com/users/whitlockjc","html_url":"https://github.com/whitlockjc","followers_url":"https://api.github.com/users/whitlockjc/followers","following_url":"https://api.github.com/users/whitlockjc/following{/other_user}","gists_url":"https://api.github.com/users/whitlockjc/gists{/gist_id}","starred_url":"https://api.github.com/users/whitlockjc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whitlockjc/subscriptions","organizations_url":"https://api.github.com/users/whitlockjc/orgs","repos_url":"https://api.github.com/users/whitlockjc/repos","events_url":"https://api.github.com/users/whitlockjc/events{/privacy}","received_events_url":"https://api.github.com/users/whitlockjc/received_events","type":"User","site_admin":false},"body":"These new functions behave identicaly to uv_fs_utime and uv_fs_futime\r\nrespectively for every OS other than OS X and Windows.  For OS X and\r\nWindows these new APIs will allow you to alter the birth/creation time\r\nof the file as well as the access and modify times.\r\n\r\nFixes #499","created_at":"2015-10-27T21:05:53Z","updated_at":"2015-10-27T22:49:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"754aa7dfa0725c11b0aa0e13a7f5a1bb8ba5d3ae","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/libuv/libuv/pulls/590/commits","review_comments_url":"https://api.github.com/repos/libuv/libuv/pulls/590/comments","review_comment_url":"https://api.github.com/repos/libuv/libuv/pulls/comments{/number}","comments_url":"https://api.github.com/repos/libuv/libuv/issues/590/comments","statuses_url":"https://api.github.com/repos/libuv/libuv/statuses/d224828c2f117d8e16ca7b5e48151b13cfaa3734","head":{"label":"whitlockjc:issue-499","ref":"issue-499","sha":"d224828c2f117d8e16ca7b5e48151b13cfaa3734","user":{"login":"whitlockjc","id":98899,"avatar_url":"https://avatars.githubusercontent.com/u/98899?v=3","gravatar_id":"","url":"https://api.github.com/users/whitlockjc","html_url":"https://github.com/whitlockjc","followers_url":"https://api.github.com/users/whitlockjc/followers","following_url":"https://api.github.com/users/whitlockjc/following{/other_user}","gists_url":"https://api.github.com/users/whitlockjc/gists{/gist_id}","starred_url":"https://api.github.com/users/whitlockjc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whitlockjc/subscriptions","organizations_url":"https://api.github.com/users/whitlockjc/orgs","repos_url":"https://api.github.com/users/whitlockjc/repos","events_url":"https://api.github.com/users/whitlockjc/events{/privacy}","received_events_url":"https://api.github.com/users/whitlockjc/received_events","type":"User","site_admin":false},"repo":{"id":38257931,"name":"libuv","full_name":"whitlockjc/libuv","owner":{"login":"whitlockjc","id":98899,"avatar_url":"https://avatars.githubusercontent.com/u/98899?v=3","gravatar_id":"","url":"https://api.github.com/users/whitlockjc","html_url":"https://github.com/whitlockjc","followers_url":"https://api.github.com/users/whitlockjc/followers","following_url":"https://api.github.com/users/whitlockjc/following{/other_user}","gists_url":"https://api.github.com/users/whitlockjc/gists{/gist_id}","starred_url":"https://api.github.com/users/whitlockjc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whitlockjc/subscriptions","organizations_url":"https://api.github.com/users/whitlockjc/orgs","repos_url":"https://api.github.com/users/whitlockjc/repos","events_url":"https://api.github.com/users/whitlockjc/events{/privacy}","received_events_url":"https://api.github.com/users/whitlockjc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/whitlockjc/libuv","description":"Cross-platform asychronous I/O","fork":true,"url":"https://api.github.com/repos/whitlockjc/libuv","forks_url":"https://api.github.com/repos/whitlockjc/libuv/forks","keys_url":"https://api.github.com/repos/whitlockjc/libuv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/whitlockjc/libuv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/whitlockjc/libuv/teams","hooks_url":"https://api.github.com/repos/whitlockjc/libuv/hooks","issue_events_url":"https://api.github.com/repos/whitlockjc/libuv/issues/events{/number}","events_url":"https://api.github.com/repos/whitlockjc/libuv/events","assignees_url":"https://api.github.com/repos/whitlockjc/libuv/assignees{/user}","branches_url":"https://api.github.com/repos/whitlockjc/libuv/branches{/branch}","tags_url":"https://api.github.com/repos/whitlockjc/libuv/tags","blobs_url":"https://api.github.com/repos/whitlockjc/libuv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/whitlockjc/libuv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/whitlockjc/libuv/git/refs{/sha}","trees_url":"https://api.github.com/repos/whitlockjc/libuv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/whitlockjc/libuv/statuses/{sha}","languages_url":"https://api.github.com/repos/whitlockjc/libuv/languages","stargazers_url":"https://api.github.com/repos/whitlockjc/libuv/stargazers","contributors_url":"https://api.github.com/repos/whitlockjc/libuv/contributors","subscribers_url":"https://api.github.com/repos/whitlockjc/libuv/subscribers","subscription_url":"https://api.github.com/repos/whitlockjc/libuv/subscription","commits_url":"https://api.github.com/repos/whitlockjc/libuv/commits{/sha}","git_commits_url":"https://api.github.com/repos/whitlockjc/libuv/git/commits{/sha}","comments_url":"https://api.github.com/repos/whitlockjc/libuv/comments{/number}","issue_comment_url":"https://api.github.com/repos/whitlockjc/libuv/issues/comments{/number}","contents_url":"https://api.github.com/repos/whitlockjc/libuv/contents/{+path}","compare_url":"https://api.github.com/repos/whitlockjc/libuv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/whitlockjc/libuv/merges","archive_url":"https://api.github.com/repos/whitlockjc/libuv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/whitlockjc/libuv/downloads","issues_url":"https://api.github.com/repos/whitlockjc/libuv/issues{/number}","pulls_url":"https://api.github.com/repos/whitlockjc/libuv/pulls{/number}","milestones_url":"https://api.github.com/repos/whitlockjc/libuv/milestones{/number}","notifications_url":"https://api.github.com/repos/whitlockjc/libuv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/whitlockjc/libuv/labels{/name}","releases_url":"https://api.github.com/repos/whitlockjc/libuv/releases{/id}","created_at":"2015-06-29T16:25:59Z","updated_at":"2015-06-29T16:26:01Z","pushed_at":"2015-10-27T20:47:59Z","git_url":"git://github.com/whitlockjc/libuv.git","ssh_url":"git@github.com:whitlockjc/libuv.git","clone_url":"https://github.com/whitlockjc/libuv.git","svn_url":"https://github.com/whitlockjc/libuv","homepage":"http://libuv.org/","size":12253,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"v1.x"}},"base":{"label":"libuv:v1.x","ref":"v1.x","sha":"7d7400c87f04aa780257785672735a2708cc9339","user":{"login":"libuv","id":4030929,"avatar_url":"https://avatars.githubusercontent.com/u/4030929?v=3","gravatar_id":"","url":"https://api.github.com/users/libuv","html_url":"https://github.com/libuv","followers_url":"https://api.github.com/users/libuv/followers","following_url":"https://api.github.com/users/libuv/following{/other_user}","gists_url":"https://api.github.com/users/libuv/gists{/gist_id}","starred_url":"https://api.github.com/users/libuv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libuv/subscriptions","organizations_url":"https://api.github.com/users/libuv/orgs","repos_url":"https://api.github.com/users/libuv/repos","events_url":"https://api.github.com/users/libuv/events{/privacy}","received_events_url":"https://api.github.com/users/libuv/received_events","type":"Organization","site_admin":false},"repo":{"id":14812739,"name":"libuv","full_name":"libuv/libuv","owner":{"login":"libuv","id":4030929,"avatar_url":"https://avatars.githubusercontent.com/u/4030929?v=3","gravatar_id":"","url":"https://api.github.com/users/libuv","html_url":"https://github.com/libuv","followers_url":"https://api.github.com/users/libuv/followers","following_url":"https://api.github.com/users/libuv/following{/other_user}","gists_url":"https://api.github.com/users/libuv/gists{/gist_id}","starred_url":"https://api.github.com/users/libuv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libuv/subscriptions","organizations_url":"https://api.github.com/users/libuv/orgs","repos_url":"https://api.github.com/users/libuv/repos","events_url":"https://api.github.com/users/libuv/events{/privacy}","received_events_url":"https://api.github.com/users/libuv/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/libuv/libuv","description":"Cross-platform asychronous I/O","fork":false,"url":"https://api.github.com/repos/libuv/libuv","forks_url":"https://api.github.com/repos/libuv/libuv/forks","keys_url":"https://api.github.com/repos/libuv/libuv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/libuv/libuv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/libuv/libuv/teams","hooks_url":"https://api.github.com/repos/libuv/libuv/hooks","issue_events_url":"https://api.github.com/repos/libuv/libuv/issues/events{/number}","events_url":"https://api.github.com/repos/libuv/libuv/events","assignees_url":"https://api.github.com/repos/libuv/libuv/assignees{/user}","branches_url":"https://api.github.com/repos/libuv/libuv/branches{/branch}","tags_url":"https://api.github.com/repos/libuv/libuv/tags","blobs_url":"https://api.github.com/repos/libuv/libuv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/libuv/libuv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/libuv/libuv/git/refs{/sha}","trees_url":"https://api.github.com/repos/libuv/libuv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/libuv/libuv/statuses/{sha}","languages_url":"https://api.github.com/repos/libuv/libuv/languages","stargazers_url":"https://api.github.com/repos/libuv/libuv/stargazers","contributors_url":"https://api.github.com/repos/libuv/libuv/contributors","subscribers_url":"https://api.github.com/repos/libuv/libuv/subscribers","subscription_url":"https://api.github.com/repos/libuv/libuv/subscription","commits_url":"https://api.github.com/repos/libuv/libuv/commits{/sha}","git_commits_url":"https://api.github.com/repos/libuv/libuv/git/commits{/sha}","comments_url":"https://api.github.com/repos/libuv/libuv/comments{/number}","issue_comment_url":"https://api.github.com/repos/libuv/libuv/issues/comments{/number}","contents_url":"https://api.github.com/repos/libuv/libuv/contents/{+path}","compare_url":"https://api.github.com/repos/libuv/libuv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/libuv/libuv/merges","archive_url":"https://api.github.com/repos/libuv/libuv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/libuv/libuv/downloads","issues_url":"https://api.github.com/repos/libuv/libuv/issues{/number}","pulls_url":"https://api.github.com/repos/libuv/libuv/pulls{/number}","milestones_url":"https://api.github.com/repos/libuv/libuv/milestones{/number}","notifications_url":"https://api.github.com/repos/libuv/libuv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/libuv/libuv/labels{/name}","releases_url":"https://api.github.com/repos/libuv/libuv/releases{/id}","created_at":"2013-11-30T00:29:56Z","updated_at":"2015-10-27T22:42:29Z","pushed_at":"2015-10-27T21:48:25Z","git_url":"git://github.com/libuv/libuv.git","ssh_url":"git@github.com:libuv/libuv.git","clone_url":"https://github.com/libuv/libuv.git","svn_url":"https://github.com/libuv/libuv","homepage":"http://libuv.org/","size":18532,"stargazers_count":2518,"watchers_count":2518,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":366,"mirror_url":null,"open_issues_count":103,"forks":366,"open_issues":103,"watchers":2518,"default_branch":"v1.x"}},"_links":{"self":{"href":"https://api.github.com/repos/libuv/libuv/pulls/590"},"html":{"href":"https://github.com/libuv/libuv/pull/590"},"issue":{"href":"https://api.github.com/repos/libuv/libuv/issues/590"},"comments":{"href":"https://api.github.com/repos/libuv/libuv/issues/590/comments"},"review_comments":{"href":"https://api.github.com/repos/libuv/libuv/pulls/590/comments"},"review_comment":{"href":"https://api.github.com/repos/libuv/libuv/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/libuv/libuv/pulls/590/commits"},"statuses":{"href":"https://api.github.com/repos/libuv/libuv/statuses/d224828c2f117d8e16ca7b5e48151b13cfaa3734"}}}}