{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/comments/25631830","id":25631830,"diff_hunk":"@@ -4,21 +4,42 @@\n using Microsoft.Win32.SafeHandles;\n using System.Diagnostics;\n using System.Diagnostics.CodeAnalysis;\n-using System.Diagnostics.Contracts;\n using System.Runtime.InteropServices;\n using System.Security;\n-using System.Threading;\n-using System.Threading.Tasks;\n \n namespace System.IO.Pipes\n {\n     public abstract partial class PipeStream : Stream\n     {\n+        private const string PipeDirectoryPath = \"/tmp/\";\n+\n+        internal static string GetPipePath(string serverName, string pipeName)","path":"src/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Unix.cs","position":16,"original_position":16,"commit_id":"b6dd4e4881c5f2a11037ca76ff83a909143fdbbf","original_commit_id":"b6dd4e4881c5f2a11037ca76ff83a909143fdbbf","user":{"login":"pgavlin","id":1224093,"avatar_url":"https://avatars.githubusercontent.com/u/1224093?v=3","gravatar_id":"","url":"https://api.github.com/users/pgavlin","html_url":"https://github.com/pgavlin","followers_url":"https://api.github.com/users/pgavlin/followers","following_url":"https://api.github.com/users/pgavlin/following{/other_user}","gists_url":"https://api.github.com/users/pgavlin/gists{/gist_id}","starred_url":"https://api.github.com/users/pgavlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgavlin/subscriptions","organizations_url":"https://api.github.com/users/pgavlin/orgs","repos_url":"https://api.github.com/users/pgavlin/repos","events_url":"https://api.github.com/users/pgavlin/events{/privacy}","received_events_url":"https://api.github.com/users/pgavlin/received_events","type":"User","site_admin":false},"body":"Great. It's exactly those cases that I was thinking of. :)","created_at":"2015-03-02T19:54:24Z","updated_at":"2015-03-02T19:54:24Z","html_url":"https://github.com/dotnet/corefx/pull/1056#discussion_r25631830","pull_request_url":"https://api.github.com/repos/dotnet/corefx/pulls/1056","_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments/25631830"},"html":{"href":"https://github.com/dotnet/corefx/pull/1056#discussion_r25631830"},"pull_request":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/1056"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/1056","id":30235117,"html_url":"https://github.com/dotnet/corefx/pull/1056","diff_url":"https://github.com/dotnet/corefx/pull/1056.diff","patch_url":"https://github.com/dotnet/corefx/pull/1056.patch","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/1056","number":1056,"state":"open","locked":false,"title":"Implement System.IO.Pipes for Unix","user":{"login":"stephentoub","id":2642209,"avatar_url":"https://avatars.githubusercontent.com/u/2642209?v=3","gravatar_id":"","url":"https://api.github.com/users/stephentoub","html_url":"https://github.com/stephentoub","followers_url":"https://api.github.com/users/stephentoub/followers","following_url":"https://api.github.com/users/stephentoub/following{/other_user}","gists_url":"https://api.github.com/users/stephentoub/gists{/gist_id}","starred_url":"https://api.github.com/users/stephentoub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephentoub/subscriptions","organizations_url":"https://api.github.com/users/stephentoub/orgs","repos_url":"https://api.github.com/users/stephentoub/repos","events_url":"https://api.github.com/users/stephentoub/events{/privacy}","received_events_url":"https://api.github.com/users/stephentoub/received_events","type":"User","site_admin":false},"body":"This PR provides an initial implementation of the System.IO.Pipes library on Unix.\r\n\r\nA few notes:\r\n- Ignore almost all of the changes in the *.Windows.cs files... I just moved some code around to put code above or below a \"PAL Layer\" comment, as we've done in other places in CoreFX.  The only interesting change in the Windows code was that in the named pipe client, I refactored out the retry/cancellation/timing loop so that it could be used by the Unix code as well, and in doing so I added some slightly smarter spinning support.  There were also one or two places where some validation logic in shared code was overly aggressive in what it was checking for when it came to Unix, so I refactored those checks into a core piece and a Windows-specific additional check.\r\n- The .NET APIs map fairly closely to the Windows APIs, and thus there will be some rough edges here on the Unix side, e.g. calling WaitForConnection with named pipes and an InOut direction won't block as it does on Windows.\r\n- I use a bit of \"light up\" to make some things work on Linux that probably won't as-is on Mac, e.g. in anonymous pipes, I mapped non-inheritability to using O_CLOEXEC, but pipe2 which accepts a flags argument that allows O_CLOEXEC to be specified is Linux-specific (as is dup3 that would allow for reopening a handle with O_CLOEXEC).  This doesn't seem particularly problematic, though, since the primary use case for anonymous pipes is having them be inherited... just another of the rough edges.\r\n- As part of this, I also realized that in the various places in CoreFX we were making libc write calls we might have been losing data, as write doesn't guarantee it'll write out all of the supplied data. I fixed those call sites.","created_at":"2015-03-01T01:57:06Z","updated_at":"2015-03-02T19:54:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a59563c3f7f8c4767f081f42abf6fe18657b5c72","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/corefx/pulls/1056/commits","review_comments_url":"https://api.github.com/repos/dotnet/corefx/pulls/1056/comments","review_comment_url":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/1056/comments","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/b6dd4e4881c5f2a11037ca76ff83a909143fdbbf","head":{"label":"stephentoub:pipes_unix","ref":"pipes_unix","sha":"b6dd4e4881c5f2a11037ca76ff83a909143fdbbf","user":{"login":"stephentoub","id":2642209,"avatar_url":"https://avatars.githubusercontent.com/u/2642209?v=3","gravatar_id":"","url":"https://api.github.com/users/stephentoub","html_url":"https://github.com/stephentoub","followers_url":"https://api.github.com/users/stephentoub/followers","following_url":"https://api.github.com/users/stephentoub/following{/other_user}","gists_url":"https://api.github.com/users/stephentoub/gists{/gist_id}","starred_url":"https://api.github.com/users/stephentoub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephentoub/subscriptions","organizations_url":"https://api.github.com/users/stephentoub/orgs","repos_url":"https://api.github.com/users/stephentoub/repos","events_url":"https://api.github.com/users/stephentoub/events{/privacy}","received_events_url":"https://api.github.com/users/stephentoub/received_events","type":"User","site_admin":false},"repo":{"id":26551529,"name":"corefx","full_name":"stephentoub/corefx","owner":{"login":"stephentoub","id":2642209,"avatar_url":"https://avatars.githubusercontent.com/u/2642209?v=3","gravatar_id":"","url":"https://api.github.com/users/stephentoub","html_url":"https://github.com/stephentoub","followers_url":"https://api.github.com/users/stephentoub/followers","following_url":"https://api.github.com/users/stephentoub/following{/other_user}","gists_url":"https://api.github.com/users/stephentoub/gists{/gist_id}","starred_url":"https://api.github.com/users/stephentoub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephentoub/subscriptions","organizations_url":"https://api.github.com/users/stephentoub/orgs","repos_url":"https://api.github.com/users/stephentoub/repos","events_url":"https://api.github.com/users/stephentoub/events{/privacy}","received_events_url":"https://api.github.com/users/stephentoub/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stephentoub/corefx","description":"This repository contains the foundational libraries that make up the .NET Core development stack.","fork":true,"url":"https://api.github.com/repos/stephentoub/corefx","forks_url":"https://api.github.com/repos/stephentoub/corefx/forks","keys_url":"https://api.github.com/repos/stephentoub/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stephentoub/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stephentoub/corefx/teams","hooks_url":"https://api.github.com/repos/stephentoub/corefx/hooks","issue_events_url":"https://api.github.com/repos/stephentoub/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/stephentoub/corefx/events","assignees_url":"https://api.github.com/repos/stephentoub/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/stephentoub/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/stephentoub/corefx/tags","blobs_url":"https://api.github.com/repos/stephentoub/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stephentoub/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stephentoub/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/stephentoub/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stephentoub/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/stephentoub/corefx/languages","stargazers_url":"https://api.github.com/repos/stephentoub/corefx/stargazers","contributors_url":"https://api.github.com/repos/stephentoub/corefx/contributors","subscribers_url":"https://api.github.com/repos/stephentoub/corefx/subscribers","subscription_url":"https://api.github.com/repos/stephentoub/corefx/subscription","commits_url":"https://api.github.com/repos/stephentoub/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/stephentoub/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/stephentoub/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/stephentoub/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/stephentoub/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/stephentoub/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stephentoub/corefx/merges","archive_url":"https://api.github.com/repos/stephentoub/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stephentoub/corefx/downloads","issues_url":"https://api.github.com/repos/stephentoub/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/stephentoub/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/stephentoub/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/stephentoub/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stephentoub/corefx/labels{/name}","releases_url":"https://api.github.com/repos/stephentoub/corefx/releases{/id}","created_at":"2014-11-12T19:06:24Z","updated_at":"2015-03-02T15:42:19Z","pushed_at":"2015-03-02T18:30:46Z","git_url":"git://github.com/stephentoub/corefx.git","ssh_url":"git@github.com:stephentoub/corefx.git","clone_url":"https://github.com/stephentoub/corefx.git","svn_url":"https://github.com/stephentoub/corefx","homepage":"","size":12878,"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":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"bc1edf845c1ef972a94d580874d44fa36b7acdaf","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":26295345,"name":"corefx","full_name":"dotnet/corefx","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/corefx","description":"This repo contains the foundational libraries that make up the .NET Core development stack.","fork":false,"url":"https://api.github.com/repos/dotnet/corefx","forks_url":"https://api.github.com/repos/dotnet/corefx/forks","keys_url":"https://api.github.com/repos/dotnet/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/corefx/teams","hooks_url":"https://api.github.com/repos/dotnet/corefx/hooks","issue_events_url":"https://api.github.com/repos/dotnet/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/corefx/events","assignees_url":"https://api.github.com/repos/dotnet/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/corefx/tags","blobs_url":"https://api.github.com/repos/dotnet/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/corefx/languages","stargazers_url":"https://api.github.com/repos/dotnet/corefx/stargazers","contributors_url":"https://api.github.com/repos/dotnet/corefx/contributors","subscribers_url":"https://api.github.com/repos/dotnet/corefx/subscribers","subscription_url":"https://api.github.com/repos/dotnet/corefx/subscription","commits_url":"https://api.github.com/repos/dotnet/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/corefx/merges","archive_url":"https://api.github.com/repos/dotnet/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/corefx/downloads","issues_url":"https://api.github.com/repos/dotnet/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/corefx/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/corefx/releases{/id}","created_at":"2014-11-06T23:42:48Z","updated_at":"2015-03-02T13:59:13Z","pushed_at":"2015-03-02T19:41:32Z","git_url":"git://github.com/dotnet/corefx.git","ssh_url":"git@github.com:dotnet/corefx.git","clone_url":"https://github.com/dotnet/corefx.git","svn_url":"https://github.com/dotnet/corefx","homepage":"","size":24965,"stargazers_count":7105,"watchers_count":7105,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1323,"mirror_url":null,"open_issues_count":289,"forks":1323,"open_issues":289,"watchers":7105,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/1056"},"html":{"href":"https://github.com/dotnet/corefx/pull/1056"},"issue":{"href":"https://api.github.com/repos/dotnet/corefx/issues/1056"},"comments":{"href":"https://api.github.com/repos/dotnet/corefx/issues/1056/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/1056/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/1056/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/corefx/statuses/b6dd4e4881c5f2a11037ca76ff83a909143fdbbf"}}}}