Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 20204
b: refs/heads/master
c: cff2b76
h: refs/heads/master
v: v3
  • Loading branch information
Ulrich Drepper authored and Linus Torvalds committed Feb 12, 2006
1 parent 045c792 commit 72ac0cf
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 5 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: 25bf368b3d98668c5d5f38e2201d8bca16e52680
refs/heads/master: cff2b760096d1e6feaa31948e7af4abbefe47822
2 changes: 1 addition & 1 deletion trunk/arch/i386/kernel/syscall_table.S
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ ENTRY(sys_call_table)
.long sys_mknodat
.long sys_fchownat
.long sys_futimesat
.long sys_newfstatat /* 300 */
.long sys_fstatat64 /* 300 */
.long sys_unlinkat
.long sys_renameat
.long sys_linkat
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86_64/ia32/ia32entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ ia32_sys_call_table:
.quad sys_mknodat
.quad sys_fchownat
.quad compat_sys_futimesat
.quad compat_sys_newfstatat /* 300 */
.quad sys32_fstatat /* 300 */
.quad sys_unlinkat
.quad sys_renameat
.quad sys_linkat
Expand Down
22 changes: 22 additions & 0 deletions trunk/arch/x86_64/ia32/sys_ia32.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,28 @@ sys32_fstat64(unsigned int fd, struct stat64 __user *statbuf)
return ret;
}

asmlinkage long
sys32_fstatat(unsigned int dfd, char __user *filename,
struct stat64 __user* statbuf, int flag)
{
struct kstat stat;
int error = -EINVAL;

if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0)
goto out;

if (flag & AT_SYMLINK_NOFOLLOW)
error = vfs_lstat_fd(dfd, filename, &stat);
else
error = vfs_stat_fd(dfd, filename, &stat);

if (!error)
error = cp_stat64(statbuf, &stat);

out:
return error;
}

/*
* Linux/i386 didn't use to be able to handle more than
* 4 system call parameters, so these system calls used a memory
Expand Down
22 changes: 22 additions & 0 deletions trunk/fs/stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ asmlinkage long sys_newlstat(char __user *filename, struct stat __user *statbuf)
return error;
}

#ifndef __ARCH_WANT_STAT64
asmlinkage long sys_newfstatat(int dfd, char __user *filename,
struct stat __user *statbuf, int flag)
{
Expand All @@ -281,6 +282,7 @@ asmlinkage long sys_newfstatat(int dfd, char __user *filename,
out:
return error;
}
#endif

asmlinkage long sys_newfstat(unsigned int fd, struct stat __user *statbuf)
{
Expand Down Expand Up @@ -395,6 +397,26 @@ asmlinkage long sys_fstat64(unsigned long fd, struct stat64 __user * statbuf)
return error;
}

asmlinkage long sys_fstatat64(int dfd, char __user *filename,
struct stat64 __user *statbuf, int flag)
{
struct kstat stat;
int error = -EINVAL;

if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0)
goto out;

if (flag & AT_SYMLINK_NOFOLLOW)
error = vfs_lstat_fd(dfd, filename, &stat);
else
error = vfs_stat_fd(dfd, filename, &stat);

if (!error)
error = cp_new_stat64(&stat, statbuf);

out:
return error;
}
#endif /* __ARCH_WANT_STAT64 */

void inode_add_bytes(struct inode *inode, loff_t bytes)
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/asm-i386/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@
#define __NR_mknodat 297
#define __NR_fchownat 298
#define __NR_futimesat 299
#define __NR_newfstatat 300
#define __NR_fstatat64 300
#define __NR_unlinkat 301
#define __NR_renameat 302
#define __NR_linkat 303
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/asm-x86_64/ia32_unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@
#define __NR_ia32_mknodat 297
#define __NR_ia32_fchownat 298
#define __NR_ia32_futimesat 299
#define __NR_ia32_newfstatat 300
#define __NR_ia32_fstatat64 300
#define __NR_ia32_unlinkat 301
#define __NR_ia32_renameat 302
#define __NR_ia32_linkat 303
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/syscalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,8 @@ asmlinkage long sys_openat(int dfd, const char __user *filename, int flags,
int mode);
asmlinkage long sys_newfstatat(int dfd, char __user *filename,
struct stat __user *statbuf, int flag);
asmlinkage long sys_fstatat64(int dfd, char __user *filename,
struct stat64 __user *statbuf, int flag);
asmlinkage long sys_readlinkat(int dfd, const char __user *path, char __user *buf,
int bufsiz);
asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename,
Expand Down

0 comments on commit 72ac0cf

Please sign in to comment.