#include <stdio.h>

/* must define errno and _dos_errno in the low-level code */

extern int errno;

char *_sys_errlist[] ={
	"Error 0",
	"Invalid function number",
	"File not found",
	"Path not found",
	"Memory blocks destroyed",
	"Invalid memory block address",
	"Invalid environment",
	"Invalid format",
	"Invalid access code",
	"Invalid data",
	"Invalid drive specified",
	"Attempt to remove CurDir",
	"Not same device",
	"No more files",
	"No such file or director",
	"Too many open files",
	"Permission denied",
	"Bad file number",
	"Not enough core",
	"Unknown error",
	"No such device",
	"Invalid argument",
	"Arg list too long",
	"Exec format error",
	"Cross-device link",
	"Too many open files",
	"No child process",
	"UNIX - not MSDOS",
	"UNIX - not MSDOS",
	"UNIX - not MSDOS",
	"No space left on device",
	"Illegal seek",
	"Read-only file system",
	"UNIX - not MSDOS",
	"Broken pipe",
	"Math argument",
	"Result too large",
	"File already exists",
	"Locking violation",
	"Operation not permitted",
	"UNIX - not MSDOS",
	"Interrupted function call",
	"Input/output error",
	"No such device or address",
	"Resource temporarily unavailable",
	"UNIX - not MSDOS",
	"Resource busy",
	"UNIX - not MSDOS",
	"UNIX - not MSDOS",
	"UNIX - not MSDOS",
	"Filename too long"
};

void perror(const char *string)
{
	fprintf(stderr,"%s: %s\n",string,_sys_errlist[errno]);
}