am 7ffead69: am 16fc5540: am 57d7c468: Merge "Fix flags to *_PORTABLE in open_portable(), and support openat_portable()."
* commit '7ffead69aa04c9c315559d19c6d278aa9270282c': Fix flags to *_PORTABLE in open_portable(), and support openat_portable().
This commit is contained in:
@@ -63,9 +63,9 @@ extern int __open(const char*, int, int);
|
|||||||
int open_portable(const char *pathname, int flags, ...)
|
int open_portable(const char *pathname, int flags, ...)
|
||||||
{
|
{
|
||||||
mode_t mode = 0;
|
mode_t mode = 0;
|
||||||
flags |= O_LARGEFILE;
|
flags |= O_LARGEFILE_PORTABLE;
|
||||||
|
|
||||||
if (flags & O_CREAT)
|
if (flags & O_CREAT_PORTABLE)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
@@ -76,3 +76,22 @@ int open_portable(const char *pathname, int flags, ...)
|
|||||||
|
|
||||||
return __open(pathname, mips_change_flags(flags), mode);
|
return __open(pathname, mips_change_flags(flags), mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern int __openat(int, const char*, int, int);
|
||||||
|
int openat_portable(int fd, const char *pathname, int flags, ...)
|
||||||
|
{
|
||||||
|
mode_t mode = 0;
|
||||||
|
|
||||||
|
flags |= O_LARGEFILE_PORTABLE;
|
||||||
|
|
||||||
|
if (flags & O_CREAT_PORTABLE)
|
||||||
|
{
|
||||||
|
va_list args;
|
||||||
|
|
||||||
|
va_start(args, flags);
|
||||||
|
mode = (mode_t) va_arg(args, int);
|
||||||
|
va_end(args);
|
||||||
|
}
|
||||||
|
|
||||||
|
return __openat(fd, pathname, mips_change_flags(flags), mode);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user