From 2023350eece60db60d30e387cfb644df09b9e8b6 Mon Sep 17 00:00:00 2001 From: "greg@kroah.com" Date: Sun, 23 Nov 2003 20:44:41 -0800 Subject: [PATCH] [PATCH] add getgrnam and getpwnam to klibc_fixups files. Hopefully the klibc_fixups code will not be needed eventually. --- klibc_fixups.c | 4 +++- klibc_fixups.h | 42 ++++++++++++++++++++++++++++++++++++++++++ namedev.c | 1 + 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 klibc_fixups.h diff --git a/klibc_fixups.c b/klibc_fixups.c index a5d5d5948..c12c90fd1 100644 --- a/klibc_fixups.c +++ b/klibc_fixups.c @@ -4,6 +4,8 @@ #include #include #include +#include +#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 index 000000000..21a23e776 --- /dev/null +++ b/klibc_fixups.h @@ -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 diff --git a/namedev.c b/namedev.c index 24b9bc01a..3b19aaf90 100644 --- 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" -- 2.30.2