Skip to content

Instantly share code, notes, and snippets.

@momchil-velikov
Created April 28, 2016 14:21
Show Gist options
  • Save momchil-velikov/91871548a03c2442e94d6d49c83fcfbd to your computer and use it in GitHub Desktop.
Save momchil-velikov/91871548a03c2442e94d6d49c83fcfbd to your computer and use it in GitHub Desktop.
#define _GNU_SOURCE
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
int main() {
mkfifo("test-fifo", 0660);
printf("fifo PIPE_BUF: %ld\n", pathconf("test-fifo", _PC_PIPE_BUF));
unlink("test-fifo");
int fd[2];
pipe(fd);
printf("pipe PIPE_BUF: %d\n", fcntl(fd[0], F_GETPIPE_SZ));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment