cppthread 1.1.16
C++ Thread Library
boot_id.cpp
1// Copyright (c) 2020-2025 Made to Order Software Corp. All Rights Reserved
2//
3// https://snapwebsites.org/project/cppthread
4// contact@m2osw.com
5//
6// This program is free software; you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation; either version 2 of the License, or
9// (at your option) any later version.
10//
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15//
16// You should have received a copy of the GNU General Public License along
17// with this program; if not, write to the Free Software Foundation, Inc.,
18// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20// cppthread
21//
22#include <cppthread/thread.h>
23
24
25// libexcept
26//
27#include <libexcept/file_inheritance.h>
28
29
30// C++
31//
32#include <iostream>
33
34
35// C
36//
37#include <string.h>
38
39
40// last include
41//
42#include <snapdev/poison.h>
43
44
45
46int main(int argc, char * argv[])
47{
48 libexcept::verify_inherited_files();
49
50 for(int i(1); i < argc; ++i)
51 {
52 if(strcmp(argv[i], "--help") == 0
53 || strcmp(argv[i], "-h") == 0)
54 {
55 std::cerr << "Usage: " << argv[0] << " [--opts]" << std::endl;
56 std::cerr << "where --opts is one of:" << std::endl;
57 std::cerr << " --help | -h print out this help screen" << std::endl;
58 return 3;
59 }
60 else
61 {
62 std::cerr << argv[0] << ":error: unexpected command line option \"" << argv[i] << "\"." << std::endl;
63 return 1;
64 }
65 }
66
67 std::cout << cppthread::get_boot_id() << std::endl;
68
69 return 1;
70}
71
72// vim: ts=4 sw=4 et
std::string get_boot_id()
Retrieve the boot UUID.
Definition thread.cpp:1372
Thread Runner and Managers.

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.