mailing list of musl libc
 help / color / mirror / code / Atom feed
0238fa7342d3912f3ab2b7e37415a0daed207409 blob 349 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
 
#include <unistd.h>
#include <errno.h>
#include <limits.h>
#include <string.h>
#include "syscall.h"

char *getcwd(char *buf, size_t size)
{
	char tmp[PATH_MAX];
	if (!buf) buf = tmp, size = PATH_MAX;
	else if (size == 0) {
		errno = EINVAL;
		return 0;
	}
	if (syscall(SYS_getcwd, buf, size) < 0) return 0;
	return buf == tmp ? strdup(buf) : buf;
}
debug log:

solving 0238fa7 ...
found 0238fa7 in https://inbox.vuxu.org/musl/1381126104-24579-1-git-send-email-mforney@mforney.org/
found 2e540cd in https://git.vuxu.org/mirror/musl/
preparing index
index prepared:
100644 2e540cd41daef91efd37c7656f8f9274d4447ed6	src/unistd/getcwd.c

applying [1/1] https://inbox.vuxu.org/musl/1381126104-24579-1-git-send-email-mforney@mforney.org/
diff --git a/src/unistd/getcwd.c b/src/unistd/getcwd.c
index 2e540cd..0238fa7 100644

Checking patch src/unistd/getcwd.c...
Applied patch src/unistd/getcwd.c cleanly.

index at:
100644 0238fa7342d3912f3ab2b7e37415a0daed207409	src/unistd/getcwd.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).