git.fiddlerwoaroof.com
sys_unistd.cc
189f062b
 /* Copyright (C) CJ Affiliate
  *
  * You may use, distribute and modify this code under  the
  * terms of the  GNU General Public License  version 2  or
  * later.
  *
  * You should have received a copy of the license with this
  * file. If not, you will find a copy in the "LICENSE" file
  * at https://github.com/cjdev/dual-control.
  */
 
a8b53afd
 #include "sys_unistd.h"
 #include <unistd.h>
 
189f062b
 namespace
 {
 class impl : public unistd_ifc
 {
 public:
bf756dea
     long int sysconf (int name) const override
189f062b
     {
         return ::sysconf (name);
     }
23c0bd4d
     const char *getlogin() const override
     {
         return ::getlogin();
79081e05
     }
0d8b9a17
     virtual int seteuid (uid_t euid) const override
8b49c701
     {
0d8b9a17
         return ::seteuid (euid);
8b49c701
     };
189f062b
 };
a8b53afd
 }
 
da1b9b25
 unistd unistd::create()
189f062b
 {
15f03c40
     static unistd sys_unistd (unistd::delegate (new impl));
a8b53afd
     return sys_unistd;
 }
0d8b9a17