GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: tmp_project/StringUtils/src/phoenix_whoami.cpp Lines: 5 5 100.0 %
Date: 2024-12-09 15:30:52 Branches: 3 3 100.0 %

Line Branch Exec Source
1
/***************************************
2
	Auteur : Pierre Aubert
3
	Mail : pierre.aubert@lapp.in2p3.fr
4
	Licence : CeCILL-C
5
****************************************/
6
7
#include "unistd.h"
8
#include "phoenix_whoami.h"
9
10
///Get the name of the current user
11
/**	@return name of the current user
12
*/
13
1
std::string phoenix_whoami(){
14
1
	std::string str("");
15
1
	str.resize(1024lu);
16
1
	getlogin_r((char*)str.data(), str.size() - 1lu);
17
1
	return str;
18
}
19
20