diff options
Diffstat (limited to 'newlib/libc/include/sys')
-rw-r--r-- | newlib/libc/include/sys/_default_fcntl.h | 27 | ||||
-rw-r--r-- | newlib/libc/include/sys/cdefs.h | 2 | ||||
-rw-r--r-- | newlib/libc/include/sys/config.h | 7 | ||||
-rw-r--r-- | newlib/libc/include/sys/reent.h | 3 | ||||
-rw-r--r-- | newlib/libc/include/sys/stat.h | 17 | ||||
-rw-r--r-- | newlib/libc/include/sys/unistd.h | 2 |
6 files changed, 42 insertions, 16 deletions
diff --git a/newlib/libc/include/sys/_default_fcntl.h b/newlib/libc/include/sys/_default_fcntl.h index 148e97d..b3222d4 100644 --- a/newlib/libc/include/sys/_default_fcntl.h +++ b/newlib/libc/include/sys/_default_fcntl.h @@ -53,8 +53,8 @@ extern "C" { #define O_TRUNC _FTRUNC #define O_EXCL _FEXCL #define O_SYNC _FSYNC -/* O_NDELAY _FNDELAY set in include/fcntl.h */ -/* O_NDELAY _FNBIO set in include/fcntl.h */ +/* O_NDELAY _FNDELAY set in include/fcntl.h */ +/* O_NDELAY _FNBIO set in include/fcntl.h */ #define O_NONBLOCK _FNONBLOCK #define O_NOCTTY _FNOCTTY @@ -134,21 +134,26 @@ extern "C" { #define F_GETFL 3 /* Get file flags */ #define F_SETFL 4 /* Set file flags */ #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 -#define F_GETOWN 5 /* Get owner - for ASYNC */ -#define F_SETOWN 6 /* Set owner - for ASYNC */ +#define F_GETOWN 5 /* Get owner - for ASYNC */ +#define F_SETOWN 6 /* Set owner - for ASYNC */ #endif /* __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 */ -#define F_GETLK 7 /* Get record-locking information */ -#define F_SETLK 8 /* Set or Clear a record-lock (Non-Blocking) */ -#define F_SETLKW 9 /* Set or Clear a record-lock (Blocking) */ +#define F_GETLK 7 /* Get record-locking information */ +#define F_SETLK 8 /* Set or Clear a record-lock (Non-Blocking) */ +#define F_SETLKW 9 /* Set or Clear a record-lock (Blocking) */ #if __MISC_VISIBLE -#define F_RGETLK 10 /* Test a remote lock to see if it is blocked */ -#define F_RSETLK 11 /* Set or unlock a remote lock */ -#define F_CNVT 12 /* Convert a fhandle to an open fd */ -#define F_RSETLKW 13 /* Set or Clear remote record-lock(Blocking) */ +#define F_RGETLK 10 /* Test a remote lock to see if it is blocked */ +#define F_RSETLK 11 /* Set or unlock a remote lock */ +#define F_CNVT 12 /* Convert a fhandle to an open fd */ +#define F_RSETLKW 13 /* Set or Clear remote record-lock (Blocking) */ #endif /* __MISC_VISIBLE */ #if __POSIX_VISIBLE >= 200809 #define F_DUPFD_CLOEXEC 14 /* As F_DUPFD, but set close-on-exec flag */ #endif +#if __GNU_VISIBLE || __POSIX_VISIBLE >= 202405 +#define F_OFD_GETLK 15 /* Get OFD record-locking information */ +#define F_OFD_SETLK 16 /* Set or Clear OFD lock (Non-Blocking) */ +#define F_OFD_SETLKW 17 /* Set or Clear OFD lock (Blocking) */ +#endif /* fcntl(2) flags (l_type field of flock structure) */ #define F_RDLCK 1 /* read lock */ diff --git a/newlib/libc/include/sys/cdefs.h b/newlib/libc/include/sys/cdefs.h index d13a92a..20b3553 100644 --- a/newlib/libc/include/sys/cdefs.h +++ b/newlib/libc/include/sys/cdefs.h @@ -736,7 +736,7 @@ /* Provide fallback versions for other compilers (GCC/Clang < 10): */ #if !__has_builtin(__builtin_is_aligned) #define __builtin_is_aligned(x, align) \ - (((__uintptr_t)x & ((align) - 1)) == 0) + (((__uintptr_t)(x) & ((align) - 1)) == 0) #endif #if !__has_builtin(__builtin_align_up) #define __builtin_align_up(x, align) \ diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h index 5dcc77a..c3cd51e 100644 --- a/newlib/libc/include/sys/config.h +++ b/newlib/libc/include/sys/config.h @@ -4,7 +4,7 @@ #include <machine/ieeefp.h> /* floating point macros */ #include <sys/features.h> /* POSIX defs */ -#ifdef __aarch64__ +#if defined(__aarch64__) || defined(__mips__) #define MALLOC_ALIGNMENT 16 #endif @@ -12,6 +12,11 @@ #define __DYNAMIC_REENT__ #endif +#ifdef __nvptx__ +#define _READ_WRITE_RETURN_TYPE _ssize_t +#define _READ_WRITE_BUFSIZE_TYPE __size_t +#endif + /* exceptions first */ #if defined(__H8500__) || defined(__W65__) #define __SMALL_BITFIELDS diff --git a/newlib/libc/include/sys/reent.h b/newlib/libc/include/sys/reent.h index 5ce5387..eafac96 100644 --- a/newlib/libc/include/sys/reent.h +++ b/newlib/libc/include/sys/reent.h @@ -709,7 +709,8 @@ struct _reent {0, {0}}, \ {0, {0}}, \ {0, {0}}, \ - {0, {0}} \ + {0, {0}}, \ + 0 \ } \ }, \ _REENT_INIT_RESERVED_6_7 \ diff --git a/newlib/libc/include/sys/stat.h b/newlib/libc/include/sys/stat.h index b4e27f2..7409979 100644 --- a/newlib/libc/include/sys/stat.h +++ b/newlib/libc/include/sys/stat.h @@ -38,6 +38,16 @@ struct stat time_t st_atime; time_t st_mtime; time_t st_ctime; +#elif defined(__mips__) && !defined(__rtems__) + time_t st_atime; + long st_spare1; + time_t st_mtime; + long st_spare2; + time_t st_ctime; + long st_spare3; + blksize_t st_blksize; + blkcnt_t st_blocks; + long st_spare4[2]; #else struct timespec st_atim; struct timespec st_mtim; @@ -50,7 +60,8 @@ struct stat #endif }; -#if !(defined(__svr4__) && !defined(__PPC__) && !defined(__sun__)) +#if !((defined(__svr4__) && !defined(__PPC__) && !defined(__sun__)) || \ + (defined(__mips__) && !defined(__rtems__))) #define st_atime st_atim.tv_sec #define st_ctime st_ctim.tv_sec #define st_mtime st_mtim.tv_sec @@ -136,7 +147,11 @@ struct stat int chmod (const char *__path, mode_t __mode ); int fchmod (int __fd, mode_t __mode); +#if defined(__mips__) && defined(__mips16) +int __attribute__((nomips16)) fstat (int __fd, struct stat *__sbuf ); +#else int fstat (int __fd, struct stat *__sbuf ); +#endif // __mips__ int mkdir (const char *_path, mode_t __mode ); int mkfifo (const char *__path, mode_t __mode ); int stat (const char *__restrict __path, struct stat *__restrict __sbuf ); diff --git a/newlib/libc/include/sys/unistd.h b/newlib/libc/include/sys/unistd.h index 771a4bd..4cf9f06 100644 --- a/newlib/libc/include/sys/unistd.h +++ b/newlib/libc/include/sys/unistd.h @@ -215,7 +215,7 @@ int setpgrp (void); #if defined(__CYGWIN__) && __BSD_VISIBLE /* Stub for Linux libbsd compatibility. */ #define initsetproctitle(c, a, e) setproctitle_init((c), (a), (e)) -static inline void setproctitle_init (int _c, char *_a[], char *_e[]) {} +static __inline void setproctitle_init (int _c, char *_a[], char *_e[]) {} void setproctitle (const char *, ...) _ATTRIBUTE ((__format__ (__printf__, 1, 2))); |