monotone

monotone Mtn Source Tree

Root/unix/get_system_flavour.cc

1// copyright (C) 2004 graydon hoare <graydon@pobox.com>
2// all rights reserved.
3// licensed to the public under the terms of the GNU GPL (>= 2)
4// see the file COPYING for details
5
6#include <sys/utsname.h>
7#include "sanity.hh"
8
9void get_system_flavour(std::string & ident)
10{
11 struct utsname n;
12 /* Solaris has >= 0 as success, while
13 Linux only knows 0 - as >0 is not an
14 error condition there, relax a bit */
15 I(uname(&n) >= 0);
16 ident = (FL("%s %s %s %s")
17 % n.sysname
18 % n.release
19 % n.version
20 % n.machine).str();
21}
22
23// Local Variables:
24// mode: C++
25// fill-column: 76
26// c-file-style: "gnu"
27// indent-tabs-mode: nil
28// End:
29// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s:

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status