summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/cvs/vms/pwd.c
blob: 97b5c5ca1b1f5764afec955d90404e9b1d0ff338 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "pwd.h"
#include <stdio.h>
#include <unixlib.h>

static struct passwd pw;

struct passwd *getpwuid(uid_t uid)
{
  pw.pw_name = getlogin();
  pw.pw_uid = getuid();
  pw.pw_gid = getgid();

  return &pw;
}

struct passwd *getpwnam(char *name)
{
  pw.pw_name = getlogin();
  pw.pw_uid = getuid();
  pw.pw_gid = getgid();

  return &pw;
}

char *getlogin()
{
  static char login[256];
  return cuserid(login);
}