Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
c07ac043
Commit
c07ac043
authored
Feb 26, 2004
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add d_type information to legacy readdir system call
parent
b3f4d558
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
fs/readdir.c
fs/readdir.c
+3
-1
No files found.
fs/readdir.c
View file @
c07ac043
...
@@ -139,7 +139,7 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
...
@@ -139,7 +139,7 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
{
{
struct
linux_dirent
__user
*
dirent
;
struct
linux_dirent
__user
*
dirent
;
struct
getdents_callback
*
buf
=
(
struct
getdents_callback
*
)
__buf
;
struct
getdents_callback
*
buf
=
(
struct
getdents_callback
*
)
__buf
;
int
reclen
=
ROUND_UP
(
NAME_OFFSET
(
dirent
)
+
namlen
+
1
);
int
reclen
=
ROUND_UP
(
NAME_OFFSET
(
dirent
)
+
namlen
+
2
);
buf
->
error
=
-
EINVAL
;
/* only used if we fail.. */
buf
->
error
=
-
EINVAL
;
/* only used if we fail.. */
if
(
reclen
>
buf
->
count
)
if
(
reclen
>
buf
->
count
)
...
@@ -158,6 +158,8 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
...
@@ -158,6 +158,8 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
goto
efault
;
goto
efault
;
if
(
__put_user
(
0
,
dirent
->
d_name
+
namlen
))
if
(
__put_user
(
0
,
dirent
->
d_name
+
namlen
))
goto
efault
;
goto
efault
;
if
(
__put_user
(
d_type
,
(
char
*
)
dirent
+
reclen
-
1
))
goto
efault
;
buf
->
previous
=
dirent
;
buf
->
previous
=
dirent
;
dirent
=
(
void
*
)
dirent
+
reclen
;
dirent
=
(
void
*
)
dirent
+
reclen
;
buf
->
current_dir
=
dirent
;
buf
->
current_dir
=
dirent
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment