Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socketpair #1060

Merged
merged 2 commits into from
Apr 19, 2013
Merged

Socketpair #1060

merged 2 commits into from
Apr 19, 2013

Conversation

arlolra
Copy link
Contributor

@arlolra arlolra commented Apr 13, 2013

No description provided.

@kripken
Copy link
Member

kripken commented Apr 16, 2013

I'm not sure how this command should work - what does the native version do, and how is pipe() equivalent to it?

@arlolra
Copy link
Contributor Author

arlolra commented Apr 16, 2013

Socketpair creates a pair of connected sockets.
http://pubs.opengroup.org/onlinepubs/009695399/functions/socketpair.html

The socketpair() function shall create an unbound pair of connected sockets in a specified domain, of a specified type, under the protocol optionally specified by the protocol argument. The two sockets shall be identical. The file descriptors used in referencing the created sockets shall be returned in socket_vector[0] and socket_vector[1].

The implementation above is from Plan9 though,
http://sources.iwp9.org/files/plan9/sys/src/ape/lib/bsd/socketpair.c
which I suppose has bidirectional pipes.

Considering the comment in pipes,

// It is possible to implement this using two device streams, but pipes make
// little sense in a single-threaded environment, so we do not support them.

maybe this is all mute, and it should always return op not supported?

@kripken
Copy link
Member

kripken commented Apr 18, 2013

Yeah, I think we should say we do not support this.

@arlolra
Copy link
Contributor Author

arlolra commented Apr 18, 2013

Ok, updated.

kripken added a commit that referenced this pull request Apr 19, 2013
@kripken kripken merged commit b22b591 into emscripten-core:incoming Apr 19, 2013
@arlolra arlolra deleted the socketpair branch April 19, 2013 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants