1*4882a593SmuzhiyunFrom 947bf03ec3d9eaa0bfc0269eed86b9364e94bc1a Mon Sep 17 00:00:00 2001
2*4882a593SmuzhiyunFrom: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
3*4882a593SmuzhiyunDate: Sun, 5 Aug 2018 15:25:53 +0200
4*4882a593SmuzhiyunSubject: [PATCH] missing.h: drop clock_nanosleep() replacement
5*4882a593Smuzhiyun
6*4882a593SmuzhiyunSince uClibc-ng commits 68628fe7d463541bf3c33da6b214e63c0cc9feed
7*4882a593Smuzhiyun("librt: declare clock_nanosleep not only for NPTL") and
8*4882a593Smuzhiyunddbb03e77ac1a48740688814b82f45c97ee81f37 ("librt: clock_nanosleep
9*4882a593Smuzhiyuncould be even used without threads"), clock_nanosleep() is always
10*4882a593Smuzhiyunprovided by uClibc, regardless of the thread implementation (none,
11*4882a593Smuzhiyunlinuxthreads, nptl). These commits will be part of the upcoming 1.0.31
12*4882a593Smuzhiyunrelease of uClibc-ng.
13*4882a593Smuzhiyun
14*4882a593SmuzhiyunThanks to this, we can drop the replacement clock_nanosleep()
15*4882a593Smuzhiyunimplementation added by linuxptp. Without this, linuxptp fails to
16*4882a593Smuzhiyunbuild with:
17*4882a593Smuzhiyun
18*4882a593Smuzhiyunmissing.h:117:19: error: static declaration of 'clock_nanosleep' follows non-static declaration
19*4882a593Smuzhiyun static inline int clock_nanosleep(clockid_t clock_id, int flags,
20*4882a593Smuzhiyun                   ^~~~~~~~~~~~~~~
21*4882a593SmuzhiyunIn file included from clockadj.h:24:0,
22*4882a593Smuzhiyun                 from clockadj.c:24:
23*4882a593Smuzhiyun
24*4882a593SmuzhiyunSigned-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
25*4882a593Smuzhiyun---
26*4882a593Smuzhiyun missing.h | 7 -------
27*4882a593Smuzhiyun 1 file changed, 7 deletions(-)
28*4882a593Smuzhiyun
29*4882a593Smuzhiyundiff --git a/missing.h b/missing.h
30*4882a593Smuzhiyunindex 2f7adb9..60f89a3 100644
31*4882a593Smuzhiyun--- a/missing.h
32*4882a593Smuzhiyun+++ b/missing.h
33*4882a593Smuzhiyun@@ -129,13 +129,6 @@ enum {
34*4882a593Smuzhiyun
35*4882a593Smuzhiyun #define TFD_TIMER_ABSTIME (1 << 0)
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun-static inline int clock_nanosleep(clockid_t clock_id, int flags,
38*4882a593Smuzhiyun-				  const struct timespec *request,
39*4882a593Smuzhiyun-				  struct timespec *remain)
40*4882a593Smuzhiyun-{
41*4882a593Smuzhiyun-	return syscall(__NR_clock_nanosleep, clock_id, flags, request, remain);
42*4882a593Smuzhiyun-}
43*4882a593Smuzhiyun-
44*4882a593Smuzhiyun static inline int timerfd_create(int clockid, int flags)
45*4882a593Smuzhiyun {
46*4882a593Smuzhiyun 	return syscall(__NR_timerfd_create, clockid, flags);
47*4882a593Smuzhiyun--
48*4882a593Smuzhiyun2.14.4
49*4882a593Smuzhiyun
50