Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105420
b: refs/heads/master
c: 4006553
h: refs/heads/master
v: v3
  • Loading branch information
Ulrich Drepper authored and Linus Torvalds committed Jul 24, 2008
1 parent bd6cd19 commit 31d6fa4
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ed8cae8ba01348bfd83333f4648dd807b04d7f08
refs/heads/master: 4006553b06306b34054529477b06b68a1c66249b
1 change: 1 addition & 0 deletions trunk/arch/x86/ia32/ia32entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -831,4 +831,5 @@ ia32_sys_call_table:
.quad sys_epoll_create2
.quad sys_dup3 /* 330 */
.quad sys_pipe2
.quad sys_inotify_init1
ia32_syscall_end:
1 change: 1 addition & 0 deletions trunk/arch/x86/kernel/syscall_table_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -331,3 +331,4 @@ ENTRY(sys_call_table)
.long sys_epoll_create2
.long sys_dup3 /* 330 */
.long sys_pipe2
.long sys_inotify_init1
12 changes: 10 additions & 2 deletions trunk/fs/inotify_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,15 +566,18 @@ static const struct inotify_operations inotify_user_ops = {
.destroy_watch = free_inotify_user_watch,
};

asmlinkage long sys_inotify_init(void)
asmlinkage long sys_inotify_init1(int flags)
{
struct inotify_device *dev;
struct inotify_handle *ih;
struct user_struct *user;
struct file *filp;
int fd, ret;

fd = get_unused_fd();
if (flags & ~IN_CLOEXEC)
return -EINVAL;

fd = get_unused_fd_flags(flags & O_CLOEXEC);
if (fd < 0)
return fd;

Expand Down Expand Up @@ -638,6 +641,11 @@ asmlinkage long sys_inotify_init(void)
return ret;
}

asmlinkage long sys_inotify_init(void)
{
return sys_inotify_init1(0);
}

asmlinkage long sys_inotify_add_watch(int fd, const char __user *path, u32 mask)
{
struct inode *inode;
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-x86/unistd_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@
#define __NR_epoll_create2 329
#define __NR_dup3 330
#define __NR_pipe2 331
#define __NR_inotify_init1 332

#ifdef __KERNEL__

Expand Down
2 changes: 2 additions & 0 deletions trunk/include/asm-x86/unistd_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,8 @@ __SYSCALL(__NR_epoll_create2, sys_epoll_create2)
__SYSCALL(__NR_dup3, sys_dup3)
#define __NR_pipe2 293
__SYSCALL(__NR_pipe2, sys_pipe2)
#define __NR_inotify_init1 294
__SYSCALL(__NR_inotify_init1, sys_inotify_init1)


#ifndef __NO_STUBS
Expand Down
5 changes: 5 additions & 0 deletions trunk/include/linux/inotify.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#ifndef _LINUX_INOTIFY_H
#define _LINUX_INOTIFY_H

/* For O_CLOEXEC */
#include <linux/fcntl.h>
#include <linux/types.h>

/*
Expand Down Expand Up @@ -63,6 +65,9 @@ struct inotify_event {
IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | \
IN_MOVE_SELF)

/* Flags for sys_inotify_init1. */
#define IN_CLOEXEC O_CLOEXEC

#ifdef __KERNEL__

#include <linux/dcache.h>
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/syscalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ asmlinkage long sys_get_mempolicy(int __user *policy,
unsigned long addr, unsigned long flags);

asmlinkage long sys_inotify_init(void);
asmlinkage long sys_inotify_init1(int flags);
asmlinkage long sys_inotify_add_watch(int fd, const char __user *path,
u32 mask);
asmlinkage long sys_inotify_rm_watch(int fd, u32 wd);
Expand Down
1 change: 1 addition & 0 deletions trunk/kernel/sys_ni.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ cond_syscall(sys_keyctl);
cond_syscall(compat_sys_keyctl);
cond_syscall(compat_sys_socketcall);
cond_syscall(sys_inotify_init);
cond_syscall(sys_inotify_init1);
cond_syscall(sys_inotify_add_watch);
cond_syscall(sys_inotify_rm_watch);
cond_syscall(sys_migrate_pages);
Expand Down

0 comments on commit 31d6fa4

Please sign in to comment.