diff --git a/include/stdio.h b/include/stdio.h --- a/include/stdio.h +++ b/include/stdio.h @@ -66,10 +66,12 @@ #endif #endif +#if __LFS_VISIBLE #ifndef _OFF64_T_DECLARED #define _OFF64_T_DECLARED typedef __off64_t off64_t; #endif +#endif #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE #ifndef _VA_LIST_DECLARED @@ -418,7 +420,7 @@ #if __BSD_VISIBLE typedef __ssize_t cookie_read_function_t(void *, char *, size_t); typedef __ssize_t cookie_write_function_t(void *, const char *, size_t); -typedef int cookie_seek_function_t(void *, off64_t *, int); +typedef int cookie_seek_function_t(void *, __off64_t *, int); typedef int cookie_close_function_t(void *); typedef struct { cookie_read_function_t *read; diff --git a/lib/libc/stdio/fopencookie.c b/lib/libc/stdio/fopencookie.c --- a/lib/libc/stdio/fopencookie.c +++ b/lib/libc/stdio/fopencookie.c @@ -115,7 +115,7 @@ _fopencookie_seek(void *cookie, fpos_t offset, int whence) { struct fopencookie_thunk *thunk; - off64_t off64; + __off64_t off64; int res; switch (whence) { @@ -140,7 +140,7 @@ return (-1); } - off64 = (off64_t)offset; + off64 = (__off64_t)offset; res = thunk->foc_io.seek(thunk->foc_cookie, &off64, whence); if (res < 0) return (res); diff --git a/sys/sys/types.h b/sys/sys/types.h --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -175,10 +175,12 @@ #define _OFF_T_DECLARED #endif +#if __LFS_VISIBLE #ifndef _OFF64_T_DECLARED typedef __off64_t off64_t; /* file offset (alias) */ #define _OFF64_T_DECLARED #endif +#endif #ifndef _PID_T_DECLARED typedef __pid_t pid_t; /* process id */