#define msgh_request_port msgh_remote_port
#define msgh_reply_port msgh_local_port
#define BOOTSTRAP_MAX_NAME_LEN 128
-typedef char name_t[BOOTSTRAP_MAX_NAME_LEN];
+typedef HChar name_t[BOOTSTRAP_MAX_NAME_LEN];
typedef uint64_t mig_addr_t;
mach_port_t port;
mach_port_type_t type; /* right type(s) */
Int send_count; /* number of send rights */
- Char *name; /* bootstrap name or NULL */
+ HChar *name; /* bootstrap name or NULL */
ExeContext *where; /* first allocation only */
struct OpenPort *next, *prev;
} OpenPort;
// Give a port a name, without changing its refcount
// GrP fixme don't override name if it already has a specific one
-__private_extern__ void assign_port_name(mach_port_t port, const char *name)
+__private_extern__ void assign_port_name(mach_port_t port, const HChar *name)
{
OpenPort *i;
if (!port) return;
i->name =
VG_(arena_malloc)(VG_AR_CORE, "syswrap-darwin.mach-port-name",
VG_(strlen)(name) + PORT_STRLEN + 1);
- VG_(sprintf)((HChar*)i->name, name, port);
+ VG_(sprintf)(i->name, name, port);
}
// Return the name of the given port or "UNKNOWN 0x1234" if not known.
-static const Char *name_for_port(mach_port_t port)
+static const HChar *name_for_port(mach_port_t port)
{
- static Char buf[8 + PORT_STRLEN + 1];
+ static HChar buf[8 + PORT_STRLEN + 1];
OpenPort *i;
// hack
- if (port == VG_(gettid)()) return (const Char *)"mach_thread_self()";
- if (port == 0) return (const Char *)"NULL";
+ if (port == VG_(gettid)()) return "mach_thread_self()";
+ if (port == 0) return "NULL";
i = allocated_ports;
while (i) {
i = i->next;
}
- VG_(sprintf)((HChar*)buf, "NONPORT-%#x", port);
+ VG_(sprintf)(buf, "NONPORT-%#x", port);
return buf;
}
/* Note the fact that a Mach port was just allocated or transferred.
If the port is already known, increment its reference count. */
void record_named_port(ThreadId tid, mach_port_t port,
- mach_port_right_t right, const char *name)
+ mach_port_right_t right, const HChar *name)
{
OpenPort *i;
if (!port) return;
/* ---------------------------------------------------------------------
darwin fcntl wrapper
------------------------------------------------------------------ */
-static const char *name_for_fcntl(UWord cmd) {
+static const HChar *name_for_fcntl(UWord cmd) {
#define F(n) case VKI_##n: return #n
switch (cmd) {
F(F_CHKCLEAN);
// but we ignore them all until some work item starts running on it.
}
-static const char *workqop_name(int op)
+static const HChar *workqop_name(int op)
{
switch (op) {
case VKI_WQOPS_QUEUE_ADD: return "QUEUE_ADD";
// by 'data'.
*flags |= SfMayBlock;
PRINT("sys_mount( %#lx(%s), %#lx(%s), %#lx, %#lx )",
- ARG1,(Char*)ARG1, ARG2,(Char*)ARG2, ARG3, ARG4);
+ ARG1,(char*)ARG1, ARG2,(char*)ARG2, ARG3, ARG4);
PRE_REG_READ4(long, "mount",
const char *, type, const char *, dir,
int, flags, void *, data);
// is, they to be run natively.
setuid_allowed = trace_this_child ? False : True;
ret = VG_(check_executable)(NULL/*&is_setuid*/,
- (HChar*)exe_name, setuid_allowed);
+ exe_name, setuid_allowed);
if (0 != ret) {
return VG_(mk_SysRes_Error)(ret);
}
}
/* Ok. So let's give it a try. */
- VG_(debugLog)(1, "syswrap", "Posix_spawn of %s\n", (Char*)ARG2);
+ VG_(debugLog)(1, "syswrap", "Posix_spawn of %s\n", (HChar*)ARG2);
/* posix_spawn on Darwin is combining the fork and exec in one syscall.
So, we should not terminate gdbserver : this is still the parent
if (port == vg_task_port) return True;
- return (0 == VG_(strncmp)("task-", (const HChar *)name_for_port(port), 5));
+ return (0 == VG_(strncmp)("task-", name_for_port(port), 5));
}