1 /* 2 * Copyright (c) 2018 Intel Corporation 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #include <errno.h> 8 9 #include <zephyr/kernel.h> 10 #include <zephyr/posix/unistd.h> 11 12 /** 13 * @brief Sleep for a specified number of seconds. 14 * 15 * See IEEE 1003.1 16 */ sleep(unsigned int seconds)17unsigned sleep(unsigned int seconds) 18 { 19 int rem; 20 21 rem = k_sleep(K_SECONDS(seconds)); 22 __ASSERT_NO_MSG(rem >= 0); 23 24 return rem / MSEC_PER_SEC; 25 } 26