Welcome to little lamb

Code » limb » release » tree

[release] / src / doc / djbunix.h / pipe_internal.3.md

% limb manual
% pipe_internal(3)
% limb 0.2.0
% 2024-01-09

# NAME

pipe_internal, pipecoe, pipenb, pipenbcpe - create a pipe

# SYNOPSIS

    #include <limb/djbunix.h>

```pre hl
int pipe_internal(int *<em>fds</em>, unsigned int <em>flags</em>)

int pipecoe(int *<em>fds</em>)
int pipenb(int *<em>fds</em>)
int pipenbcoe(int *<em>fds</em>)
```

# DESCRIPTION

The `pipe_internal`() creates a pipe and places two file descriptors in `fds[0]`
and `fds[1]`, the reading and writing ends, respectively, of the pipe.

The created pipe will have its *O_NONBLOCK* and *O_CLOEXEC* flags cleared,
unless specified (as a bitwise OR value) in `flags`.

The `pipecoe`() macro is similar to `pipe_internal`() with *O_CLOEXEC* set.

The `pipenb`() macro is similar to `pipe_internal`() with *O_NONBLOCK* set.

The `pipenbcoe`() macro is similar to `pipe_internal`() with both *O_CLOEXEC
| O_NONBLOCK* set.


# RETURN VALUE

These functions return 0 on success. Otherwise they return -1 and set `errno` to
indicate the error.

# ERRORS

These functions may fail and set `errno` for any of the errors specified for
[pipe2](3) when available, [pipe](3), [coe](3) and [ndelay_on](3) when not.