Skip to content

lib: libc: minimal: Define off_t as intptr_t #47612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 2 additions & 21 deletions lib/libc/minimal/include/sys/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,8 @@ typedef __SIZE_TYPE__ ssize_t;

#if !defined(__off_t_defined)
#define __off_t_defined

#if defined(__i386) || defined(__x86_64) || defined(__ARC64__)
typedef long int off_t; /* "long" works for all of i386, X32 and true 64 bit */
#elif defined(__ARM_ARCH)
typedef int off_t;
#elif defined(__arc__)
typedef int off_t;
#elif defined(__NIOS2__)
typedef int off_t;
#elif defined(__riscv)
typedef int off_t;
#elif defined(__XTENSA__)
typedef int off_t;
#elif defined(__sparc__)
typedef int off_t;
#elif defined(__mips)
typedef int off_t;
#else
#error "The minimal libc library does not recognize the architecture!\n"
#endif

/* off_t is defined such that it matches the size of a pointer */
typedef __INTPTR_TYPE__ off_t;
#endif

#if !defined(__time_t_defined)
Expand Down