void xputs(char *s);
void xputc(char c);
void xflush(void);
-pid_t xfork(void);
void xexec_optargs(int skip);
void xexec(char **argv);
pid_t xpopen_both(char **argv, int *pipes);
#include "toys.h"
+#if !defined(__uClinux__)
+pid_t xfork(void)
+{
+ pid_t pid = fork();
+
+ if (pid < 0) perror_exit("fork");
+
+ return pid;
+}
+#endif
+
#if defined(__APPLE__)
ssize_t getdelim(char **linep, size_t *np, int delim, FILE *stream)
{
// any flag newer than MS_MOVE, which was added in 2001 (linux 2.5.0.5),
// eleven years earlier.
+#include <sys/mount.h>
+#ifndef MS_MOVE
#define MS_MOVE (1<<13)
+#endif
+#ifndef MS_REC
#define MS_REC (1<<14)
+#endif
+#ifndef MS_SILENT
#define MS_SILENT (1<<15)
+#endif
+#ifndef MS_UNBINDABLE
#define MS_UNBINDABLE (1<<17)
+#endif
+#ifndef MS_PRIVATE
#define MS_PRIVATE (1<<18)
+#endif
+#ifndef MS_SLAVE
#define MS_SLAVE (1<<19)
+#endif
+#ifndef MS_SHARED
#define MS_SHARED (1<<20)
+#endif
// When building under obsolete glibc (Ubuntu 8.04-ish), hold its hand a bit.
#elif __GLIBC__ == 2 && __GLIBC_MINOR__ < 10
typedef float FLOAT;
#endif
+#ifndef __uClinux__
+pid_t xfork(void);
+#endif
+
+//#define strncpy(...) @@strncpyisbadmmkay@@
+//#define strncat(...) @@strcatisbadmmkay@@
if (fflush(stdout) || ferror(stdout)) perror_exit("write");;
}
-pid_t xfork(void)
-{
- pid_t pid = fork();
-
- if (pid < 0) perror_exit("fork");
-
- return pid;
-}
-
// Call xexec with a chunk of optargs, starting at skip. (You can't just
// call xexec() directly because toy_init() frees optargs.)
void xexec_optargs(int skip)