1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2011 New Dream Network
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
15 #ifndef CEPH_COMMON_CODE_ENVIRONMENT_H
16 #define CEPH_COMMON_CODE_ENVIRONMENT_H
18 enum code_environment_t
{
19 CODE_ENVIRONMENT_UTILITY
= 0,
20 CODE_ENVIRONMENT_DAEMON
= 1,
21 CODE_ENVIRONMENT_LIBRARY
= 2,
22 CODE_ENVIRONMENT_UTILITY_NODOUT
= 3,
29 extern "C" code_environment_t g_code_env
;
30 extern "C" const char *code_environment_to_str(enum code_environment_t e
);
31 std::ostream
&operator<<(std::ostream
&oss
, const enum code_environment_t e
);
32 extern "C" int get_process_name(char *buf
, int len
);
33 std::string
get_process_name_cpp();
37 extern code_environment_t g_code_env
;
38 const char *code_environment_to_str(const enum code_environment_t e
);
39 extern int get_process_name(char *buf
, int len
);