chiark / gitweb /
[PATCH] add getgrnam and getpwnam to klibc_fixups files.
authorgreg@kroah.com <greg@kroah.com>
Mon, 24 Nov 2003 04:44:41 +0000 (20:44 -0800)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 04:13:02 +0000 (21:13 -0700)
Hopefully the klibc_fixups code will not be needed eventually.

klibc_fixups.c
klibc_fixups.h [new file with mode: 0644]
namedev.c

index a5d5d5948a1ea876855136fa317b33f468640abc..c12c90fd1cc7469d87ed419493d015066bf3869a 100644 (file)
@@ -4,6 +4,8 @@
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
+#include <sys/types.h>
+#include "klibc_fixups.h"
 
 char *strerror(int errnum)
 {
@@ -29,5 +31,5 @@ int strcasecmp(const char *s1, const char *s2)
        free(n2);
        return retval;
 }
-       
+
 #endif
diff --git a/klibc_fixups.h b/klibc_fixups.h
new file mode 100644 (file)
index 0000000..21a23e7
--- /dev/null
@@ -0,0 +1,42 @@
+#ifdef __KLIBC__
+
+#ifndef KLIBC_FIXUPS_H
+#define KLIBC_FIXUPS_H 
+
+
+extern char *strerror(int errnum);
+
+extern int strcasecmp(const char *s1, const char *s2);
+
+struct group {
+       char    *gr_name;       /* group name */
+       char    *gr_passwd;     /* group password */
+       gid_t   gr_gid;         /* group id */
+       char    **gr_mem;       /* group members */
+};
+
+static inline struct group *getgrnam(const char *name)
+{
+       return NULL;
+}
+
+
+struct passwd {
+       char    *pw_name;       /* user name */
+       char    *pw_passwd;     /* user password */
+       uid_t   pw_uid;         /* user id */
+       gid_t   pw_gid;         /* group id */
+       char    *pw_gecos;      /* real name */
+       char    *pw_dir;        /* home directory */
+       char    *pw_shell;      /* shell program */
+};
+
+static inline struct passwd *getpwnam(const char *name)
+{
+       return NULL;
+}
+
+
+#endif
+
+#endif
index 24b9bc01ac2258f24fb85c67fb1a8c2fce5844cd..3b19aaf9099c8de0a848adb557d17e097f415f18 100644 (file)
--- a/namedev.c
+++ b/namedev.c
@@ -39,6 +39,7 @@
 #include "udev_version.h"
 #include "namedev.h"
 #include "libsysfs/libsysfs.h"
+#include "klibc_fixups.h"
 
 #define TYPE_LABEL     "LABEL"
 #define TYPE_NUMBER    "NUMBER"