Skip to content

Commit

Permalink
Remove support for FIFOs and pipes.
Browse files Browse the repository at this point in the history
Now that our sockets API is very simple, there is no added value in
having a separate pipe type. Let's just adjust pipe() to return a socket
pair and alias S_ISPIPE() and S_ISSOCK().
  • Loading branch information
EdSchouten committed Sep 4, 2017
1 parent 3a518f8 commit 3f83901
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 62 deletions.
19 changes: 3 additions & 16 deletions cloudabi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,7 @@ flags uint16 eventrwflags
| [eventtype.fd_read] or [eventtype.fd_write].
@cprefix EVENT_FD_READWRITE_
0x01 hangup
| The peer of this FIFO or socket has closed or
| disconnected.
| The peer of this socket has closed or disconnected.

enum uint8 eventtype
| Type of a subscription to an event or its occurrence.
Expand Down Expand Up @@ -483,9 +482,6 @@ enum uint8 filetype
0x20 directory
| The file descriptor or file refers to a directory
| inode.
0x30 fifo
| The file descriptor or file refers to a FIFO inode or
| one of the two endpoints of a pipe.
0x40 poll
| The file descriptor refers to a polling event queue.
0x50 process
Expand Down Expand Up @@ -664,9 +660,6 @@ flags uint64 rights
0x0000000000000400 file_create_file
| If [rights.file_open] is set, the right to invoke
| [file_open] with [oflags.creat].
0x0000000000000800 file_create_fifo
| The right to invoke [file_create] with
| [filetype.fifo].
0x0000000000001000 file_link_source
| The right to invoke [file_link] with the file
| descriptor as the source directory.
Expand Down Expand Up @@ -1351,20 +1344,16 @@ syscall fd_create2
| Creates a pair of file descriptors.
in
filetype type
fifo
| Creates a pipe.
socket_dgram
| Creates a UNIX datagram socket pair.
socket_stream
| Creates a UNIX byte-stream socket
| pair.
out
fd fd1
| The first file descriptor of the pair. For
| pipes, this corresponds to the read end.
| The first file descriptor of the pair.
fd fd2
| The second file descriptor of the pair. For
| pipes, this corresponds to the write end.
| The second file descriptor of the pair.

syscall fd_datasync
| Synchronizes the data of a file to disk.
Expand Down Expand Up @@ -1547,8 +1536,6 @@ syscall file_create
filetype type
directory
| Creates a directory.
fifo
| Creates a FIFO.

syscall file_link
| Creates a hard link.
Expand Down
23 changes: 3 additions & 20 deletions docs/cloudabi.html
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,6 @@ <h4><a href="#fd_create2" name="fd_create2"></a><code>cloudabi_sys_fd_create2()<
<p>Possible values:</p>

<ul>
<li><p><a href="#filetype.fifo"><code>CLOUDABI_FILETYPE_FIFO</code></a></p>

<p>Creates a pipe.</p></li>
<li><p><a href="#filetype.socket_dgram"><code>CLOUDABI_FILETYPE_SOCKET_DGRAM</code></a></p>

<p>Creates a UNIX datagram socket pair.</p></li>
Expand All @@ -420,12 +417,10 @@ <h4><a href="#fd_create2" name="fd_create2"></a><code>cloudabi_sys_fd_create2()<
<ul>
<li><p><a href="#fd_create2.fd1" name="fd_create2.fd1"></a><code><a href="#fd">cloudabi_fd_t</a> <strong>fd1</strong></code></p>

<p>The first file descriptor of the pair. For
pipes, this corresponds to the read end.</p></li>
<p>The first file descriptor of the pair.</p></li>
<li><p><a href="#fd_create2.fd2" name="fd_create2.fd2"></a><code><a href="#fd">cloudabi_fd_t</a> <strong>fd2</strong></code></p>

<p>The second file descriptor of the pair. For
pipes, this corresponds to the write end.</p></li>
<p>The second file descriptor of the pair.</p></li>
</ul>

<h4><a href="#fd_datasync" name="fd_datasync"></a><code>cloudabi_sys_fd_datasync()</code></h4>
Expand Down Expand Up @@ -745,9 +740,6 @@ <h4><a href="#file_create" name="file_create"></a><code>cloudabi_sys_file_create
<li><p><a href="#filetype.directory"><code>CLOUDABI_FILETYPE_DIRECTORY</code></a></p>

<p>Creates a directory.</p></li>
<li><p><a href="#filetype.fifo"><code>CLOUDABI_FILETYPE_FIFO</code></a></p>

<p>Creates a FIFO.</p></li>
</ul></li>
</ul>

Expand Down Expand Up @@ -2072,8 +2064,7 @@ <h4><a href="#eventrwflags" name="eventrwflags"></a><code>cloudabi_eventrwflags_
<ul>
<li><p><a href="#eventrwflags.hangup" name="eventrwflags.hangup"></a><strong><code>CLOUDABI_EVENT_FD_READWRITE_HANGUP</code></strong></p>

<p>The peer of this FIFO or socket has closed or
disconnected.</p></li>
<p>The peer of this socket has closed or disconnected.</p></li>
</ul>

<h4><a href="#eventtype" name="eventtype"></a><code>cloudabi_eventtype_t</code> (<code>uint8_t</code>)</h4>
Expand Down Expand Up @@ -2294,10 +2285,6 @@ <h4><a href="#filetype" name="filetype"></a><code>cloudabi_filetype_t</code> (<c

<p>The file descriptor or file refers to a directory
inode.</p></li>
<li><p><a href="#filetype.fifo" name="filetype.fifo"></a><strong><code>CLOUDABI_FILETYPE_FIFO</code></strong></p>

<p>The file descriptor or file refers to a FIFO inode or
one of the two endpoints of a pipe.</p></li>
<li><p><a href="#filetype.poll" name="filetype.poll"></a><strong><code>CLOUDABI_FILETYPE_POLL</code></strong></p>

<p>The file descriptor refers to a polling event queue.</p></li>
Expand Down Expand Up @@ -2698,10 +2685,6 @@ <h4><a href="#rights" name="rights"></a><code>cloudabi_rights_t</code> (<code>ui

<p>If <a href="#rights.file_open"><code>CLOUDABI_RIGHT_FILE_OPEN</code></a> is set, the right to invoke
<a href="#file_open"><code>cloudabi_sys_file_open()</code></a> with <a href="#oflags.creat"><code>CLOUDABI_O_CREAT</code></a>.</p></li>
<li><p><a href="#rights.file_create_fifo" name="rights.file_create_fifo"></a><strong><code>CLOUDABI_RIGHT_FILE_CREATE_FIFO</code></strong></p>

<p>The right to invoke <a href="#file_create"><code>cloudabi_sys_file_create()</code></a> with
<a href="#filetype.fifo"><code>CLOUDABI_FILETYPE_FIFO</code></a>.</p></li>
<li><p><a href="#rights.file_link_source" name="rights.file_link_source"></a><strong><code>CLOUDABI_RIGHT_FILE_LINK_SOURCE</code></strong></p>

<p>The right to invoke <a href="#file_link"><code>cloudabi_sys_file_link()</code></a> with the file
Expand Down
27 changes: 3 additions & 24 deletions docs/cloudabi.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,6 @@ Inputs:

Possible values:

- [`CLOUDABI_FILETYPE_FIFO`](#filetype.fifo)

Creates a pipe.

- [`CLOUDABI_FILETYPE_SOCKET_DGRAM`](#filetype.socket_dgram)

Creates a UNIX datagram socket pair.
Expand All @@ -290,13 +286,11 @@ Outputs:

- <a href="#fd_create2.fd1" name="fd_create2.fd1"></a><code>[cloudabi\_fd\_t](#fd) <strong>fd1</strong></code>

The first file descriptor of the pair. For
pipes, this corresponds to the read end.
The first file descriptor of the pair.

- <a href="#fd_create2.fd2" name="fd_create2.fd2"></a><code>[cloudabi\_fd\_t](#fd) <strong>fd2</strong></code>

The second file descriptor of the pair. For
pipes, this corresponds to the write end.
The second file descriptor of the pair.

#### <a href="#fd_datasync" name="fd_datasync"></a>`cloudabi_sys_fd_datasync()`

Expand Down Expand Up @@ -595,10 +589,6 @@ Inputs:

Creates a directory.

- [`CLOUDABI_FILETYPE_FIFO`](#filetype.fifo)

Creates a FIFO.

#### <a href="#file_link" name="file_link"></a>`cloudabi_sys_file_link()`

Creates a hard link.
Expand Down Expand Up @@ -1959,8 +1949,7 @@ Possible values:

- <a href="#eventrwflags.hangup" name="eventrwflags.hangup"></a>**`CLOUDABI_EVENT_FD_READWRITE_HANGUP`**

The peer of this FIFO or socket has closed or
disconnected.
The peer of this socket has closed or disconnected.

#### <a href="#eventtype" name="eventtype"></a>`cloudabi_eventtype_t` (`uint8_t`)

Expand Down Expand Up @@ -2193,11 +2182,6 @@ Possible values:
The file descriptor or file refers to a directory
inode.

- <a href="#filetype.fifo" name="filetype.fifo"></a>**`CLOUDABI_FILETYPE_FIFO`**

The file descriptor or file refers to a FIFO inode or
one of the two endpoints of a pipe.

- <a href="#filetype.poll" name="filetype.poll"></a>**`CLOUDABI_FILETYPE_POLL`**

The file descriptor refers to a polling event queue.
Expand Down Expand Up @@ -2611,11 +2595,6 @@ Possible values:
If [`CLOUDABI_RIGHT_FILE_OPEN`](#rights.file_open) is set, the right to invoke
[`cloudabi_sys_file_open()`](#file_open) with [`CLOUDABI_O_CREAT`](#oflags.creat).

- <a href="#rights.file_create_fifo" name="rights.file_create_fifo"></a>**`CLOUDABI_RIGHT_FILE_CREATE_FIFO`**

The right to invoke [`cloudabi_sys_file_create()`](#file_create) with
[`CLOUDABI_FILETYPE_FIFO`](#filetype.fifo).

- <a href="#rights.file_link_source" name="rights.file_link_source"></a>**`CLOUDABI_RIGHT_FILE_LINK_SOURCE`**

The right to invoke [`cloudabi_sys_file_link()`](#file_link) with the file
Expand Down
2 changes: 0 additions & 2 deletions headers/cloudabi_types_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ typedef uint8_t cloudabi_filetype_t;
#define CLOUDABI_FILETYPE_BLOCK_DEVICE 16
#define CLOUDABI_FILETYPE_CHARACTER_DEVICE 17
#define CLOUDABI_FILETYPE_DIRECTORY 32
#define CLOUDABI_FILETYPE_FIFO 48
#define CLOUDABI_FILETYPE_POLL 64
#define CLOUDABI_FILETYPE_PROCESS 80
#define CLOUDABI_FILETYPE_REGULAR_FILE 96
Expand Down Expand Up @@ -260,7 +259,6 @@ typedef uint64_t cloudabi_rights_t;
#define CLOUDABI_RIGHT_FILE_ALLOCATE 0x0000000000000100
#define CLOUDABI_RIGHT_FILE_CREATE_DIRECTORY 0x0000000000000200
#define CLOUDABI_RIGHT_FILE_CREATE_FILE 0x0000000000000400
#define CLOUDABI_RIGHT_FILE_CREATE_FIFO 0x0000000000000800
#define CLOUDABI_RIGHT_FILE_LINK_SOURCE 0x0000000000001000
#define CLOUDABI_RIGHT_FILE_LINK_TARGET 0x0000000000002000
#define CLOUDABI_RIGHT_FILE_OPEN 0x0000000000004000
Expand Down

0 comments on commit 3f83901

Please sign in to comment.