diff options
author | Scott Lobdell <slobdell@google.com> | 2019-08-25 12:20:54 -0700 |
---|---|---|
committer | Scott Lobdell <slobdell@google.com> | 2019-08-25 12:20:54 -0700 |
commit | 4f9bfdcaca2414c8959986f0a4d73f16cb15e1c4 (patch) | |
tree | 540bab5498d276cbbfad24c48a7ff989ee8b920a /libc/include/stdio.h | |
parent | bfda022dd6fbbcea60e9f52496d90ece514b32da (diff) | |
parent | f77cc9b224c35fa7d1d71e7c374ef19e47b5f6a5 (diff) |
Merge RP1A.190822.001
Change-Id: Iaf90835a99d87f6246798efd2cea6fe9f750ea18
Diffstat (limited to 'libc/include/stdio.h')
-rw-r--r-- | libc/include/stdio.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/libc/include/stdio.h b/libc/include/stdio.h index 8bd690fec..6632c0170 100644 --- a/libc/include/stdio.h +++ b/libc/include/stdio.h @@ -165,9 +165,53 @@ char* tmpnam(char* __s) char* tempnam(const char* __dir, const char* __prefix) __warnattr("tempnam is unsafe, use mkstemp or tmpfile instead"); +/** + * [rename(2)](http://man7.org/linux/man-pages/man2/rename.2.html) changes + * the name or location of a file. + * + * Returns 0 on success, and returns -1 and sets `errno` on failure. + */ int rename(const char* __old_path, const char* __new_path); + +/** + * [renameat(2)](http://man7.org/linux/man-pages/man2/renameat.2.html) changes + * the name or location of a file, interpreting relative paths using an fd. + * + * Returns 0 on success, and returns -1 and sets `errno` on failure. + */ int renameat(int __old_dir_fd, const char* __old_path, int __new_dir_fd, const char* __new_path); +#if defined(__USE_GNU) + +/** + * Flag for [renameat2(2)](http://man7.org/linux/man-pages/man2/renameat2.2.html) + * to fail if the new path already exists. + */ +#define RENAME_NOREPLACE (1<<0) + +/** + * Flag for [renameat2(2)](http://man7.org/linux/man-pages/man2/renameat2.2.html) + * to atomically exchange the two paths. + */ +#define RENAME_EXCHANGE (1<<1) + +/** + * Flag for [renameat2(2)](http://man7.org/linux/man-pages/man2/renameat2.2.html) + * to create a union/overlay filesystem object. + */ +#define RENAME_WHITEOUT (1<<2) + +/** + * [renameat2(2)](http://man7.org/linux/man-pages/man2/renameat2.2.html) changes + * the name or location of a file, interpreting relative paths using an fd, + * with optional `RENAME_` flags. + * + * Returns 0 on success, and returns -1 and sets `errno` on failure. + */ +int renameat2(int __old_dir_fd, const char* __old_path, int __new_dir_fd, const char* __new_path, unsigned __flags) __INTRODUCED_IN(30); + +#endif + int fseek(FILE* __fp, long __offset, int __whence); long ftell(FILE* __fp); |