|
From: <sv...@va...> - 2005-08-26 18:10:50
|
Author: sewardj
Date: 2005-08-26 19:10:45 +0100 (Fri, 26 Aug 2005)
New Revision: 4526
Log:
Completely remove the need for glibc in (experimental, statically
linked) Valgrind.
This commit:
- replaces a bunch of glibc functions with valgrind's m_libc*
equivalents
- does passes linker flags in memcheck/ so that glibc isn't even
linked
- adds our own _start in m_main.c, which establishes argc/argv/envp
and calls onwards to main()
The resulting memcheck works, except for timestamps and debug
attaching, neither of which are critical.
Modified:
branches/ASPACEM/coregrind/m_debugger.c
branches/ASPACEM/coregrind/m_libcfile.c
branches/ASPACEM/coregrind/m_libcprint.c
branches/ASPACEM/coregrind/m_libcproc.c
branches/ASPACEM/coregrind/m_main.c
branches/ASPACEM/coregrind/m_scheduler/scheduler.c
branches/ASPACEM/coregrind/m_signals.c
branches/ASPACEM/coregrind/m_ume.c
branches/ASPACEM/coregrind/pub_core_libcfile.h
branches/ASPACEM/coregrind/pub_core_libcproc.h
branches/ASPACEM/include/vki-linux.h
branches/ASPACEM/include/vki-x86-linux.h
branches/ASPACEM/memcheck/Makefile.am
Modified: branches/ASPACEM/coregrind/m_debugger.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_debugger.c 2005-08-26 13:24:10 UTC (rev =
4525)
+++ branches/ASPACEM/coregrind/m_debugger.c 2005-08-26 18:10:45 UTC (rev =
4526)
@@ -40,12 +40,14 @@
=20
// We can remove these easily by implementing our own VG_(ptrace)() and
// VG_(fork)().
-#include <sys/ptrace.h>
-#include <sys/wait.h>
-#include <unistd.h>
+//#include <sys/ptrace.h>
+//#include <sys/wait.h>
+//#include <unistd.h>
=20
static Int ptrace_setregs(Int pid, VexGuestArchState* vex)
{
+ I_die_here;
+#if 0
struct vki_user_regs_struct regs;
#if defined(VGA_x86)
regs.cs =3D vex->guest_CS;
@@ -93,6 +95,7 @@
#else
# error Unknown arch
#endif
+#endif /* 0 */
}
=20
/* Start debugger and get it to attach to this process. Called if the
@@ -102,7 +105,9 @@
continue, quit the debugger. */
void VG_(start_debugger) ( ThreadId tid )
{
- Int pid;
+ I_die_here;
+#if 0
+ Int pid;
=20
if ((pid =3D fork()) =3D=3D 0) {
ptrace(PTRACE_TRACEME, 0, NULL, NULL);
@@ -172,6 +177,7 @@
VG_(kill)(pid, VKI_SIGKILL);
VG_(waitpid)(pid, &status, 0);
}
+#endif
}
=20
=20
Modified: branches/ASPACEM/coregrind/m_libcfile.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_libcfile.c 2005-08-26 13:24:10 UTC (rev =
4525)
+++ branches/ASPACEM/coregrind/m_libcfile.c 2005-08-26 18:10:45 UTC (rev =
4526)
@@ -203,13 +203,13 @@
#endif
}
=20
-SSizeT VG_(pread) ( Int fd, void* buf, Int count, Int offset )
+SysRes VG_(pread) ( Int fd, void* buf, Int count, Int offset )
{
OffT off =3D VG_(lseek)( fd, (OffT)offset, VKI_SEEK_SET);
if (off !=3D 0)
- return (SSizeT)(-1);
+ return VG_(mk_SysRes_Error)( VKI_EINVAL );
SysRes res =3D VG_(do_syscall3)(__NR_read, fd, (UWord)buf, count );
- return (SSizeT)( res.isError ? -1 : res.val);
+ return res;
}
=20
/* ---------------------------------------------------------------------
Modified: branches/ASPACEM/coregrind/m_libcprint.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_libcprint.c 2005-08-26 13:24:10 UTC (rev=
4525)
+++ branches/ASPACEM/coregrind/m_libcprint.c 2005-08-26 18:10:45 UTC (rev=
4526)
@@ -38,8 +38,6 @@
#include "pub_core_options.h"
#include "valgrind.h" // For RUNNING_ON_VALGRIND
=20
-#include <time.h>
-#include <sys/time.h>
=20
=20
/* ---------------------------------------------------------------------
@@ -256,9 +254,10 @@
=20
void VG_(ctime) ( /*OUT*/HChar* buf )
{
+#if 0
struct timeval tv;
struct tm tm;
- buf[0] =3D 0; =20
+ buf[0] =3D 0;
if ( gettimeofday( &tv, NULL ) =3D=3D 0
&& localtime_r( &tv.tv_sec, &tm ) =3D=3D &tm )
{
@@ -267,6 +266,9 @@
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec, tv.tv_usec / 1000 =
);
}
+#else
+ VG_(strcpy)(buf, "VG_(ctime) HACK!");
+#endif
}
=20
=20
Modified: branches/ASPACEM/coregrind/m_libcproc.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_libcproc.c 2005-08-26 13:24:10 UTC (rev =
4525)
+++ branches/ASPACEM/coregrind/m_libcproc.c 2005-08-26 18:10:45 UTC (rev =
4526)
@@ -400,7 +400,32 @@
return VG_(do_syscall0)(__NR_getegid) . val;
}
=20
+/* Get supplementary groups into list[0 .. size-1]. Returns the
+ number of groups written, or -1 if error. Note that in order to be
+ portable, the groups are 32-bit unsigned ints regardless of the
+ platform. */
+Int VG_(getgroups)( Int size, UInt* list )
+{
+# if defined(VGP_x86_linux)
+ Int i;
+ SysRes sres;
+ UShort list16[32];
+ if (size < 0) return -1;
+ if (size > 32) size =3D 32;
+ sres =3D VG_(do_syscall2)(__NR_getgroups, size, (Addr)list16);
+ if (sres.isError)
+ return -1;
+ if (sres.val !=3D size)
+ return -1;
+ for (i =3D 0; i < size; i++)
+ list[i] =3D (UInt)list16[i];
+ return size;
=20
+# else
+# error "VG_(getgroups): needs implementation on this platform"
+# endif
+}
+
/* ---------------------------------------------------------------------
Timing stuff
------------------------------------------------------------------ */
Modified: branches/ASPACEM/coregrind/m_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_main.c 2005-08-26 13:24:10 UTC (rev 4525=
)
+++ branches/ASPACEM/coregrind/m_main.c 2005-08-26 18:10:45 UTC (rev 4526=
)
@@ -211,8 +211,56 @@
/*=3D=3D=3D Address space determination =
=3D=3D=3D*/
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
=20
+/* Glibc's sysdeps/i386/elf/start.S has the following gem of a
+ comment, which explains how the stack looks right at process start
+ (when _start is jumped to). Hence _start passes %esp to
+ _start_in_C, which extracts argc/argv/envp and starts up
+ correctly. */
+
+/* This is the canonical entry point, usually the first thing in the tex=
t
+ segment. The SVR4/i386 ABI (pages 3-31, 3-32) says that when the ent=
ry
+ point runs, most registers' values are unspecified, except for:
+
+ %edx Contains a function pointer to be registered with `atexi=
t'.
+ This is how the dynamic linker arranges to have DT_FINI
+ functions called for shared libraries that have been loa=
ded
+ before this code runs.
+
+ %esp The stack contains the arguments and environment:
+ 0(%esp) argc
+ 4(%esp) argv[0]
+ ...
+ (4*argc)(%esp) NULL
+ (4*(argc+1))(%esp) envp[0]
+ ...
+ NULL
+*/
+
extern char _start[];
=20
+asm("\n"
+ "\t.globl _start\n"
+ "\t.type _start,@function\n"
+ "_start:\n"
+ "\tmovl %esp,%eax\n"
+ "\tpushl %eax\n"
+ "\tcall _start_in_C\n"
+ "\thlt\n"
+);
+
+extern Int main (Int argc, HChar **argv, HChar **envp);
+
+static void _start_in_C ( Int* pArgc )
+{
+ Int argc =3D pArgc[0];
+ HChar** argv =3D (HChar**)&pArgc[1];
+ HChar** envp =3D (HChar**)&pArgc[1+argc+1];
+ Int r =3D main(argc,argv,envp);
+ VG_(exit)(r);
+}
+
+///////////////////////////////////////////////////////////////
+
static void layout_remaining_space(Addr argc_addr, float ratio)
{
SysRes res;
@@ -2846,6 +2894,7 @@
}
}
=20
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: branches/ASPACEM/coregrind/m_scheduler/scheduler.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_scheduler/scheduler.c 2005-08-26 13:24:1=
0 UTC (rev 4525)
+++ branches/ASPACEM/coregrind/m_scheduler/scheduler.c 2005-08-26 18:10:4=
5 UTC (rev 4526)
@@ -332,7 +332,7 @@
do { \
ThreadState * volatile _qq_tst =3D VG_(get_ThreadState)(tid); \
\
- (jumped) =3D setjmp(_qq_tst->sched_jmpbuf); =
\
+ (jumped) =3D __builtin_setjmp(_qq_tst->sched_jmpbuf); =
\
if ((jumped) =3D=3D 0) { \
vg_assert(!_qq_tst->sched_jmpbuf_valid); \
_qq_tst->sched_jmpbuf_valid =3D True; \
Modified: branches/ASPACEM/coregrind/m_signals.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_signals.c 2005-08-26 13:24:10 UTC (rev 4=
525)
+++ branches/ASPACEM/coregrind/m_signals.c 2005-08-26 18:10:45 UTC (rev 4=
526)
@@ -1508,7 +1508,7 @@
if (tst->sched_jmpbuf_valid) {
/* Can't continue; must longjmp back to the scheduler and thus
enter the sighandler immediately. */
- longjmp(tst->sched_jmpbuf, True);
+ __builtin_longjmp(tst->sched_jmpbuf, True);
}
}
=20
Modified: branches/ASPACEM/coregrind/m_ume.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_ume.c 2005-08-26 13:24:10 UTC (rev 4525)
+++ branches/ASPACEM/coregrind/m_ume.c 2005-08-26 18:10:45 UTC (rev 4526)
@@ -54,16 +54,7 @@
=20
#include "pub_core_ume.h"
=20
-//#include <sys/mman.h>
-#include <fcntl.h>
-#include <errno.h>
=20
-//#include <string.h>
-//#include <stdlib.h>
-//#include <unistd.h>
-//#include <assert.h>
-
-
// HACK HACK HACK HACK HACK HACK HACK HACK HACK HACK HACK HACK HACK A
// temporary bootstrapping allocator, for use until such time as we
// can get rid of the circularites in allocator dependencies at
@@ -306,15 +297,17 @@
static=20
struct elfinfo *readelf(int fd, const char *filename)
{
+ SysRes sres;
struct elfinfo *e =3D hack_malloc(sizeof(*e));
int phsz;
=20
vg_assert(e);
e->fd =3D fd;
=20
- if (VG_(pread)(fd, &e->e, sizeof(e->e), 0) !=3D sizeof(e->e)) {
+ sres =3D VG_(pread)(fd, &e->e, sizeof(e->e), 0);
+ if (sres.isError || sres.val !=3D sizeof(e->e)) {
VG_(printf)("valgrind: %s: can't read ELF header: %s\n",=20
- filename, VG_(strerror)(errno));
+ filename, VG_(strerror)(sres.val));
goto bad;
}
=20
@@ -351,9 +344,10 @@
e->p =3D hack_malloc(phsz);
vg_assert(e->p);
=20
- if (VG_(pread)(fd, e->p, phsz, e->e.e_phoff) !=3D phsz) {
+ sres =3D VG_(pread)(fd, e->p, phsz, e->e.e_phoff);
+ if (sres.isError || sres.val !=3D phsz) {
VG_(printf)("valgrind: can't read phdr: %s\n",=20
- VG_(strerror)(errno));
+ VG_(strerror)(sres.val));
//FIXME VG_(free)(e->p);
goto bad;
}
@@ -456,6 +450,7 @@
}
=20
// Forward declaration.
+/* returns: 0 =3D success, non-0 is failure */
static int do_exec_inner(const char *exe, struct exeinfo *info);
=20
static int match_ELF(const char *hdr, int len)
@@ -467,6 +462,7 @@
static int load_ELF(char *hdr, int len, int fd, const char *name,
struct exeinfo *info)
{
+ SysRes sres;
struct elfinfo *e;
struct elfinfo *interp =3D NULL;
ESZ(Addr) minaddr =3D ~0; /* lowest mapped address */
@@ -485,7 +481,7 @@
e =3D readelf(fd, name);
=20
if (e =3D=3D NULL)
- return ENOEXEC;
+ return VKI_ENOEXEC;
=20
/* The kernel maps position-independent executables at TASK_SIZE*2/3;
duplicate this behavior as close as we can. */
@@ -522,11 +518,12 @@
VG_(pread)(fd, buf, ph->p_filesz, ph->p_offset);
buf[ph->p_filesz] =3D '\0';
=20
- intfd =3D open(buf, O_RDONLY);
- if (intfd =3D=3D -1) {
+ sres =3D VG_(open)(buf, VKI_O_RDONLY, 0);
+ if (sres.isError) {
VG_(printf)("valgrind: m_ume.c: can't open interpreter\n");
VG_(exit)(1);
}
+ intfd =3D sres.val;
=20
interp =3D readelf(intfd, buf);
if (interp =3D=3D NULL) {
@@ -575,14 +572,14 @@
"acceptable range %p-%p\n",
(void *)minaddr + ebase, (void *)maxaddr + ebase,
(void *)info->exe_base, (void *)info->exe_end);
- return ENOMEM;
+ return VKI_ENOMEM;
}
}
=20
info->brkbase =3D mapelf(e, ebase); /* map the executable */
=20
if (info->brkbase =3D=3D 0)
- return ENOMEM;
+ return VKI_ENOMEM;
=20
if (interp !=3D NULL) {
/* reserve a chunk of address space for interpreter */
@@ -632,6 +629,7 @@
return (len > 2) && VG_(memcmp)(hdr, "#!", 2) =3D=3D 0;
}
=20
+/* returns: 0 =3D success, non-0 is failure */
static int load_script(char *hdr, int len, int fd, const char *name,
struct exeinfo *info)
{
@@ -646,7 +644,7 @@
interp++;
=20
if (*interp !=3D '/')
- return ENOEXEC; /* absolute path only for interpreter */
+ return VKI_ENOEXEC; /* absolute path only for interpreter */
=20
/* skip over interpreter name */
for(cp =3D interp; cp < end && *cp !=3D ' ' && *cp !=3D '\t' && *cp !=
=3D '\n'; cp++)
@@ -696,50 +694,54 @@
(otherwise the executable may misbehave if it doesn't have the
permissions it thinks it does).
*/
+/* returns: 0 =3D success, non-0 is failure */
static int check_perms(int fd)
{
- struct stat st;
+ struct vki_stat st;
=20
- if (fstat(fd, &st) =3D=3D -1)=20
- return errno;
+ if (VG_(fstat)(fd, &st) =3D=3D -1)=20
+ return VKI_EACCES;
=20
- if (st.st_mode & (S_ISUID | S_ISGID)) {
+ if (st.st_mode & (VKI_S_ISUID | VKI_S_ISGID)) {
//VG_(printf)("Can't execute suid/sgid executable %s\n", exe);
- return EACCES;
+ return VKI_EACCES;
}
=20
if (VG_(geteuid)() =3D=3D st.st_uid) {
- if (!(st.st_mode & S_IXUSR))
- return EACCES;
+ if (!(st.st_mode & VKI_S_IXUSR))
+ return VKI_EACCES;
} else {
int grpmatch =3D 0;
=20
if (VG_(getegid)() =3D=3D st.st_gid)
grpmatch =3D 1;
else {
- gid_t groups[32];
- int ngrp =3D getgroups(32, groups);
- int i;
-
- for(i =3D 0; i < ngrp; i++)
+ UInt groups[32];
+ Int ngrp =3D VG_(getgroups)(32, groups);
+ Int i;
+ /* ngrp will be -1 if VG_(getgroups) failed. */
+ for (i =3D 0; i < ngrp; i++) {
if (groups[i] =3D=3D st.st_gid) {
grpmatch =3D 1;
break;
}
+ }
}
=20
if (grpmatch) {
- if (!(st.st_mode & S_IXGRP))
- return EACCES;
- } else if (!(st.st_mode & S_IXOTH))
- return EACCES;
+ if (!(st.st_mode & VKI_S_IXGRP))
+ return VKI_EACCES;
+ } else if (!(st.st_mode & VKI_S_IXOTH))
+ return VKI_EACCES;
}
=20
return 0;
}
=20
+/* returns: 0 =3D success, non-0 is failure */
static int do_exec_inner(const char *exe, struct exeinfo *info)
{
+ SysRes sres;
int fd;
int err;
char buf[VKI_PAGE_SIZE];
@@ -755,13 +757,14 @@
{ match_script, load_script },
};
=20
- fd =3D open(exe, O_RDONLY);
- if (fd =3D=3D -1) {
+ sres =3D VG_(open)(exe, VKI_O_RDONLY, 0);
+ if (sres.isError) {
if (0)
VG_(printf)("Can't open executable %s: %s\n",
- exe, VG_(strerror)(errno));
- return errno;
+ exe, VG_(strerror)(sres.val));
+ return sres.val;
}
+ fd =3D sres.val;
=20
err =3D check_perms(fd);
if (err !=3D 0) {
@@ -769,15 +772,16 @@
return err;
}
=20
- bufsz =3D VG_(pread)(fd, buf, sizeof(buf), 0);
- if (bufsz < 0) {
+ sres =3D VG_(pread)(fd, buf, sizeof(buf), 0);
+ if (sres.isError || sres.val !=3D sizeof(buf)) {
VG_(printf)("Can't read executable header: %s\n",
- VG_(strerror)(errno));
+ VG_(strerror)(sres.val));
VG_(close)(fd);
- return errno;
+ return sres.val;
}
+ bufsz =3D sres.val;
=20
- ret =3D ENOEXEC;
+ ret =3D VKI_ENOEXEC;
for(i =3D 0; i < sizeof(formats)/sizeof(*formats); i++) {
if ((formats[i].match)(buf, bufsz)) {
ret =3D (formats[i].load)(buf, bufsz, fd, exe, info);
@@ -792,6 +796,7 @@
=20
// See ume.h for an indication of which entries of 'info' are inputs, wh=
ich
// are outputs, and which are both.
+/* returns: 0 =3D success, non-0 is failure */
int VG_(do_exec)(const char *exe, struct exeinfo *info)
{
info->interp_name =3D NULL;
Modified: branches/ASPACEM/coregrind/pub_core_libcfile.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/pub_core_libcfile.h 2005-08-26 13:24:10 UT=
C (rev 4525)
+++ branches/ASPACEM/coregrind/pub_core_libcfile.h 2005-08-26 18:10:45 UT=
C (rev 4526)
@@ -62,7 +62,7 @@
=20
extern Int VG_(access) ( HChar* path, Bool irusr, Bool iwusr, Bool ixusr=
);
=20
-extern SSizeT VG_(pread) ( Int fd, void* buf, Int count, Int offset );
+extern SysRes VG_(pread) ( Int fd, void* buf, Int count, Int offset );
=20
#endif // __PUB_CORE_LIBCFILE_H
=20
Modified: branches/ASPACEM/coregrind/pub_core_libcproc.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/pub_core_libcproc.h 2005-08-26 13:24:10 UT=
C (rev 4525)
+++ branches/ASPACEM/coregrind/pub_core_libcproc.h 2005-08-26 18:10:45 UT=
C (rev 4526)
@@ -73,8 +73,9 @@
extern Char **VG_(env_clone) ( Char **env_clone );
=20
// misc
-extern Int VG_(poll)( struct vki_pollfd *, UInt nfds, Int timeout);
+extern Int VG_(poll)( struct vki_pollfd *, UInt nfds, Int timeout);
extern void VG_(nanosleep) ( struct vki_timespec * );
+extern Int VG_(getgroups)( Int size, UInt* list );
=20
// atfork
typedef void (*vg_atfork_t)(ThreadId);
Modified: branches/ASPACEM/include/vki-linux.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/include/vki-linux.h 2005-08-26 13:24:10 UTC (rev 452=
5)
+++ branches/ASPACEM/include/vki-linux.h 2005-08-26 18:10:45 UTC (rev 452=
6)
@@ -1021,6 +1021,7 @@
#define VKI_EPERM 1 /* Operation not permitted */
#define VKI_ESRCH 3 /* No such process */
#define VKI_EINTR 4 /* Interrupted system call */
+#define VKI_ENOEXEC 8 /* Exec format error */
#define VKI_EBADF 9 /* Bad file number */
#define VKI_EAGAIN 11 /* Try again */
#define VKI_EWOULDBLOCK VKI_EAGAIN
Modified: branches/ASPACEM/include/vki-x86-linux.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/include/vki-x86-linux.h 2005-08-26 13:24:10 UTC (rev=
4525)
+++ branches/ASPACEM/include/vki-x86-linux.h 2005-08-26 18:10:45 UTC (rev=
4526)
@@ -315,12 +315,12 @@
#define VKI_SIOCGSTAMP 0x8906 /* Get stamp */
=20
//----------------------------------------------------------------------
-// From linux-2.6.8.1/include/asm-i386/stat.h
+// From linux-2.6.8.1/include/linux/stat.h
//----------------------------------------------------------------------
=20
#define VKI_S_IFMT 00170000
#define VKI_S_IFSOCK 0140000
-#define VKI_S_IFLNK 0120000
+#define VKI_S_IFLNK 0120000
#define VKI_S_IFREG 0100000
#define VKI_S_IFBLK 0060000
#define VKI_S_IFDIR 0040000
@@ -338,6 +338,21 @@
#define VKI_S_ISFIFO(m) (((m) & VKI_S_IFMT) =3D=3D VKI_S_IFIFO)
#define VKI_S_ISSOCK(m) (((m) & VKI_S_IFMT) =3D=3D VKI_S_IFSOCK)
=20
+#define VKI_S_IRWXU 00700
+#define VKI_S_IRUSR 00400
+#define VKI_S_IWUSR 00200
+#define VKI_S_IXUSR 00100
+
+#define VKI_S_IRWXG 00070
+#define VKI_S_IRGRP 00040
+#define VKI_S_IWGRP 00020
+#define VKI_S_IXGRP 00010
+
+#define VKI_S_IRWXO 00007
+#define VKI_S_IROTH 00004
+#define VKI_S_IWOTH 00002
+#define VKI_S_IXOTH 00001
+
struct vki_stat {
unsigned long st_dev;
unsigned long st_ino;
Modified: branches/ASPACEM/memcheck/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/memcheck/Makefile.am 2005-08-26 13:24:10 UTC (rev 45=
25)
+++ branches/ASPACEM/memcheck/Makefile.am 2005-08-26 18:10:45 UTC (rev 45=
26)
@@ -26,7 +26,8 @@
-static \
$(top_srcdir)/coregrind/libcoregrind.a \
-Wl,-defsym,valt_load_address=3D@VALT_LOAD_ADDRESS@ \
- -Wl,-T,$(top_srcdir)/valt_load_address.lds
+ -Wl,-T,$(top_srcdir)/valt_load_address.lds \
+ -nodefaultlibs -lgcc -nostartfiles
=20
mcincludedir =3D $(includedir)/valgrind
=20
|