--- /dev/null
+/*
+ */
+#ifndef _LIBPOSIX_ENDIAN_H_
+#define _LIBPOSIX_ENDIAN_H_
+
+#define __LITTLE_ENDIAN 0
+#define __BIG_ENDIAN 0
+#define __BYTE_ORDER __LITTLE_ENDIAN
+
+#endif
+
--- /dev/null
+/*
+ * Acess2 POSIX Emulation Library
+ * - By John Hodge (thePowersGang)
+ *
+ * regex.h
+ * - POSIX regular expression support
+ */
+#ifndef _LIBPOSIX_REGEX_H_
+#define _LIBPOSIX_REGEX_H_
+
+typedef struct {
+ void *unused;
+} regex_t;
+
+typedef size_t regoff_t;
+
+typedef struct {
+ regoff_t rm_so;
+ regoff_t rm_eo;
+} regmatch_t;
+
+extern int regcomp(regex_t *preg, const char *regex, int cflags);
+extern int regexec(const regex_t *preg, const char *string, size_t nmatch, regmatch_t pmatch[], int eflags);
+extern size_t regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size);
+extern void regfree(regex_t *preg);
+
+enum {
+ REG_BADBR = 1,
+ REG_BADPAT,
+ REG_BADRPT,
+};
+
+
+#endif
+
+
--- /dev/null
+/*
+ * Acess2 POSIX Emulation Library
+ * - By John Hodge (thePowersGang)
+ *
+ * strings.h
+ * - BSD's verison of string.h
+ */
+#ifndef _LIBPOSIX_STRINGS_H_
+#define _LIBPOSIX_STRINGS_H_
+
+
+
+#endif
+
extern int unlink(const char *pathname);
+#define F_OK 00
+#define R_OK 04
+#define W_OK 02
+#define X_OK 01
extern int access(const char *pathname, int mode);
extern pid_t setsid(void);
extern char *crypt(const char *key, const char *salt);
// - pty.c
+extern int isatty(int fd);
extern char *ttyname(int fd);
extern int ttyname_r(int fd, char *buf, size_t buflen);
return ENOTIMPL;
}
+
+int isatty(int fd)
+{
+ if( fd < 0 ) {
+ errno = EBADF;
+ return 0;
+ }
+
+ int type = _SysIOCtl(fd, DRV_IOCTL_TYPE, NULL);
+ if( type == -1 )
+ return 0;
+ if( type != DRV_TYPE_TERMINAL ) {
+ errno = ENOTTY;
+ // NOTE: Pre POSIX 2001, EINVAL was returned
+ return 0;
+ }
+ return 1;
+}