#include <utime.h>
#include <unistd.h>
#include <ctype.h>
+#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/utsname.h> /* for uname(2) */
+
#include "pwd_grp/pwd.h"
#include "pwd_grp/grp.h"
+/* for the _syscall() macros */
+#include <sys/syscall.h>
+#include <linux/unistd.h>
+
/* Busybox mount uses either /proc/filesystems or /dev/mtab to get the
* list of available filesystems used for the -t auto option */
#if defined BB_FEATURE_USE_PROCFS && defined BB_FEATURE_USE_DEVPS_PATCH
myuser = getpwnam(name);
if (myuser==NULL)
- error_msg_and_die( "unknown username: %s\n", name);
+ return(-1);
return myuser->pw_uid;
}
mygroup = getgrnam(name);
if (mygroup==NULL)
- error_msg_and_die( "unknown group: %s\n", name);
+ return(-1);
return (mygroup->gr_gid);
}
myuser = getpwuid(uid);
if (myuser==NULL)
- error_msg_and_die( "unknown uid %ld\n", (long)uid);
-
- strcpy(name, myuser->pw_name);
+ sprintf(name, "%-8ld ", (long)uid);
+ else
+ strcpy(name, myuser->pw_name);
}
/* gets a groupname given a gid */
mygroup = getgrgid(gid);
if (mygroup==NULL)
- error_msg_and_die( "unknown gid %ld\n", (long)gid);
-
- strcpy(group, mygroup->gr_name);
+ sprintf(group, "%-8ld ", (long)gid);
+ else
+ strcpy(group, mygroup->gr_name);
}
#if defined BB_ID
#if defined BB_DF || defined BB_MTAB
+#include <mntent.h>
/*
* Given a block device, find the mount table entry if that block device
* is mounted.
#endif
#if defined BB_GREP || defined BB_SED
+#include <regex.h>
void xregcomp(regex_t *preg, const char *regex, int cflags)
{
int ret;