blob: 400388c34c99f4d60b49431bd2f8c3829b7ec87d [file] [log] [blame]
Matt Kraai258bd3d2001-10-24 19:00:20 +00001/* vi: set sw=4 ts=4: */
2/*
3 * Mini true implementation for busybox
4 *
Eric Andersenc7bda1c2004-03-15 08:29:22 +00005 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
Matt Kraai258bd3d2001-10-24 19:00:20 +00006 *
Denys Vlasenko0ef64bd2010-08-16 20:14:46 +02007 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
Matt Kraai258bd3d2001-10-24 19:00:20 +00008 */
Denys Vlasenkoaf3f4202016-11-23 14:46:56 +01009//config:config TRUE
Denys Vlasenko4eed2c62017-07-18 22:01:24 +020010//config: bool "true (tiny)"
Denys Vlasenkoaf3f4202016-11-23 14:46:56 +010011//config: default y
12//config: help
Denys Vlasenko72089cf2017-07-21 09:50:55 +020013//config: true returns an exit code of TRUE (0).
Denys Vlasenkoaf3f4202016-11-23 14:46:56 +010014
15//applet:IF_TRUE(APPLET_NOFORK(true, true, BB_DIR_BIN, BB_SUID_DROP, true))
16
17//kbuild:lib-$(CONFIG_TRUE) += true.o
Matt Kraai258bd3d2001-10-24 19:00:20 +000018
Manuel Novoa III cad53642003-03-19 09:13:01 +000019/* BB_AUDIT SUSv3 compliant */
20/* http://www.opengroup.org/onlinepubs/007904975/utilities/true.html */
Matt Kraai258bd3d2001-10-24 19:00:20 +000021
Denys Vlasenkode5edad2015-04-21 16:00:41 +020022/* "true --help" is special-cased to ignore --help */
23//usage:#define true_trivial_usage NOUSAGE_STR
24//usage:#define true_full_usage ""
Pere Orga34425382011-03-31 14:43:25 +020025//usage:#define true_example_usage
26//usage: "$ true\n"
27//usage: "$ echo $?\n"
28//usage: "0\n"
29
Denis Vlasenkob6adbf12007-05-26 19:00:18 +000030#include "libbb.h"
Matt Kraai258bd3d2001-10-24 19:00:20 +000031
Denis Vlasenko99912ca2007-04-10 15:43:37 +000032/* This is a NOFORK applet. Be very careful! */
33
Denis Vlasenko9b49a5e2007-10-11 10:05:36 +000034int true_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
Denis Vlasenkoa60f84e2008-07-05 09:18:54 +000035int true_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
Matt Kraai258bd3d2001-10-24 19:00:20 +000036{
37 return EXIT_SUCCESS;
38}