Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

CArchSystemUnix.cpp

00001 /*
00002  * synergy -- mouse and keyboard sharing utility
00003  * Copyright (C) 2004 Chris Schoeneman
00004  * 
00005  * This package is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * found in the file COPYING that should have accompanied this file.
00008  * 
00009  * This package is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  */
00014 
00015 #include "CArchSystemUnix.h"
00016 #include <sys/utsname.h>
00017 
00018 //
00019 // CArchSystemUnix
00020 //
00021 
00022 CArchSystemUnix::CArchSystemUnix()
00023 {
00024     // do nothing
00025 }
00026 
00027 CArchSystemUnix::~CArchSystemUnix()
00028 {
00029     // do nothing
00030 }
00031 
00032 std::string
00033 CArchSystemUnix::getOSName() const
00034 {
00035 #if defined(HAVE_SYS_UTSNAME_H)
00036     struct utsname info;
00037     if (uname(&info) == 0) {
00038         std::string msg;
00039         msg += info.sysname;
00040         msg += " ";
00041         msg += info.release;
00042         msg += " ";
00043         msg += info.version;
00044         return msg;
00045     }
00046 #endif
00047     return "Unix";
00048 }
00049 
00050 std::string
00051 CArchSystemUnix::getPlatformName() const
00052 {
00053 #if defined(HAVE_SYS_UTSNAME_H)
00054     struct utsname info;
00055     if (uname(&info) == 0) {
00056         return std::string(info.machine);
00057     }
00058 #endif
00059     return "unknown";
00060 }

Generated on Fri Nov 6 00:21:13 2009 for synergy-plus by  doxygen 1.3.9.1