It is invalid to attempt to remove the "." or ".." entries in a directory. What rmdir actually removes is a name in some (other) directory; removing the "." or ".." names would make a mess. It is not invalid for a process to remove its own current directory, but it does not work to do so by calling rmdir(".").
It is impossible in any event to remove a directory named with "..", because it is impossible to name a directory with ".." unless it is not empty.
You must decide what happens if an attempt is made to remove a directory that is presently in use (e.g., is being read by ls, or is some process's current directory, etc.)
The removal must be atomic.
Attempts to remove ".." may generate either EINVAL or ENOTEMPTY.
ENODEV The device prefix of filename did not exist. ENOTDIR A non-final component of pathname was not a directory. ENOTDIR pathname referred to an object that was not a directory. ENOENT The target directory did not exist. EINVAL An attempt was made to remove "." ENOTEMPTY The target directory was not empty. EIO A hard I/O error occurred. EFAULT pathname was an invalid pointer.