Last change
on this file was 444, checked in by coas-nagasima, 4 years ago |
muslのソースコードを追加
|
-
Property svn:eol-style
set to
native
-
Property svn:mime-type
set to
text/x-csrc;charset=UTF-8
|
File size:
527 bytes
|
Line | |
---|
1 | #include <dirent.h>
|
---|
2 | #include <errno.h>
|
---|
3 | #include <string.h>
|
---|
4 | #include "__dirent.h"
|
---|
5 | #include "libc.h"
|
---|
6 |
|
---|
7 | int readdir_r(DIR *restrict dir, struct dirent *restrict buf, struct dirent **restrict result)
|
---|
8 | {
|
---|
9 | struct dirent *de;
|
---|
10 | int errno_save = errno;
|
---|
11 | int ret;
|
---|
12 |
|
---|
13 | LOCK(dir->lock);
|
---|
14 | errno = 0;
|
---|
15 | de = readdir(dir);
|
---|
16 | if ((ret = errno)) {
|
---|
17 | UNLOCK(dir->lock);
|
---|
18 | return ret;
|
---|
19 | }
|
---|
20 | errno = errno_save;
|
---|
21 | if (de) memcpy(buf, de, de->d_reclen);
|
---|
22 | else buf = NULL;
|
---|
23 |
|
---|
24 | UNLOCK(dir->lock);
|
---|
25 | *result = buf;
|
---|
26 | return 0;
|
---|
27 | }
|
---|
28 |
|
---|
29 | LFS64_2(readdir_r, readdir64_r);
|
---|
Note:
See
TracBrowser
for help on using the repository browser.