If you mean having the drive mark the sector as bad so that it uses a spare sector instead, that's controlled entirely by the drive's firmware. If a sector is marked "pending" in the SMART data, simply writing new data to it should cause the drive to remap it to a spare sector.