File indexing completed on 2025-03-16 08:15:00
0001 /* 0002 KWin - the KDE window manager 0003 This file is part of the KDE project. 0004 0005 SPDX-FileCopyrightText: 2023 Xaver Hugl <xaver.hugl@gmail.com> 0006 0007 SPDX-License-Identifier: GPL-2.0-or-later 0008 */ 0009 #pragma once 0010 #include "utils/version.h" 0011 0012 #include <sys/utsname.h> 0013 0014 namespace KWin 0015 { 0016 0017 inline static Version linuxKernelVersion() 0018 { 0019 struct utsname name; 0020 uname(&name); 0021 0022 if (qstrcmp(name.sysname, "Linux") == 0) { 0023 return Version::parseString(name.release); 0024 } 0025 return Version(0, 0, 0); 0026 } 0027 0028 }