Deleted Added
full compact
usleep.c (108380) usleep.c (148656)
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 21 unchanged lines hidden (view full) ---

30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34#if defined(LIBC_SCCS) && !defined(lint)
35static char sccsid[] = "@(#)usleep.c 8.1 (Berkeley) 6/4/93";
36#endif /* LIBC_SCCS and not lint */
37#include <sys/cdefs.h>
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 21 unchanged lines hidden (view full) ---

30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34#if defined(LIBC_SCCS) && !defined(lint)
35static char sccsid[] = "@(#)usleep.c 8.1 (Berkeley) 6/4/93";
36#endif /* LIBC_SCCS and not lint */
37#include <sys/cdefs.h>
38__FBSDID("$FreeBSD: head/lib/libc/gen/usleep.c 108380 2002-12-29 00:59:09Z mike $");
38__FBSDID("$FreeBSD: head/lib/libc/gen/usleep.c 148656 2005-08-03 00:44:25Z deischen $");
39
40#include "namespace.h"
41#include <time.h>
42#include <unistd.h>
43#include "un-namespace.h"
44
45int
39
40#include "namespace.h"
41#include <time.h>
42#include <unistd.h>
43#include "un-namespace.h"
44
45int
46usleep(useconds)
46__usleep(useconds)
47 useconds_t useconds;
48{
49 struct timespec time_to_sleep;
50
51 time_to_sleep.tv_nsec = (useconds % 1000000) * 1000;
52 time_to_sleep.tv_sec = useconds / 1000000;
53 return (_nanosleep(&time_to_sleep, NULL));
54}
47 useconds_t useconds;
48{
49 struct timespec time_to_sleep;
50
51 time_to_sleep.tv_nsec = (useconds % 1000000) * 1000;
52 time_to_sleep.tv_sec = useconds / 1000000;
53 return (_nanosleep(&time_to_sleep, NULL));
54}
55
56__weak_reference(__usleep, usleep);
57__weak_reference(__usleep, _usleep);