Created
July 2, 2013 12:55
-
-
Save flgr/5909055 to your computer and use it in GitHub Desktop.
Program which creates a half-open socketpair, then sits around endlessly, doing nothing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/socket.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
int main(int argc, char** argv) { | |
int sp[2]; | |
if (socketpair(PF_UNIX, SOCK_STREAM, 0, sp) < 0) { | |
perror("Failed to get socketpair"); | |
} | |
close(sp[1]); | |
for (;;) { sleep(1000); } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment