linux off_t类型的头文件,25 Linux下的off_t门类

25 Linux下的off_t类型

off_t类型用于指示文件的偏移量,常就是long类型,其默认为一个32位的整数,在gcc编译中会被编译为long int类型,在64位的Linux系统中则会被编译为long long int,这是一个64位的整数,其定义在unistd.h头文件中可以查看。

242 # ifndef __off_t_defined

243 #  ifndef __USE_FILE_OFFSET64

244 typedef __off_t off_t;

245 #  else

246 typedef __off64_t off_t;

247 #  endif

248 #  define __off_t_defined

249 # endif

250 # if defined __USE_LARGEFILE64 && !defined __off64_t_defined

251 typedef __off64_t off64_t;

252 #  define __off64_t_defined

253 # endif

329 /* Move FD's file position to OFFSET bytes from the

330    beginning of the file (if WHENCE is SEEK_SET),

331    the current position (if WHENCE is SEEK_CUR),

332    or the end of the file (if WHENCE is SEEK_END).

333    Return the new file position.  */

334 #ifndef __USE_FILE_OFFSET64

335 extern __off_t lseek (int __fd, __off_t __offset, int __whence) __THROW;

336 #else

337 # ifdef __REDIRECT_NTH

338 extern __off64_t __REDIRECT_NTH (lseek,

339                                  (int __fd, __off64_t __offset, int __whence),

340                                  lseek64);

341 # else

342 #  define lseek lseek64

343 # endif

344 #endif

345 #ifdef __USE_LARGEFILE64

346 extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)

347      __THROW;

348 #endif

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值