mailing list of musl libc
 help / color / mirror / code / Atom feed
0dd5725138bb34cedc41ab349a059a843c02c3af blob 410 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
 
#include <string.h>
#include <time.h>
#include <stdint.h>

/* This assumes that a check for the
   template size has alrady been made */
char *__randname(char *template)
{
	int i;
	struct timespec ts;
	unsigned long r;

	clock_gettime(CLOCK_REALTIME, &ts);
	r = ts.tv_nsec*65537 ^ (uintptr_t)&ts / 16 + (uintptr_t)template;
	for (i=0; i<6; i++, r>>=5)
		template[i] = 'A'+(r&15)+(r&16)*2;

	return template;
}
debug log:

solving 0dd5725 ...
found 0dd5725 in https://inbox.vuxu.org/musl/1359839705-25965-1-git-send-email-basile@opensource.dyc.edu/

applying [1/1] https://inbox.vuxu.org/musl/1359839705-25965-1-git-send-email-basile@opensource.dyc.edu/
diff --git a/src/temp/__randname.c b/src/temp/__randname.c
new file mode 100644
index 0000000..0dd5725

Checking patch src/temp/__randname.c...
Applied patch src/temp/__randname.c cleanly.

index at:
100644 0dd5725138bb34cedc41ab349a059a843c02c3af	src/temp/__randname.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).