Remove misleading "pipe" utility and test

If a "cat" tool as simple as the removed one is needed, it should be
implemented with Goa, only depend on libc/posix (*not* base), and be
named "simple_cat". Up to today, the misleading naming of the removed
tool, tricked me into believing "test-pipe" tests POSIX pipes, which it
did not!
This commit is contained in:
Christian Helmuth 2020-05-08 16:04:19 +02:00 committed by Norman Feske
parent 4738d77c88
commit 589b416ca8
11 changed files with 0 additions and 134 deletions

View File

@ -1 +0,0 @@
Test for the pipe utility.

View File

@ -1,5 +0,0 @@
_/src/init
_/src/pipe
_/src/libc
_/src/posix
_/src/vfs

View File

@ -1 +0,0 @@
2020-04-23 8aee92222c462a0b9e4099a22e77adb0e6f82eb0

View File

@ -1,43 +0,0 @@
<runtime ram="32M" caps="1000" binary="init">
<events>
<timeout meaning="failed" sec="10" />
<log meaning="succeeded">child "pipe" exited with exit value 0</log>
<log meaning="failed">Error: </log>
</events>
<content>
<rom label="ld.lib.so"/>
<rom label="vfs.lib.so"/>
<rom label="libc.lib.so"/>
<rom label="libm.lib.so"/>
<rom label="posix.lib.so"/>
<rom label="pipe"/>
</content>
<config>
<parent-provides>
<service name="CPU"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="IRQ"/>
<service name="LOG"/>
<service name="PD"/>
<service name="RM"/>
<service name="ROM"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<start name="pipe" caps="128">
<resource name="RAM" quantum="2M"/>
<config>
<vfs>
<rom name="config"/>
<dir name="dev"> <log/> </dir>
</vfs>
<libc stdin="/config" stdout="/dev/log"/>
</config>
</start>
</config>
</runtime>

View File

@ -1,2 +0,0 @@
SRC_DIR = src/app/pipe
include $(GENODE_DIR)/repos/base/recipes/src/content.inc

View File

@ -1 +0,0 @@
2020-04-23 aeef8c953c13f9cfb4d01b6e7d74c18d50e824a0

View File

@ -1,3 +0,0 @@
base
libc
posix

View File

@ -694,7 +694,6 @@ set default_test_pkgs {
test-nic_loopback
test-part_block_gpt
test-part_block_mbr
test-pipe
test-pthread
test-ram_fs_chunk
test-read_only_rom

View File

@ -1,15 +0,0 @@
The pipe utility is for piping between files using the
semantics of POSIX stdio.
An example of piping clock jitter to a terminal session:
! <start name="pipe">
! <resource name="RAM" quantum="2M"/>
! <config>
! <vfs>
! <jitterentropy name="rng"/>
! <terminal name="tty"/>
! </vfs>
! <libc stdin="/rng" stdout="/tty"/>
! </config>
! </start>

View File

@ -1,59 +0,0 @@
/*
* \brief Standalone POSIX pipe
* \author Emery Hemingway
* \date 2018-03-06
*/
/*
* Copyright (C) 2018 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
/* Genode includes */
#include <base/log.h>
/* Libc includes */
#include <stdio.h>
#include <string.h>
#include <errno.h>
int main()
{
enum { SIXTEEN_K = 1 << 14 };
static char buf[SIXTEEN_K];
Genode::uint64_t total = 0;
while (true) {
auto const nr = fread(buf, 1, sizeof(buf), stdin);
if (nr == 0 && feof(stdin))
break;
if (nr < 1 || nr > sizeof(buf)) {
int res = errno;
Genode::error((char const *)strerror(res));
return res;
}
auto remain = nr;
auto off = 0;
while (remain > 0) {
auto const nw = fwrite(buf+off, 1, remain, stdout);
if (nw < 1 || nw > remain) {
int res = errno;
Genode::error((char const *)strerror(res));
return res;
}
remain -= nw;
off += nw;
total += nw;
}
}
Genode::log("piped ", total, " bytes");
return 0;
};

View File

@ -1,3 +0,0 @@
TARGET = pipe
SRC_CC = main.cc
LIBS = base libc posix