set_mode, return same amount of data in read as in write