#include <sys/unix.h>
#include "error.h"

extern int ERRNO;

char	*msg[] =
{
	"NOERROR - This is not an error",
	"EPERM - Permission violation",
	"ENOENT - No entry in filesystem",
	"ESRCH - Unused error",
	"EINTR - Interrupted system call",
	"EIO - Input/Output",
	"ENXIO - Bad device number",
	"E2BIG - Environment strings too big",
	"ENOEXEC - File is not executable",
	"EBADF - Bad file handle",
	"ECHILD - Wait() with no children",
	"EAGAIN - Process table full",
	"ENOMEM - No memory available",
	"EACCES - No access",
	"EFAULT - Memory fault",
	"ENOTBLK - Not a block device",
	"EBUSY - Device busy",
	"EEXIST - File already exists",
	"EXDEV - Device parent or somesuch",
	"ENODEV - Unrecognised file type",
	"ENOTDIR - Not a directory",
	"EISDIR - Is a directory",
	"EINVAL - Invalid paramater to system call",
	"ENFILE - Can't allocate inode or file table entry",
	"EMFILE - Unused error",
	"ENOTTY - File handle is not a device",
	"ETXTBSY - Unused error",
	"EFBIG - Unused error",
	"ENOSPC - No space on device or corruption",
	"ESPIPE - Seek on pipe",
	"EROFS - Unused error",
	"EMLINK - Unused error",
	"EPIPE - Write to broken pipe",
	"ENAMETOOLONG - Unused error"
};


main( argc, argv )
int	argc;
char	*argv[];
{
	int	i, num;
	
	for(i=1;i<argc;i++)
	{
		num = atoi(argv[i]);
		if( num==63 )
			num = 33;
		if( num <= 33 )
			fprintf( stdout, "%i: %s\n", num, msg[num] );
	}
	
	return( 0 );
}

