Copy a file descriptor. Flags are passed atomically. flags being None copies the flags from oldfd. Panics if newfd doesn't exist and allow_nonexistent isn't set; this can help debug the race of another thread creating newfd and having it deleted from under it by us.

Move a file descriptor. Flags are passed atomically. flags being None copies the flags from oldfd. Panics if newfd doesn't exist and allow_nonexistent isn't set; this can help debug the race of another thread creating newfd and having it deleted from under it by us.