blob: 7dd91463811e67f8e573d3d1a3e100b0d78344da [file] [log] [blame]
Erik Andersencbb0a4b2000-04-04 18:52:02 +00001/* vi: set sw=4 ts=4: */
2/*
Manuel Novoa III cad53642003-03-19 09:13:01 +00003 * usleep implementation for busybox
Erik Andersencbb0a4b2000-04-04 18:52:02 +00004 *
Manuel Novoa III cad53642003-03-19 09:13:01 +00005 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org>
Erik Andersencbb0a4b2000-04-04 18:52:02 +00006 *
"Robert P. J. Day"801ab142006-07-12 07:56:04 +00007 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
Erik Andersencbb0a4b2000-04-04 18:52:02 +00008 */
9
Manuel Novoa III cad53642003-03-19 09:13:01 +000010/* BB_AUDIT SUSv3 N/A -- Apparently a busybox extension. */
Eric Andersen92d23242001-03-19 23:49:41 +000011
Erik Andersencbb0a4b2000-04-04 18:52:02 +000012#include <stdlib.h>
Manuel Novoa III cad53642003-03-19 09:13:01 +000013#include <limits.h>
Erik Andersencbb0a4b2000-04-04 18:52:02 +000014#include <unistd.h>
Eric Andersencbe31da2001-02-20 06:14:08 +000015#include "busybox.h"
Erik Andersencbb0a4b2000-04-04 18:52:02 +000016
Denis Vlasenko06af2162007-02-03 17:28:39 +000017int usleep_main(int argc, char **argv);
Rob Landleydfba7412006-03-06 20:47:33 +000018int usleep_main(int argc, char **argv)
Erik Andersencbb0a4b2000-04-04 18:52:02 +000019{
Manuel Novoa III cad53642003-03-19 09:13:01 +000020 if (argc != 2) {
21 bb_show_usage();
Erik Andersencbb0a4b2000-04-04 18:52:02 +000022 }
23
Denis Vlasenko13858992006-10-08 12:49:22 +000024 if (usleep(xatou(argv[1]))) {
Manuel Novoa III cad53642003-03-19 09:13:01 +000025 bb_perror_nomsg_and_die();
26 }
27
Matt Kraai3e856ce2000-12-01 02:55:13 +000028 return EXIT_SUCCESS;
Erik Andersencbb0a4b2000-04-04 18:52:02 +000029}