oct-uname.cc

Go to the documentation of this file.
00001 /*
00002 
00003 Copyright (C) 2005-2012 John W. Eaton
00004 
00005 This file is part of Octave.
00006 
00007 Octave is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 3 of the License, or (at your
00010 option) any later version.
00011 
00012 Octave is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Octave; see the file COPYING.  If not, see
00019 <http://www.gnu.org/licenses/>.
00020 
00021 */
00022 
00023 #ifdef HAVE_CONFIG_H
00024 #include <config.h>
00025 #endif
00026 
00027 #include <cerrno>
00028 #include <cstring>
00029 
00030 #ifdef HAVE_SYS_UTSNAME_H
00031 #include <sys/utsname.h>
00032 #endif
00033 
00034 #include "oct-uname.h"
00035 
00036 void
00037 octave_uname::init (void)
00038 {
00039 #if defined (HAVE_UNAME) && defined (HAVE_SYS_UTSNAME_H)
00040   struct utsname unm;
00041 
00042   err = ::uname (&unm);
00043 
00044   if (err < 0)
00045     msg = gnulib::strerror (errno);
00046   else
00047     {
00048       utsname_sysname = unm.sysname;
00049       utsname_nodename = unm.nodename;
00050       utsname_release = unm.release;
00051       utsname_version = unm.version;
00052       utsname_machine = unm.machine;
00053     }
00054 #endif
00055 }
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines