{"action":"created","comment":{"url":"https://api.github.com/repos/libuv/libuv/pulls/comments/36070468","id":36070468,"diff_hunk":"@@ -2328,3 +2328,181 @@ TEST_IMPL(fs_write_multiple_bufs) {\n   MAKE_VALGRIND_HAPPY();\n   return 0;\n }\n+\n+\n+TEST_IMPL(fs_write_alotof_bufs) {\n+  const size_t iovcount = 54321;\n+  uv_buf_t* iovs;\n+  char* buffer;\n+  size_t index;\n+  int r;\n+\n+  /* Setup. */\n+  unlink(\"test_file\");\n+\n+  loop = uv_default_loop();\n+\n+  iovs = malloc(sizeof(*iovs) * iovcount);\n+\n+  r = uv_fs_open(loop,\n+                 &open_req1,\n+                 \"test_file\",\n+                 O_RDWR | O_CREAT,\n+                 S_IWUSR | S_IRUSR,\n+                 NULL);\n+  ASSERT(r >= 0);\n+  ASSERT(open_req1.result >= 0);\n+  uv_fs_req_cleanup(&open_req1);\n+\n+  for (index = 0; index < iovcount; ++index) {\n+    iovs[index] = uv_buf_init(test_buf, sizeof(test_buf));\n+  }\n+  r = uv_fs_write(loop,\n+                  &write_req,\n+                  open_req1.result,\n+                  iovs,\n+                  iovcount,\n+                  -1,\n+                  NULL);\n+  ASSERT(r >= 0);\n+  ASSERT((size_t)write_req.result == sizeof(test_buf) * iovcount);\n+  uv_fs_req_cleanup(&write_req);\n+\n+  /* Read the strings back to separate buffers. */\n+  buffer = malloc(sizeof(test_buf) * iovcount);\n+  for (index = 0; index < iovcount; ++index) {\n+    iovs[index] = uv_buf_init(buffer + index * sizeof(test_buf),\n+                              sizeof(test_buf));\n+  }\n+\n+  r = uv_fs_read(loop, &read_req, open_req1.result, iovs, iovcount, 0, NULL);\n+  ASSERT(r >= 0);\n+  ASSERT((size_t)read_req.result == sizeof(test_buf) * iovcount);\n+  for (index = 0; index < iovcount; ++index) {\n+    ASSERT(strncmp(buffer + index * sizeof(test_buf),\n+                   test_buf,\n+                   sizeof(test_buf)) == 0);\n+  }\n+  uv_fs_req_cleanup(&read_req);\n+  free(buffer);\n+\n+  iov = uv_buf_init(buf, sizeof(buf));\n+  r = uv_fs_read(loop,\n+                 &read_req,\n+                 open_req1.result,\n+                 &iov,\n+                 1,\n+                 read_req.result,\n+                 NULL);\n+  ASSERT(r == 0);\n+  ASSERT(read_req.result == 0);\n+  uv_fs_req_cleanup(&read_req);\n+\n+  r = uv_fs_close(loop, &close_req, open_req1.result, NULL);\n+  ASSERT(r == 0);\n+  ASSERT(close_req.result == 0);\n+  uv_fs_req_cleanup(&close_req);\n+\n+  /* Cleanup */\n+  unlink(\"test_file\");\n+  free(iovs);\n+\n+  MAKE_VALGRIND_HAPPY();\n+  return 0;\n+}\n+\n+\n+TEST_IMPL(fs_write_alotof_bufs_with_offset) {\n+  const size_t iovcount = 54321;\n+  uv_buf_t* iovs;\n+  char* buffer;\n+  size_t index;\n+  int r;\n+  int64_t offset;\n+  char* filler = \"0123456789\";\n+  size_t fillerLen = strlen(filler);\n+  struct stat s;\n+\n+  /* Setup. */\n+  unlink(\"test_file\");\n+\n+  loop = uv_default_loop();\n+\n+  iovs = malloc(sizeof(*iovs) * iovcount);","path":"test/test-fs.c","position":104,"original_position":104,"commit_id":"70cc077571760818c051665de5cfa8e93d3d1e11","original_commit_id":"70cc077571760818c051665de5cfa8e93d3d1e11","user":{"login":"saghul","id":317464,"avatar_url":"https://avatars.githubusercontent.com/u/317464?v=3","gravatar_id":"","url":"https://api.github.com/users/saghul","html_url":"https://github.com/saghul","followers_url":"https://api.github.com/users/saghul/followers","following_url":"https://api.github.com/users/saghul/following{/other_user}","gists_url":"https://api.github.com/users/saghul/gists{/gist_id}","starred_url":"https://api.github.com/users/saghul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saghul/subscriptions","organizations_url":"https://api.github.com/users/saghul/orgs","repos_url":"https://api.github.com/users/saghul/repos","events_url":"https://api.github.com/users/saghul/events{/privacy}","received_events_url":"https://api.github.com/users/saghul/received_events","type":"User","site_admin":false},"body":"assert that iovs is not null.","created_at":"2015-08-03T09:49:31Z","updated_at":"2015-08-03T09:49:31Z","html_url":"https://github.com/libuv/libuv/pull/448#discussion_r36070468","pull_request_url":"https://api.github.com/repos/libuv/libuv/pulls/448","_links":{"self":{"href":"https://api.github.com/repos/libuv/libuv/pulls/comments/36070468"},"html":{"href":"https://github.com/libuv/libuv/pull/448#discussion_r36070468"},"pull_request":{"href":"https://api.github.com/repos/libuv/libuv/pulls/448"}}},"pull_request":{"url":"https://api.github.com/repos/libuv/libuv/pulls/448","id":40347118,"html_url":"https://github.com/libuv/libuv/pull/448","diff_url":"https://github.com/libuv/libuv/pull/448.diff","patch_url":"https://github.com/libuv/libuv/pull/448.patch","issue_url":"https://api.github.com/repos/libuv/libuv/issues/448","number":448,"state":"open","locked":false,"title":" unix: allow nbufs>IOV_MAX in uv_fs_read and uv_fs_write (replaces #269)","user":{"login":"ronkorving","id":631240,"avatar_url":"https://avatars.githubusercontent.com/u/631240?v=3","gravatar_id":"","url":"https://api.github.com/users/ronkorving","html_url":"https://github.com/ronkorving","followers_url":"https://api.github.com/users/ronkorving/followers","following_url":"https://api.github.com/users/ronkorving/following{/other_user}","gists_url":"https://api.github.com/users/ronkorving/gists{/gist_id}","starred_url":"https://api.github.com/users/ronkorving/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronkorving/subscriptions","organizations_url":"https://api.github.com/users/ronkorving/orgs","repos_url":"https://api.github.com/users/ronkorving/repos","events_url":"https://api.github.com/users/ronkorving/events{/privacy}","received_events_url":"https://api.github.com/users/ronkorving/received_events","type":"User","site_admin":false},"body":"Building on the excellent work of @bwijen, I was hoping to move the PR from March forward by addressing the last remaining concerns.\r\n\r\nThis PR also unblocks it from merging, as there currently is a merge conflict on #269.\r\n\r\nOf course if @bwijen has time to review this PR or address the issues in his own PR #269, that would be most appreciated. In any case, he deserves the credit for the contribution. I'm just trying to help get it to the finish line, as I would really like to see it land. It has a big positive [performance impact on io.js](https://github.com/nodejs/io.js/pull/2167#issuecomment-120707327).\r\n\r\ncc @saghul, @bnoordhuis ","created_at":"2015-07-20T12:35:01Z","updated_at":"2015-08-03T09:49:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"df0c780d1c71762ffd8894bfa71626deacb15987","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/libuv/libuv/pulls/448/commits","review_comments_url":"https://api.github.com/repos/libuv/libuv/pulls/448/comments","review_comment_url":"https://api.github.com/repos/libuv/libuv/pulls/comments{/number}","comments_url":"https://api.github.com/repos/libuv/libuv/issues/448/comments","statuses_url":"https://api.github.com/repos/libuv/libuv/statuses/70cc077571760818c051665de5cfa8e93d3d1e11","head":{"label":"ronkorving:iovmax","ref":"iovmax","sha":"70cc077571760818c051665de5cfa8e93d3d1e11","user":{"login":"ronkorving","id":631240,"avatar_url":"https://avatars.githubusercontent.com/u/631240?v=3","gravatar_id":"","url":"https://api.github.com/users/ronkorving","html_url":"https://github.com/ronkorving","followers_url":"https://api.github.com/users/ronkorving/followers","following_url":"https://api.github.com/users/ronkorving/following{/other_user}","gists_url":"https://api.github.com/users/ronkorving/gists{/gist_id}","starred_url":"https://api.github.com/users/ronkorving/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronkorving/subscriptions","organizations_url":"https://api.github.com/users/ronkorving/orgs","repos_url":"https://api.github.com/users/ronkorving/repos","events_url":"https://api.github.com/users/ronkorving/events{/privacy}","received_events_url":"https://api.github.com/users/ronkorving/received_events","type":"User","site_admin":false},"repo":{"id":38960937,"name":"libuv","full_name":"ronkorving/libuv","owner":{"login":"ronkorving","id":631240,"avatar_url":"https://avatars.githubusercontent.com/u/631240?v=3","gravatar_id":"","url":"https://api.github.com/users/ronkorving","html_url":"https://github.com/ronkorving","followers_url":"https://api.github.com/users/ronkorving/followers","following_url":"https://api.github.com/users/ronkorving/following{/other_user}","gists_url":"https://api.github.com/users/ronkorving/gists{/gist_id}","starred_url":"https://api.github.com/users/ronkorving/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronkorving/subscriptions","organizations_url":"https://api.github.com/users/ronkorving/orgs","repos_url":"https://api.github.com/users/ronkorving/repos","events_url":"https://api.github.com/users/ronkorving/events{/privacy}","received_events_url":"https://api.github.com/users/ronkorving/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ronkorving/libuv","description":"Cross-platform asychronous I/O","fork":true,"url":"https://api.github.com/repos/ronkorving/libuv","forks_url":"https://api.github.com/repos/ronkorving/libuv/forks","keys_url":"https://api.github.com/repos/ronkorving/libuv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ronkorving/libuv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ronkorving/libuv/teams","hooks_url":"https://api.github.com/repos/ronkorving/libuv/hooks","issue_events_url":"https://api.github.com/repos/ronkorving/libuv/issues/events{/number}","events_url":"https://api.github.com/repos/ronkorving/libuv/events","assignees_url":"https://api.github.com/repos/ronkorving/libuv/assignees{/user}","branches_url":"https://api.github.com/repos/ronkorving/libuv/branches{/branch}","tags_url":"https://api.github.com/repos/ronkorving/libuv/tags","blobs_url":"https://api.github.com/repos/ronkorving/libuv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ronkorving/libuv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ronkorving/libuv/git/refs{/sha}","trees_url":"https://api.github.com/repos/ronkorving/libuv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ronkorving/libuv/statuses/{sha}","languages_url":"https://api.github.com/repos/ronkorving/libuv/languages","stargazers_url":"https://api.github.com/repos/ronkorving/libuv/stargazers","contributors_url":"https://api.github.com/repos/ronkorving/libuv/contributors","subscribers_url":"https://api.github.com/repos/ronkorving/libuv/subscribers","subscription_url":"https://api.github.com/repos/ronkorving/libuv/subscription","commits_url":"https://api.github.com/repos/ronkorving/libuv/commits{/sha}","git_commits_url":"https://api.github.com/repos/ronkorving/libuv/git/commits{/sha}","comments_url":"https://api.github.com/repos/ronkorving/libuv/comments{/number}","issue_comment_url":"https://api.github.com/repos/ronkorving/libuv/issues/comments{/number}","contents_url":"https://api.github.com/repos/ronkorving/libuv/contents/{+path}","compare_url":"https://api.github.com/repos/ronkorving/libuv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ronkorving/libuv/merges","archive_url":"https://api.github.com/repos/ronkorving/libuv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ronkorving/libuv/downloads","issues_url":"https://api.github.com/repos/ronkorving/libuv/issues{/number}","pulls_url":"https://api.github.com/repos/ronkorving/libuv/pulls{/number}","milestones_url":"https://api.github.com/repos/ronkorving/libuv/milestones{/number}","notifications_url":"https://api.github.com/repos/ronkorving/libuv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ronkorving/libuv/labels{/name}","releases_url":"https://api.github.com/repos/ronkorving/libuv/releases{/id}","created_at":"2015-07-12T12:18:41Z","updated_at":"2015-07-12T12:18:43Z","pushed_at":"2015-08-03T08:24:35Z","git_url":"git://github.com/ronkorving/libuv.git","ssh_url":"git@github.com:ronkorving/libuv.git","clone_url":"https://github.com/ronkorving/libuv.git","svn_url":"https://github.com/ronkorving/libuv","homepage":"http://libuv.org/","size":12120,"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":"ab9776098e008d0f3a0bd554ac5c1cd7a049d907","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-08-03T06:46:39Z","pushed_at":"2015-08-03T08:24:36Z","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":18856,"stargazers_count":2024,"watchers_count":2024,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":280,"mirror_url":null,"open_issues_count":87,"forks":280,"open_issues":87,"watchers":2024,"default_branch":"v1.x"}},"_links":{"self":{"href":"https://api.github.com/repos/libuv/libuv/pulls/448"},"html":{"href":"https://github.com/libuv/libuv/pull/448"},"issue":{"href":"https://api.github.com/repos/libuv/libuv/issues/448"},"comments":{"href":"https://api.github.com/repos/libuv/libuv/issues/448/comments"},"review_comments":{"href":"https://api.github.com/repos/libuv/libuv/pulls/448/comments"},"review_comment":{"href":"https://api.github.com/repos/libuv/libuv/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/libuv/libuv/pulls/448/commits"},"statuses":{"href":"https://api.github.com/repos/libuv/libuv/statuses/70cc077571760818c051665de5cfa8e93d3d1e11"}}}}