Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Commit

Permalink
Revert "Add a fix for writev."
Browse files Browse the repository at this point in the history
It looks like Apple actually fixed this in Xcode 6.3 (but definitely not 6.1.1).
  • Loading branch information
Mehdi Mulani committed May 5, 2015
1 parent fe80a59 commit 97b6362
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions DTMobileISShim/DTMobileISShim/DTMobileISShim.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
//

#import <spawn.h>
#import <sys/uio.h>
#import "../../Common/dyld-interposing.h"
#import "../../Common/ArrayOfStrings.h"

Expand Down Expand Up @@ -59,29 +58,6 @@ static int _posix_spawn(pid_t *pid,
}
DYLD_INTERPOSE(_posix_spawn, posix_spawn);

// TODO: Insert giant ASCII clown right here.
// Instruments can't handle writev's of larger than 8KB. We really shouldn't
// be fixing this here but it's way too much effort to bug all the consumers
// and we have to rush for a deadline (classic clowniness).
static ssize_t _writev(int fildes, const struct iovec *iov, int iovcnt)
{
// Limiting scope here, but the only known case of this for us is when
// DDLog tries writing larger than 8KB, so let's handle that case.
if (iovcnt == 2 && iov[0].iov_len >= 8096) {
struct iovec iovv[2];

iovv[0].iov_base = iov[0].iov_base;
iovv[0].iov_len = 8096;
iovv[1].iov_base = iov[1].iov_base;
iovv[1].iov_len = iov[1].iov_len;
return writev(fildes, iovv, iovcnt);
}

return writev(fildes, iov, iovcnt);
}
DYLD_INTERPOSE(_writev, writev);


__attribute__((constructor)) static void EntryPoint(void) {
// Don't cascade into any other programs started.
unsetenv("DYLD_INSERT_LIBRARIES");
Expand Down

0 comments on commit 97b6362

Please sign in to comment.