Matt Kraai | 258bd3d | 2001-10-24 19:00:20 +0000 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: */ |
| 2 | /* |
| 3 | * Mini true implementation for busybox |
| 4 | * |
Eric Andersen | c7bda1c | 2004-03-15 08:29:22 +0000 | [diff] [blame] | 5 | * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> |
Matt Kraai | 258bd3d | 2001-10-24 19:00:20 +0000 | [diff] [blame] | 6 | * |
Denys Vlasenko | 0ef64bd | 2010-08-16 20:14:46 +0200 | [diff] [blame] | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
Matt Kraai | 258bd3d | 2001-10-24 19:00:20 +0000 | [diff] [blame] | 8 | */ |
Denys Vlasenko | af3f420 | 2016-11-23 14:46:56 +0100 | [diff] [blame] | 9 | //config:config TRUE |
| 10 | //config: bool "true" |
| 11 | //config: default y |
| 12 | //config: help |
| 13 | //config: true returns an exit code of TRUE (0). |
| 14 | |
| 15 | //applet:IF_TRUE(APPLET_NOFORK(true, true, BB_DIR_BIN, BB_SUID_DROP, true)) |
| 16 | |
| 17 | //kbuild:lib-$(CONFIG_TRUE) += true.o |
Matt Kraai | 258bd3d | 2001-10-24 19:00:20 +0000 | [diff] [blame] | 18 | |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 19 | /* BB_AUDIT SUSv3 compliant */ |
| 20 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/true.html */ |
Matt Kraai | 258bd3d | 2001-10-24 19:00:20 +0000 | [diff] [blame] | 21 | |
Denys Vlasenko | de5edad | 2015-04-21 16:00:41 +0200 | [diff] [blame] | 22 | /* "true --help" is special-cased to ignore --help */ |
| 23 | //usage:#define true_trivial_usage NOUSAGE_STR |
| 24 | //usage:#define true_full_usage "" |
Pere Orga | 3442538 | 2011-03-31 14:43:25 +0200 | [diff] [blame] | 25 | //usage:#define true_example_usage |
| 26 | //usage: "$ true\n" |
| 27 | //usage: "$ echo $?\n" |
| 28 | //usage: "0\n" |
| 29 | |
Denis Vlasenko | b6adbf1 | 2007-05-26 19:00:18 +0000 | [diff] [blame] | 30 | #include "libbb.h" |
Matt Kraai | 258bd3d | 2001-10-24 19:00:20 +0000 | [diff] [blame] | 31 | |
Denis Vlasenko | 99912ca | 2007-04-10 15:43:37 +0000 | [diff] [blame] | 32 | /* This is a NOFORK applet. Be very careful! */ |
| 33 | |
Denis Vlasenko | 9b49a5e | 2007-10-11 10:05:36 +0000 | [diff] [blame] | 34 | int true_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
Denis Vlasenko | a60f84e | 2008-07-05 09:18:54 +0000 | [diff] [blame] | 35 | int true_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) |
Matt Kraai | 258bd3d | 2001-10-24 19:00:20 +0000 | [diff] [blame] | 36 | { |
| 37 | return EXIT_SUCCESS; |
| 38 | } |