API
Applications
Utilities
API
Handbook
GitHub
Home
thSetuid.hpp
Go to the documentation of this file.
1
/** \file thSetuid.hpp
2
* \brief Set euid in a single thread
3
* \author Jared R. Males (jaredmales@gmail.com)
4
*
5
* \ingroup sys_files
6
* History:
7
* - 2019-07-12 created by JRM
8
*/
9
10
#ifndef sys_thSetuid_hpp
11
#define sys_thSetuid_hpp
12
13
#include <unistd.h>
14
15
namespace
MagAOX
16
{
17
namespace
sys
18
{
19
20
/// Sets the effective user id of the calling thread, rather than the whole process
21
/** Uses the syscall directly so that only the calling thread has modified privileges.
22
*
23
* Ref: http://man7.org/linux/man-pages/man2/seteuid.2.html
24
*
25
* \returns 0 on success
26
* \returns -1 on error, and errno is set
27
*
28
* \ingroup sys
29
*/
30
int
th_seteuid
(uid_t euid
/**< [in] the desired new effective user id */
);
31
32
}
//namespace sys
33
}
//namespace MagAOX
34
35
#endif
//sys_thSetuid_hpp
36
MagAOX::sys::th_seteuid
int th_seteuid(uid_t euid)
Sets the effective user id of the calling thread, rather than the whole process.
Definition:
thSetuid.cpp:18
MagAOX
Definition:
dm.hpp:24
libMagAOX
sys
thSetuid.hpp
Generated by
1.9.1