OBJ = main.o unistd.o dirent.o stat.o utmpx.o termios.o\r
OBJ += pwd.o syslog.o sys_time.o sys_ioctl.o sys_resource.o\r
OBJ += fcntl.o clocks.o sys_wait.o unistd_crypt.o\r
-OBJ += grp.o pty.o mktemp.o utime.o\r
+OBJ += grp.o pty.o mktemp.o utime.o getopt.o\r
DEPFILES := $(OBJ:%.o=%.d)\r
BIN = libposix.so\r
\r
--- /dev/null
+/*
+ * Acess2 POSIX Emulation Layer
+ * - By John Hodge (thePowersGang)
+ *
+ * getopt.c
+ * - getopt() command line parsing code
+ */
+#include <getopt.h>
+
+// === GLOBALS ===
+char* optarg;
+ int opterr;
+ int optind;
+ int optopt;
+
+// === CODE ===
+int getopt(int argc, char * const argv[], const char *optstring)
+{
+ return -1;
+}
+
--- /dev/null
+/*
+ * Acess2 POSIX Emulation Layer
+ * - By John Hodge (thePowersGang)
+ *
+ * getopt.h
+ * - getopt() command line parsing code
+ */
+#ifndef _LIBPOSIX_GETOPT_H_
+#define _LIBPOSIX_GETOPT_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern char* optarg;
+extern int opterr;
+extern int optind;
+extern int optopt;
+
+extern int getopt(int argc, char * const argv[], const char *optstring);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+