projects
/
oweals
/
musl.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
implement hcreate_r, hdestroy_r and hsearch_r
[oweals/musl.git]
/
src
/
internal
/
procfdname.c
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
}