Gitiles
Code Review
Sign In
gerrit-public.fairphone.software
/
platform
/
external
/
musl
/
6651ef1f060738ee1f50cac1fe6d8ce64c359022
/
.
/
src
/
internal
/
procfdname.c
blob: 697e0bdc2e1f6a2ae212f70a5915b99cc35d1dfd [
file
] [
log
] [
blame
]
void
__procfdname
(
char
*
buf
,
unsigned
fd
)
{
unsigned
i
,
j
;
for
(
i
=
0
;
(
buf
[
i
]
=
"/proc/self/fd/"
[
i
]);
i
++);
if
(!
fd
)
{
buf
[
i
]
=
'0'
;
buf
[
i
+
1
]
=
0
;
return
;
}
for
(
j
=
fd
;
j
;
j
/=
10
,
i
++);
buf
[
i
]
=
0
;
for
(;
fd
;
fd
/=
10
)
buf
[--
i
]
=
'0'
+
fd
%
10
;
}