File:  [DVB] / dietlibc / libcompat / cuserid.c
Revision 1.3: download - view: text, annotated - select for diffs
Sat Apr 11 04:32:45 2015 UTC (9 years, 1 month ago) by leitner
Branches: MAIN
CVS tags: HEAD
  fix cuserid

/* according to the Linux manpages, "nobody knows precisely what cuserid()
 * does".
 * (c) 2002 Andreas Krennmair <ak@tcp-ip.at>
 */
#include <unistd.h>
#include <pwd.h>
#include <string.h>
#include <dietwarning.h>

char * cuserid(char * string) {
  struct passwd * sp;
  static char buf[L_cuserid];
  sp = getpwuid(geteuid());
  if (sp) {
    if (!string) string=buf;
    strlcpy(string,sp->pw_name,L_cuserid);
    return string;
  }
  return NULL;
}

link_warning("cuserid","cuserid is obsolete junk, don't use!");

LinuxTV legacy CVS <linuxtv.org/cvs>