The ctermid function has variants named _ctermid32 and _ctermid64 for use with 32-bit and 64-bit pointer sizes, respectively.