ns-3 Direct Code Execution
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
dce-credentials.cc
Go to the documentation of this file.
1 #include "dce-unistd.h"
2 
3 #include "utils.h"
4 #include "process.h"
5 #include "ns3/log.h"
6 #include "ns3/assert.h"
7 #include <errno.h>
8 
9 using namespace ns3;
10 
11 NS_LOG_COMPONENT_DEFINE ("DceCredentials");
12 
13 
14 
15 gid_t dce_getgid (void)
16 {
17  Thread *current = Current ();
18  NS_LOG_FUNCTION (current);
19  NS_ASSERT (current != 0);
20 
21  return current->process->rgid;
22 }
23 
24 gid_t dce_getegid (void)
25 {
26  Thread *current = Current ();
27  NS_LOG_FUNCTION (current);
28  NS_ASSERT (current != 0);
29 
30  return current->process->egid;
31 }
32 
33 pid_t dce_getpgrp (void)
34 {
35  Thread *current = Current ();
36  NS_LOG_FUNCTION (current);
37  NS_ASSERT (current != 0);
38 
39  return current->process->pgid;
40 }
41 
42 int dce_euidaccess (const char *pathname, int mode)
43 {
44  NS_LOG_FUNCTION (pathname << mode);
45  std::string rPath = UtilsGetRealFilePath (pathname);
46  int ret = euidaccess (rPath.c_str (), mode);
47  return ret;
48 }
49 int dce_eaccess (const char *pathname, int mode)
50 {
51  NS_LOG_FUNCTION (pathname << mode);
52  std::string rPath = UtilsGetRealFilePath (pathname);
53  int ret = eaccess (rPath.c_str (), mode);
54  return ret;
55 }
56 int dce_chown(const char *path, uid_t owner, gid_t group)
57 {
58  // XXX
59  return 0;
60 }
61 
62 int dce_initgroups(const char *user, gid_t group)
63 {
64  // XXX
65  return 0;
66 }
67