Do sys open
Retired DISLab
975 long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode) 976 { 977 struct open_flags op; 978 int fd = build_open_flags(flags, mode, &op); 979 struct filename *tmp; 980 981 if (fd) 982 return fd; 983 984 tmp = getname(filename); 985 if (IS_ERR(tmp)) 986 return PTR_ERR(tmp); 987 988 fd = get_unused_fd_flags(flags); 989 if (fd >= 0) { 990 struct file *f = do_filp_open(dfd, tmp, &op); 991 if (IS_ERR(f)) { 992 put_unused_fd(fd); 993 fd = PTR_ERR(f); 994 } else { 995 fsnotify_open(f); 996 fd_install(fd, f); 997 } 998 } 999 putname(tmp); 1000 return fd; 1001 }