repo.or.cz
/
musl.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
remove unused __brk function/source file
[musl.git]
/
src
/
internal
/
procfdname.c
blob
697e0bdc2e1f6a2ae212f70a5915b99cc35d1dfd
1
void
__procfdname
(
char
*
buf
,
unsigned
fd
)
2
{
3
unsigned
i
,
j
;
4
for
(
i
=
0
; (
buf
[
i
] =
"/proc/self/fd/"
[
i
]);
i
++);
5
if
(!
fd
) {
6
buf
[
i
] =
'0'
;
7
buf
[
i
+
1
] =
0
;
8
return
;
9
}
10
for
(
j
=
fd
;
j
;
j
/=
10
,
i
++);
11
buf
[
i
] =
0
;
12
for
(;
fd
;
fd
/=
10
)
buf
[--
i
] =
'0'
+
fd
%
10
;
13
}