git.fiddlerwoaroof.com
sys_pwd.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_pwd.h"
 
 #include <pwd.h>
 
189f062b
 namespace
 {
 class impl : public pwd_ifc
 {
 public:
     int getpwnam_r (const char *user_name, passwd *out, char *buffer,
bf756dea
                     size_t buffer_sz, passwd **result) const override
189f062b
     {
         return ::getpwnam_r (user_name, out, buffer, buffer_sz, result);
     }
a8b53afd
 
189f062b
 };
a8b53afd
 }
 
da1b9b25
 pwd pwd::create()
189f062b
 {
15f03c40
     static pwd system_pwd (pwd::delegate (new impl));
a8b53afd
     return system_pwd;
 }