[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 07/21] find_executable: port to EMX
From: |
KO Myung-Hun |
Subject: |
[PATCH 07/21] find_executable: port to EMX |
Date: |
Sun, 30 Nov 2014 13:20:09 +0900 |
* lib/progreloc.c (find_executable): Implement on EMX.
---
lib/progreloc.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/lib/progreloc.c b/lib/progreloc.c
index 3d7b6a9..5b9e247 100644
--- a/lib/progreloc.c
+++ b/lib/progreloc.c
@@ -44,6 +44,12 @@
# include <windows.h>
#endif
+#ifdef __EMX__
+# define INCL_DOS
+# include <os2.h>
+#endif
+
+
#include "relocatable.h"
#ifdef NO_XMALLOC
@@ -157,6 +163,18 @@ find_executable (const char *argv0)
/* Shouldn't happen. */
return NULL;
return xstrdup (location);
+#elif defined __EMX__
+ PPIB ppib;
+ char location[CCHMAXPATH];
+
+ DosGetInfoBlocks (NULL, &ppib);
+
+ if (DosQueryModuleName (ppib->pib_hmte, sizeof (location), location))
+ return NULL;
+
+ _fnslashify (location);
+
+ return xstrdup (location);
#else /* Unix */
# ifdef __linux__
/* The executable is accessible as /proc/<pid>/exe. In newer Linux
--
1.8.5.2
- [PATCH 03/21] git-version-gen: remove CR as well, (continued)
- [PATCH 03/21] git-version-gen: remove CR as well, KO Myung-Hun, 2014/11/30
- [PATCH 02/21] gnulib-tool: recognize x:* as an absolute path, KO Myung-Hun, 2014/11/30
- [PATCH 04/21] stdint: typedef gl_intptr_t and gl_uintptr_t correctly on OS/2 kLIBC, KO Myung-Hun, 2014/11/30
- [PATCH 05/21] spawn: do not include sched.h on OS/2 kLIBC, KO Myung-Hun, 2014/11/30
- [PATCH 06/21] Fix character encoding aliases for OS/2, KO Myung-Hun, 2014/11/30
- [PATCH 07/21] find_executable: port to EMX,
KO Myung-Hun <=
- [PATCH 08/21] get_shared_library_fullname: port to EMX, KO Myung-Hun, 2014/11/30
- [PATCH 09/21] relocatable: support UNIXROOT in relocate() on EMX, KO Myung-Hun, 2014/11/30
- [PATCH 12/21] pipe_filter_ii_execute: port to OS/2 kLIBC, KO Myung-Hun, 2014/11/30
- [PATCH 10/21] binary-io: put fd in binary mode if it is not a console on EMX, KO Myung-Hun, 2014/11/30