Index: uspace/lib/libc/generic/libc.c
===================================================================
--- uspace/lib/libc/generic/libc.c	(revision 81342f721696310b9531caaff48b0e5a37182a5e)
+++ uspace/lib/libc/generic/libc.c	(revision d8ef374853a3cffc0874d515566beaa840c79111)
@@ -80,4 +80,5 @@
 		__stdio_init(0, NULL);
 	} else {
+		(void) chdir(__pcb->cwd);
 		argc = __pcb->argc;
 		argv = __pcb->argv;
Index: uspace/lib/libc/generic/loader.c
===================================================================
--- uspace/lib/libc/generic/loader.c	(revision 81342f721696310b9531caaff48b0e5a37182a5e)
+++ uspace/lib/libc/generic/loader.c	(revision d8ef374853a3cffc0874d515566beaa840c79111)
@@ -101,4 +101,39 @@
 }
 
+/** Set current working directory for the loaded task.
+ *
+ * Sets the current working directory for the loaded task.
+ *
+ * @param ldr  Loader connection structure.
+ *
+ * @return Zero on success or negative error code.
+ *
+ */
+int loader_set_cwd(loader_t *ldr)
+{
+	char *cwd;
+	size_t len;
+
+	cwd = (char *) malloc(MAX_PATH_LEN + 1);
+	if (!cwd)
+		return ENOMEM;
+	if (!getcwd(cwd, MAX_PATH_LEN + 1))
+		str_cpy(cwd, MAX_PATH_LEN + 1, "/"); 
+	len = str_length(cwd);
+	
+	ipc_call_t answer;
+	aid_t req = async_send_0(ldr->phone_id, LOADER_SET_CWD, &answer);
+	int rc = async_data_write_start(ldr->phone_id, cwd, len);
+	free(cwd);
+	if (rc != EOK) {
+		async_wait_for(req, NULL);
+		return rc;
+	}
+	
+	ipcarg_t retval;
+	async_wait_for(req, &retval);
+	return (int) retval;
+}
+
 /** Set pathname of the program to load.
  *
Index: uspace/lib/libc/generic/task.c
===================================================================
--- uspace/lib/libc/generic/task.c	(revision 81342f721696310b9531caaff48b0e5a37182a5e)
+++ uspace/lib/libc/generic/task.c	(revision d8ef374853a3cffc0874d515566beaa840c79111)
@@ -89,4 +89,9 @@
 		goto error;
 	
+	/* Send spawner's current working directory. */
+	rc = loader_set_cwd(ldr);
+	if (rc != EOK)
+		goto error;
+	
 	/* Send program pathname. */
 	rc = loader_set_pathname(ldr, path);
@@ -98,5 +103,4 @@
 	if (rc != EOK)
 		goto error;
-	
 	
 	/* Send default files */
Index: uspace/lib/libc/include/ipc/loader.h
===================================================================
--- uspace/lib/libc/include/ipc/loader.h	(revision 81342f721696310b9531caaff48b0e5a37182a5e)
+++ uspace/lib/libc/include/ipc/loader.h	(revision d8ef374853a3cffc0874d515566beaa840c79111)
@@ -41,4 +41,5 @@
 	LOADER_HELLO = IPC_FIRST_USER_METHOD,
 	LOADER_GET_TASKID,
+	LOADER_SET_CWD,
 	LOADER_SET_PATHNAME,
 	LOADER_SET_ARGS,
Index: uspace/lib/libc/include/loader/loader.h
===================================================================
--- uspace/lib/libc/include/loader/loader.h	(revision 81342f721696310b9531caaff48b0e5a37182a5e)
+++ uspace/lib/libc/include/loader/loader.h	(revision d8ef374853a3cffc0874d515566beaa840c79111)
@@ -49,4 +49,5 @@
 extern loader_t *loader_connect(void);
 extern int loader_get_task_id(loader_t *, task_id_t *);
+extern int loader_set_cwd(loader_t *);
 extern int loader_set_pathname(loader_t *, const char *);
 extern int loader_set_args(loader_t *, char *const[]);
Index: uspace/lib/libc/include/loader/pcb.h
===================================================================
--- uspace/lib/libc/include/loader/pcb.h	(revision 81342f721696310b9531caaff48b0e5a37182a5e)
+++ uspace/lib/libc/include/loader/pcb.h	(revision d8ef374853a3cffc0874d515566beaa840c79111)
@@ -52,4 +52,7 @@
 	/** Program entry point. */
 	entry_point_t entry;
+
+	/** Current working directory. */
+	char *cwd;
 	
 	/** Number of command-line arguments. */
