odds and sods
[tridge/junkcode.git] / fake_uname.c
1 #include <pwd.h>
2 #include <sys/types.h>
3 #include <sys/utsname.h>
4
5 int uname(struct utsname *buf)
6 {
7
8 }
9
10 struct passwd *getpwuid(uid_t uid)
11 {
12         static void *h;
13         static struct passwd * (*getpwuid_orig)(uid_t uid);
14         if (!h) {
15                 h = dlopen("/lib/libc.so.6", RTLD_LAZY);
16                 getpwuid_orig = dlsym(h, "getpwuid");
17         }
18         
19         return getpwuid_orig(uid+1);
20 }