aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib
diff options
context:
space:
mode:
authorGene Cumm <gene.cumm@gmail.com>2010-06-26 22:51:39 -0400
committerH. Peter Anvin <hpa@zytor.com>2010-06-26 20:52:58 -0700
commit03791432c7207da9eb6c898bf15f003ab92ff10e (patch)
treedf8633fd7d4d2ac1014e9f17caf60d4a6b68019b /com32/lib
parent2d3c94d753dc27040c4ea93550429e231a205181 (diff)
downloadsyslinux-03791432c7207da9eb6c898bf15f003ab92ff10e.tar.gz
syslinux-03791432c7207da9eb6c898bf15f003ab92ff10e.tar.xz
syslinux-03791432c7207da9eb6c898bf15f003ab92ff10e.zip
PM getcwd(); Fix COM32 getcwd
Implement getcwd() in the core; Fix COM32 getcwd() to use the new function. This resolves the previous comment about COM32 getcwd() not working by not using INT 22h AX=001Fh. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32/lib')
-rw-r--r--com32/lib/getcwd.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/com32/lib/getcwd.c b/com32/lib/getcwd.c
index 38fae52a..5ce62ec0 100644
--- a/com32/lib/getcwd.c
+++ b/com32/lib/getcwd.c
@@ -2,29 +2,10 @@
* getcwd.c
*/
-#include <syslinux/config.h>
-#include <klibc/compiler.h>
#include <com32.h>
-
-#include <dirent.h>
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
+#include <syslinux/pmapi.h>
char *getcwd(char *buf, size_t size)
{
- static com32sys_t reg;
- char *pwdstr, *ret;
-
- reg.eax.w[0] = 0x001f;
- __intcall(0x22, &reg, &reg);
- pwdstr = MK_PTR(reg.es, reg.ebx.w[0]);
- if ((strlen(pwdstr) < size) && (buf != NULL)) {
- strcpy(buf, pwdstr);
- ret = buf;
- } else {
- ret = NULL;
- errno = ERANGE;
- }
- return ret;
+ return __com32.cs_pm->getcwd(buf, size);
}