shithub: riscv

Download patch

ref: 583c6d269b4589be4d3b711b56ccf51d89414215
parent: 0763dd42793dea2023e0f345f647af9932486841
author: spew <devnull@localhost>
date: Sun Jun 17 13:38:00 EDT 2018

ape: add some common fields for stat, grp and pwd

--- a/sys/include/ape/grp.h
+++ b/sys/include/ape/grp.h
@@ -8,6 +8,7 @@
 
 struct	group {
 	char	*gr_name;
+	char	*gr_passwd;
 	gid_t	gr_gid;
 	char	**gr_mem;
 };
--- a/sys/include/ape/pwd.h
+++ b/sys/include/ape/pwd.h
@@ -8,8 +8,10 @@
 
 struct passwd {
 	char	*pw_name;
+	char	*pw_passwd;
 	uid_t	pw_uid;
 	gid_t	pw_gid;
+	char	*pw_gecos;
 	char	*pw_dir;
 	char	*pw_shell;
 };
--- a/sys/include/ape/sys/stat.h
+++ b/sys/include/ape/sys/stat.h
@@ -17,6 +17,7 @@
 	nlink_t	st_nlink;
 	uid_t 	st_uid;
 	gid_t 	st_gid;
+	dev_t	st_rdev;
 	off_t	st_size;
 	time_t	st_atime;
 	time_t	st_mtime;
--- a/sys/src/ape/lib/ap/plan9/dirtostat.c
+++ b/sys/src/ape/lib/ap/plan9/dirtostat.c
@@ -27,6 +27,7 @@
 	s->st_nlink = 1;
 	s->st_uid = 1;
 	s->st_gid = 1;
+	s->st_rdev = 0;
 	if(fi && (fi->flags&FD_BUFFERED))
 		s->st_size = fi->buf->n;
 	else
--- a/sys/src/ape/lib/ap/plan9/getgrgid.c
+++ b/sys/src/ape/lib/ap/plan9/getgrgid.c
@@ -17,6 +17,7 @@
 	mem = 0;
 	if(_getpw(&num, &nam, &mem)){
 		holdgroup.gr_name = nam;
+		holdgroup.gr_passwd = "";
 		holdgroup.gr_gid = num;
 		holdgroup.gr_mem = _grpmems(mem);
 		return &holdgroup;
--- a/sys/src/ape/lib/ap/plan9/getgrnam.c
+++ b/sys/src/ape/lib/ap/plan9/getgrnam.c
@@ -17,6 +17,7 @@
 	mem = 0;
 	if(_getpw(&num, &nam, &mem)){
 		holdgroup.gr_name = nam;
+		holdgroup.gr_passwd = "";
 		holdgroup.gr_gid = num;
 		holdgroup.gr_mem = _grpmems(mem);
 		return &holdgroup;
--- a/sys/src/ape/lib/ap/plan9/getpwnam.c
+++ b/sys/src/ape/lib/ap/plan9/getpwnam.c
@@ -18,10 +18,12 @@
 	mem = 0;
 	if(_getpw(&num, &nam, &mem)){
 		holdpw.pw_name = nam;
+		holdpw.pw_passwd = "";
 		holdpw.pw_uid = num;
 		holdpw.pw_gid = num;
 		strncpy(dirbuf+5, nam, sizeof(dirbuf)-6);
 		holdpw.pw_dir = dirbuf;
+		holdpw.pw_gecos = "";
 		holdpw.pw_shell = rc;
 		return &holdpw;
 	}
--- a/sys/src/ape/lib/ap/plan9/getpwuid.c
+++ b/sys/src/ape/lib/ap/plan9/getpwuid.c
@@ -19,10 +19,12 @@
 	mem = 0;
 	if(_getpw(&num, &nam, &mem)){
 		holdpw.pw_name = nam;
+		holdpw.pw_passwd = "";
 		holdpw.pw_uid = num;
 		holdpw.pw_gid = num;
 		strncpy(dirbuf+5, nam, sizeof(dirbuf)-6);
 		holdpw.pw_dir = dirbuf;
+		holdpw.pw_gecos = "";
 		holdpw.pw_shell = rc;
 		return &holdpw;
 	}