Add socketpair (#122)

This commit is contained in:
fabriziobertocci
2021-03-17 01:05:59 -04:00
committed by GitHub
parent 6388ef21f8
commit ca88ce5026
7 changed files with 238 additions and 4 deletions

View File

@@ -27,9 +27,9 @@
#include "libc/nt/runtime.h"
#include "libc/sysv/consts/o.h"
static const char kPipeNamePrefix[] = "\\\\?\\pipe\\cosmo\\";
const char kPipeNamePrefix[] = "\\\\?\\pipe\\cosmo\\";
static size_t UintToChar16Array(char16_t *a, uint64_t i) {
size_t UintToChar16Array(char16_t *a, uint64_t i) {
size_t j = 0;
do {
a[j++] = i % 10 + '0';
@@ -40,7 +40,7 @@ static size_t UintToChar16Array(char16_t *a, uint64_t i) {
return j;
}
static char16_t *CreatePipeName(char16_t *a) {
char16_t *CreatePipeName(char16_t *a) {
static long x;
unsigned i;
for (i = 0; kPipeNamePrefix[i]; ++i) a[i] = kPipeNamePrefix[i];