[PATCH] add getgrnam and getpwnam to klibc_fixups files.

Hopefully the klibc_fixups code will not be needed eventually.
This commit is contained in:
greg@kroah.com 2003-11-23 20:44:41 -08:00 committed by Greg KH
parent 04a81cac0a
commit 2023350eec
3 changed files with 46 additions and 1 deletions

View 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

42
klibc_fixups.h Normal file
View File

@ -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

View File

@ -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"