Commit 7c992e1c authored by Anton Blanchard's avatar Anton Blanchard

ppc64: Dont force O_LARGEFILE on for 32 bit apps. From sparc64

parent 63cafcea
......@@ -113,10 +113,6 @@ _GLOBAL(DoSyscall)
clrldi r4,r4,32
clrldi r5,r5,32
clrldi r6,r6,32
#if 0 /* XXX Why not ??? - Anton */
clrldi r7,r7,32
clrldi r8,r8,32
#endif
b 17f
15:
#endif
......@@ -187,10 +183,6 @@ _GLOBAL(ret_from_syscall_1)
clrldi r4,r4,32
clrldi r5,r5,32
clrldi r6,r6,32
#if 0 /* XXX Why not ??? - Anton */
clrldi r7,r7,32
clrldi r8,r8,32
#endif
b 57f
55:
#endif
......
......@@ -3877,19 +3877,36 @@ asmlinkage long sys32_nice(u32 increment)
return sys_nice((int)increment);
}
extern asmlinkage long sys_open(const char * filename, int flags, int mode);
/* Note: it is necessary to treat flags and mode as unsigned ints,
* with the corresponding cast to a signed int to insure that the
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
* and the register representation of a signed int (msr in 64-bit mode) is performed.
/*
* This is just a version for 32-bit applications which does
* not force O_LARGEFILE on.
*/
asmlinkage long sys32_open(const char * filename, int flags, int mode)
{
return sys_open(filename, (int)flags, (int)mode);
}
long sys32_open(const char * filename, int flags, int mode)
{
char * tmp;
int fd, error;
tmp = getname(filename);
fd = PTR_ERR(tmp);
if (!IS_ERR(tmp)) {
fd = get_unused_fd();
if (fd >= 0) {
struct file * f = filp_open(tmp, flags, mode);
error = PTR_ERR(f);
if (IS_ERR(f))
goto out_error;
fd_install(fd, f);
}
out:
putname(tmp);
}
return fd;
out_error:
put_unused_fd(fd);
fd = error;
goto out;
}
extern asmlinkage long sys_readlink(const char * path, char * buf, int bufsiz);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment