update copy function on posix
merge updated copy routine