view toys/example/hello.c @ 1539:3e85af1f7e22 draft

First batch of sed tests. Only good for TEST_HOST=1 at the moment because the test infrastructure itself depends on sed, so if an unfinished sed is in the $PATH it goes boing. But hey, corner cases! I have... more.
author Rob Landley <>
date Wed, 29 Oct 2014 18:44:33 -0500
parents dd2fd057111f
line wrap: on
line source

/* hello.c - A hello world program. (Simple template for new commands.)
 * Copyright 2012 Rob Landley <>
 * See
 * See


config HELLO
  bool "hello"
  default n
    usage: hello [-s]

    A hello world program.  You don't need this.

    Mostly used as a simple template for adding new commands.
    Occasionally nice to smoketest kernel booting via "init=/usr/bin/hello".

#define FOR_hello
#include "toys.h"

  int unused;

void hello_main(void)
  xprintf("Hello world\n");

  // Avoid kernel panic if run as init.
  if (getpid() == 1) wait(&TT.unused);