Index: uspace/app/bdsh/cmds/modules/cat/cat.c
===================================================================
--- uspace/app/bdsh/cmds/modules/cat/cat.c	(revision 38aaf00508acfd26f9d005fe19c221720104ca88)
+++ uspace/app/bdsh/cmds/modules/cat/cat.c	(revision 58898d1d7329ba67528bada931d3269d42936354)
@@ -31,4 +31,5 @@
 #include <stdlib.h>
 #include <unistd.h>
+#include <sys/stat.h>
 #include <getopt.h>
 #include <str.h>
@@ -187,4 +188,5 @@
 	size_t offset = 0, copied_bytes = 0;
 	off64_t file_size = 0, length = 0;
+	aoff64_t pos = 0;
 
 	bool reading_stdin = dash_represents_stdin && (str_cmp(fname, "-") == 0);
@@ -205,10 +207,18 @@
 		close(fd);
 		printf("Unable to allocate enough memory to read %s\n",
-			fname);
+		    fname);
 		return 1;
 	}
 
 	if (tail != CAT_FULL_FILE) {
-		file_size = lseek(fd, 0, SEEK_END);
+		struct stat st;
+
+		if (fstat(fd, &st) != EOK) {
+			close(fd);
+			free(buff);
+			printf("Unable to fstat %d\n", fd);
+			return 1;
+		}
+		file_size = st.size;
 		if (head == CAT_FULL_FILE) {
 			head = file_size;
@@ -223,7 +233,7 @@
 
 		if (tail_first) {
-			lseek(fd, (tail >= file_size) ? 0 : (file_size - tail), SEEK_SET);
+			pos = (tail >= file_size) ? 0 : (file_size - tail);
 		} else {
-			lseek(fd, ((head - tail) >= file_size) ? 0 : (head - tail), SEEK_SET);
+			pos = ((head - tail) >= file_size) ? 0 : (head - tail);
 		}
 	} else
@@ -243,5 +253,5 @@
 		}
 		
-		bytes = read(fd, buff + copied_bytes, bytes_to_read);
+		bytes = read(fd, &pos, buff + copied_bytes, bytes_to_read);
 		copied_bytes = 0;
 
Index: uspace/app/bdsh/cmds/modules/cmp/cmp.c
===================================================================
--- uspace/app/bdsh/cmds/modules/cmp/cmp.c	(revision 38aaf00508acfd26f9d005fe19c221720104ca88)
+++ uspace/app/bdsh/cmds/modules/cmp/cmp.c	(revision 58898d1d7329ba67528bada931d3269d42936354)
@@ -79,4 +79,5 @@
 	char buffer[2][CMP_BUFLEN];
 	ssize_t offset[2];
+	aoff64_t pos[2] = {};
 
 	for (int i = 0; i < 2; i++) {
@@ -94,5 +95,6 @@
 			ssize_t size;
 			do {
-				size = read(fd[i], buffer[i] + offset[i],
+				size = read(fd[i], &pos[i],
+				    buffer[i] + offset[i],
 				    CMP_BUFLEN - offset[i]);
 				if (size < 0) {
Index: uspace/app/bdsh/cmds/modules/cp/cp.c
===================================================================
--- uspace/app/bdsh/cmds/modules/cp/cp.c	(revision 38aaf00508acfd26f9d005fe19c221720104ca88)
+++ uspace/app/bdsh/cmds/modules/cp/cp.c	(revision 58898d1d7329ba67528bada931d3269d42936354)
@@ -377,4 +377,6 @@
 	int64_t copied = 0;
 	char *buff = NULL;
+	aoff64_t posr = 0, posw = 0;
+	struct stat st;
 
 	if (vb)
@@ -392,10 +394,14 @@
 	}
 
-	total = lseek(fd1, 0, SEEK_END);
-
+	if (fstat(fd1, &st) != EOK) {
+		printf("Unable to fstat %d\n", fd1);
+		close(fd1);
+		close(fd2);
+		return -1;	
+	}
+
+	total = st.size;
 	if (vb)
 		printf("%" PRIu64 " bytes to copy\n", total);
-
-	lseek(fd1, 0, SEEK_SET);
 
 	if (NULL == (buff = (char *) malloc(blen))) {
@@ -406,6 +412,6 @@
 	}
 
-	while ((bytes = read(fd1, buff, blen)) > 0) {
-		if ((bytes = write(fd2, buff, bytes)) < 0)
+	while ((bytes = read(fd1, &posr, buff, blen)) > 0) {
+		if ((bytes = write(fd2, &posw, buff, bytes)) < 0)
 			break;
 		copied += bytes;
Index: uspace/app/bdsh/cmds/modules/mkfile/mkfile.c
===================================================================
--- uspace/app/bdsh/cmds/modules/mkfile/mkfile.c	(revision 38aaf00508acfd26f9d005fe19c221720104ca88)
+++ uspace/app/bdsh/cmds/modules/mkfile/mkfile.c	(revision 58898d1d7329ba67528bada931d3269d42936354)
@@ -121,4 +121,5 @@
 	void *buffer;
 	bool create_sparse = false;
+	aoff64_t pos = 0;
 
 	file_size = 0;
@@ -164,11 +165,7 @@
 	if (create_sparse && file_size > 0) {
 		const char byte = 0x00;
-
-		if ((rc2 = lseek(fd, file_size - 1, SEEK_SET)) < 0) {
-			close(fd);
-			goto error;
-		}
-
-		rc2 = write(fd, &byte, sizeof(char));
+		
+		pos = file_size - 1;
+		rc2 = write(fd, &pos, &byte, sizeof(char));
 		if (rc2 < 0) {
 			close(fd);
@@ -187,5 +184,5 @@
 	while (total_written < file_size) {
 		to_write = min(file_size - total_written, BUFFER_SIZE);
-		rc = write(fd, buffer, to_write);
+		rc = write(fd, &pos, buffer, to_write);
 		if (rc <= 0) {
 			printf("%s: Error writing file (%d).\n", cmdname, errno);
