shithub: ext4srv

ref: 7a98f323b297c1e108a953bc167a024be402d58a
dir: /err.c/

View raw version
#include <ext4.h>

char *
errno2s(int err)
{
	switch(err){
	case EROFS:
	case EPERM:
	case EACCES:    return "permission denied";
	case ENOMEM:    return "out of memory";
	case ENOENT:    return "file not found";
	case EISDIR:    return "is a directory";
	case EIO:       return "i/o error";
	case ENODEV:
	case ENXIO:     return "no such device";
	case E2BIG:     return "argument list too long";
	case EFAULT:    return "bad address";
	case EEXIST:    return "file exists";
	case ENOTDIR:   return "not a directory";
	case EINVAL:    return "invalid argument";
	case EFBIG:     return "file too large";
	case ENOSPC:    return "no space left on device";
	case EMLINK:    return "too many links";
	case ERANGE:    return "math result not representable";
	case ENOTEMPTY: return "directory not empty";
	case ENODATA:   return "no data available";
	case ENOTSUP:   return "not supported";
	}

	return "???";
}