[Toybox] [PATCH 10/10] getgrgid_r(), forkpty(), getline(), getdelim(), and getutxent() are unsupported in bionic.

Georgi Chorbadzhiyski gf at unixsol.org
Wed Mar 7 16:39:02 PST 2012


getdelim() and getline() are also unsupported under OS X.
---
 toys/id.c     |    2 ++
 toys/netcat.c |    2 ++
 toys/toysh.c  |    2 +-
 toys/who.c    |    4 ++++
 toys/xargs.c  |    2 +-
 5 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/toys/id.c b/toys/id.c
index 6ae3efe..76c70db 100644
--- a/toys/id.c
+++ b/toys/id.c
@@ -144,10 +144,12 @@ void id_main(void)
 		grps[i] = malloc(sizeof(struct group));
 		size_t f = sysconf(_SC_GETGR_R_SIZE_MAX);
 		char *buf = malloc(f);
+#ifndef __ANDROID__
 		if (getgrgid_r(groups[i], grps[i], buf, f, &tmp) < 0) {
 			perror("id");
 			continue;
 		}
+#endif
 		if (tmp == NULL) {
 			perror("id");
 			continue;
diff --git a/toys/netcat.c b/toys/netcat.c
index 1b51337..0cd62e7 100644
--- a/toys/netcat.c
+++ b/toys/netcat.c
@@ -167,8 +167,10 @@ void netcat_main(void)
 
 				// Do we need a tty?
 
+#ifndef __ANDROID__
 				if (toys.optflags&FLAG_t)
 					child = forkpty(&(pollfds[1].fd), NULL, NULL, NULL);
+#endif
 
 				// Do we need to fork and/or redirect for exec?
 
diff --git a/toys/toysh.c b/toys/toysh.c
index 23b88c3..ca7ae1c 100644
--- a/toys/toysh.c
+++ b/toys/toysh.c
@@ -372,7 +372,7 @@ void toysh_main(void)
 		for (;;) {
 			char *command = 0;
 			if (!f) xputc('$');
-			if (1 > getline(&command, &cmdlen, f ? : stdin)) break;
+//			if (1 > getline(&command, &cmdlen, f ? : stdin)) break;
 			handle(command);
 			free(command);
 		}
diff --git a/toys/who.c b/toys/who.c
index f6559bc..cf40fe5 100644
--- a/toys/who.c
+++ b/toys/who.c
@@ -22,6 +22,9 @@ config WHO
 
 #include "toys.h"
 #include <time.h>
+#ifdef __ANDROID__
+void who_main(void) { }
+#else
 #include <utmpx.h>
 
 void who_main(void)
@@ -46,3 +49,4 @@ void who_main(void)
 
     endutxent();
 }
+#endif
diff --git a/toys/xargs.c b/toys/xargs.c
index 0d51325..fa15a55 100644
--- a/toys/xargs.c
+++ b/toys/xargs.c
@@ -130,7 +130,7 @@ void xargs_main(void)
 			// Read line
 			if (!data) {
 				ssize_t l = 0;
-				l = getdelim(&data, (size_t *)&l, TT.delim, stdin);
+//				l = getdelim(&data, (size_t *)&l, TT.delim, stdin);
 
 				if (l<0) {
 					data = 0;
-- 
1.7.5.1




More information about the Toybox mailing list