Where to find the complete definition of off_t type?

后端 未结 4 696
猫巷女王i
猫巷女王i 2020-11-30 20:40

I am sending file from client to server using TCP. To mark the end of the file I like to send file size before the actual data. So I use stat system call to fin

4条回答
  •  旧时难觅i
    2020-11-30 21:06

    If you are writing portable code, the answer is "you can't tell", the good news is that you don't need to. Your protocol should involve writing the size as (eg) "8 octets, big-endian format" (Ideally with a check that the actual size fits in 8 octets.)

提交回复
热议问题