shithub: ext4srv

ref: d81e6dbca628a7a568aa662d442f49fe00ca6955
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 "???";
}