SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, umode_t, mode) { if (force_o_largefile()) flags |= O_LARGEFILE; return do_sys_open(AT_FDCWD, filename, flags, mode); }
//Alternatives... int __mod_open_fd(const char* filename, int flags, int mode) { int fd; mm_segment_t old_fs = get_fs(); set_fs(KERNEL_DS); // fd = do_sys_open(AT_FDCWD, filename, flags, mode); // set_fs(old_fs); return fd; }
SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, umode_t, mode) { long ret; if (force_o_largefile()) flags |= O_LARGEFILE; ret = do_sys_open(AT_FDCWD, filename, flags, mode); /* avoid REGPARM breakage on x86: */ asmlinkage_protect(3, ret, filename, flags, mode); return ret; }
asmlinkage long sys_open(const char __user *filename, int flags, int mode) { long ret; if (force_o_largefile()) flags |= O_LARGEFILE; ret = do_sys_open(AT_FDCWD, filename, flags, mode); /* avoid REGPARM breakage on x86: */ prevent_tail_call(ret); return ret; }
asmlinkage long sys_openat(int dfd, const char __user *filename, int flags, int mode) { long ret; if (force_o_largefile()) flags |= O_LARGEFILE; ret = do_sys_open(dfd, filename, flags, mode); /* avoid REGPARM breakage on x86: */ asmlinkage_protect(4, ret, dfd, filename, flags, mode); return ret; }
SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags, umode_t, mode) { long ret; if (force_o_largefile()) flags |= O_LARGEFILE; ret = do_sys_open(dfd, filename, flags, mode); asmlinkage_protect(4, ret, dfd, filename, flags, mode); return ret; }
asmlinkage long sparc32_open(const char __user *filename, int flags, int mode) { return do_sys_open(AT_FDCWD, filename, flags, mode); }
/* * Exactly like sys_openat(), except that it doesn't set the * O_LARGEFILE flag. */ COMPAT_SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags, umode_t, mode) { return do_sys_open(dfd, filename, flags, mode); }
/* * Exactly like sys_open(), except that it doesn't set the * O_LARGEFILE flag. */ COMPAT_SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, umode_t, mode) { return do_sys_open(AT_FDCWD, filename, flags, mode); }