~ubuntu-branches/ubuntu/utopic/coreutils/utopic-proposed

« back to all changes in this revision

Viewing changes to lib/nanosleep.c

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-11-28 03:03:42 UTC
  • mfrom: (8.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20121128030342-21zanj8354gas5gr
Tags: 8.20-3ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Make 'uname -i -p' return the real processor/hardware, instead of
    unknown.
  - Build-depend on gettext:any instead of on gettext, so that apt-get can
    properly resolve build-dependencies on the tool when cross-building.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Provide a replacement for the POSIX nanosleep function.
2
2
 
3
 
   Copyright (C) 1999-2000, 2002, 2004-2011 Free Software Foundation, Inc.
 
3
   Copyright (C) 1999-2000, 2002, 2004-2012 Free Software Foundation, Inc.
4
4
 
5
5
   This program is free software: you can redistribute it and/or modify
6
6
   it under the terms of the GNU General Public License as published by
16
16
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
17
17
 
18
18
/* written by Jim Meyering
19
 
   and Bruno Haible for the Woe32 part */
 
19
   and Bruno Haible for the native Windows part */
20
20
 
21
21
#include <config.h>
22
22
 
87
87
}
88
88
 
89
89
#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
90
 
/* Windows platforms.  */
 
90
/* Native Windows platforms.  */
91
91
 
92
92
# define WIN32_LEAN_AND_MEAN
93
93
# include <windows.h>
94
94
 
95
 
/* The Win32 function Sleep() has a resolution of about 15 ms and takes
 
95
/* The Windows API function Sleep() has a resolution of about 15 ms and takes
96
96
   at least 5 ms to execute.  We use this function for longer time periods.
97
97
   Additionally, we use busy-looping over short time periods, to get a
98
98
   resolution of about 0.01 ms.  In order to measure such short timespans,