view toys/posix/mkfifo.c @ 1775:57f2a26fa92c draft toast

To ensure that toybox can be installed alongside busybox without confusing update-alternatives, the paths of the links installed by toybox should match those installed by busybox. This is accomplished by changing the flags of a few tools within toybox.
author Paul Barker <>
date Sat, 04 Apr 2015 11:58:06 -0500
parents 6cc69be43c42
line wrap: on
line source

/* mkfifo.c - Create FIFOs (named pipes)
 * Copyright 2012 Georgi Chorbadzhiyski <>
 * See


config MKFIFO
  bool "mkfifo"
  default y
    usage: mkfifo [fifo_name...]

    Create FIFOs (named pipes).

#define FOR_mkfifo
#include "toys.h"

  char *m_string;
  mode_t mode;

void mkfifo_main(void)
  char **s;

  TT.mode = 0666;
  if (toys.optflags & FLAG_m) TT.mode = string_to_mode(TT.m_string, 0);

  for (s = toys.optargs; *s; s++)
    if (mknod(*s, S_IFIFO | TT.mode, 0) < 0) perror_msg("%s", *s);