diff --git a/fs/stat.c b/fs/stat.c index 6508e458121615b0f4145610c3732e93f2c8fa35..8e8dda7a244c8fdf1c8e52831f4a50068deff1d3 100644 --- a/fs/stat.c +++ b/fs/stat.c @@ -29,6 +29,15 @@ static void cp_stat(struct m_inode * inode, struct stat * statbuf) { } } +int sys_stat(char * filename, struct stat * statbuf) { + struct m_inode * inode; + if (!(inode=namei(filename))) + return -ENOENT; + cp_stat(inode,statbuf); + iput(inode); + return 0; +} + int sys_fstat(unsigned int fd, struct stat * statbuf) { struct file * f; struct m_inode * inode; diff --git a/include/linux/sys.h b/include/linux/sys.h index e37c65227a72a32f1923a09d8d0bb2ca387b9ddd..8c92ab3e1792a060b3d760c7bcf7766d945e72d9 100644 --- a/include/linux/sys.h +++ b/include/linux/sys.h @@ -16,7 +16,7 @@ extern int sys_time(); extern int sys_chmod(); extern int sys_chown(); extern int sys_break(); -//extern int sys_stat(); +extern int sys_stat(); extern int sys_lseek(); extern int sys_getpid(); //extern int sys_mount(); @@ -107,7 +107,7 @@ fn_ptr sys_call_table[] = { sys_chown, sys_break, - 0, //sys_stat, + sys_stat, sys_lseek, sys_getpid, 0, //sys_mount,