What is the difference between EACCES and EPERM exactly? EPERM is described here as "not super user", but I would usually associate that with EACCES. In fact, I can't recall ever seeing an EPERM in real life.
EACCES
is almost always used when the system call was passed a path that was inaccessible by the current user.
EPERM
is used in various other situations where you need to be root to perform an action, e.g.
kill()
on a process that you don't ownlink()
on a directoryreboot()