lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220718031040.44714-1-f.fainelli@gmail.com>
Date:   Sun, 17 Jul 2022 20:10:39 -0700
From:   Florian Fainelli <f.fainelli@...il.com>
To:     linux-kernel@...r.kernel.org
Cc:     Markus Mayer <mmayer@...adcom.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        Sumeet Pawnikar <sumeet.r.pawnikar@...el.com>,
        Alejandro González 
        <alejandro.gonzalez.correo@...il.com>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        Amit Kucheria <amitk@...nel.org>,
        Zhang Rui <rui.zhang@...el.com>,
        Markus Mayer <markus.mayer@...adcom.com>,
        linux-pm@...r.kernel.org (open list:THERMAL)
Subject: [PATCH RESEND] tools/thermal: tmon: include pthread and time headers in tmon.h

From: Markus Mayer <mmayer@...adcom.com>

Include sys/time.h and pthread.h in tmon.h, so that types
"pthread_mutex_t" and "struct timeval tv" are known when tmon.h
references them.

Without these headers, compiling tmon against musl-libc will fail with
these errors:

In file included from sysfs.c:31:0:
tmon.h:47:8: error: unknown type name 'pthread_mutex_t'
 extern pthread_mutex_t input_lock;
        ^~~~~~~~~~~~~~~
make[3]: *** [<builtin>: sysfs.o] Error 1
make[3]: *** Waiting for unfinished jobs....
In file included from tui.c:31:0:
tmon.h:54:17: error: field 'tv' has incomplete type
  struct timeval tv;
                 ^~
make[3]: *** [<builtin>: tui.o] Error 1
make[2]: *** [Makefile:83: tmon] Error 2

Signed-off-by: Markus Mayer <mmayer@...adcom.com>
Acked-by: Florian Fainelli <f.fainelli@...il.com>
Reviewed-by: Sumeet Pawnikar <sumeet.r.pawnikar@...el.com>
Acked-by: Alejandro González <alejandro.gonzalez.correo@...il.com>
Tested-by: Alejandro González <alejandro.gonzalez.correo@...il.com>
---
This patch was first submitted here:

https://lore.kernel.org/all/20200617235809.6817-1-mmayer@broadcom.com/

but never applied, meanwhile the issue is still present

 tools/thermal/tmon/tmon.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/thermal/tmon/tmon.h b/tools/thermal/tmon/tmon.h
index c9066ec104dd..44d16d778f04 100644
--- a/tools/thermal/tmon/tmon.h
+++ b/tools/thermal/tmon/tmon.h
@@ -27,6 +27,9 @@
 #define NR_LINES_TZDATA 1
 #define TMON_LOG_FILE "/var/tmp/tmon.log"
 
+#include <sys/time.h>
+#include <pthread.h>
+
 extern unsigned long ticktime;
 extern double time_elapsed;
 extern unsigned long target_temp_user;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ