procfdname.c\internal\src - musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/internal/procfdname.c
blob: fd7306ab69a821746cfa58a376c7344bea6a8c39 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "syscall.h"
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;
}
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月10日 06:01:04 +0000

AltStyle によって変換されたページ (->オリジナル) /