1
0
mirror of https://github.com/Zygo/bees.git synced 2025-05-17 13:25:45 +02:00

lib: add Uname, a constructor for utsname

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
Zygo Blaxell 2021-11-02 21:50:36 -04:00
parent 7f67f55746
commit 5d7e815eb4
3 changed files with 26 additions and 0 deletions

14
include/crucible/uname.h Normal file
View File

@ -0,0 +1,14 @@
#ifndef CRUCIBLE_UNAME_H
#define CRUCIBLE_UNAME_H
#include <sys/utsname.h>
namespace crucible {
using namespace std;
struct Uname : public utsname {
Uname();
};
}
#endif

View File

@ -19,6 +19,7 @@ CRUCIBLE_OBJS = \
string.o \
task.o \
time.o \
uname.o \
include ../makeflags
-include ../localconf

11
lib/uname.cc Normal file
View File

@ -0,0 +1,11 @@
#include "crucible/error.h"
#include "crucible/uname.h"
namespace crucible {
using namespace std;
Uname::Uname()
{
DIE_IF_NON_ZERO(uname(static_cast<utsname*>(this)));
}
}