/* handle systrace events until the child finishes */
for (;;) {
- nread = read(fd, &msg, sizeof(msg));
- if (nread != sizeof(msg)) {
+ if ((nread = read(fd, &msg, sizeof(msg))) != sizeof(msg)) {
if (dodetach) {
detachall(fd);
_exit(0);
systrace_read(fd, pid, addr, buf, bufsiz)
int fd;
pid_t pid;
- void *addr;
+ char *addr;
void *buf;
- size_t bufsiz;
+ int bufsiz;
{
struct systrace_io io;
* handle a strio_len > the actual kernel buffer. It might be nice
* to pass a starting chunksize though.
*/
-static ssize_t
+static int
read_string(fd, pid, addr, buf, bufsiz)
int fd;
pid_t pid;
- void *addr;
+ char *addr;
char *buf;
- size_t bufsiz;
+ int bufsiz;
{
- size_t chunksiz = 32;
+ int chunksiz = 32;
char *cp = buf, *ep;
while (bufsiz >= chunksiz) {
systrace_write(fd, pid, addr, buf, len)
int fd;
pid_t pid;
- void *addr;
+ char *addr;
void *buf;
- size_t len;
+ int len;
{
struct systrace_io io;
struct str_msg_ask *askp;
{
struct systrace_replace repl;
- ssize_t len;
char *envbuf[ARG_MAX / sizeof(char *)], **envp, **envep;
char buf[ARG_MAX], *ap, *cp, *off, *envptrs[4], *offsets[4], *replace[4];
- int n;
+ int len, n;
/*
* Iterate through the environment, copying the data pointers and
pid_t pid;
struct str_msg_ask *askp;
{
- ssize_t len;
+ int len;
char *off, *ap, *cp, *ep;
static char pbuf[PATH_MAX], abuf[ARG_MAX];
static int set_policy __P((int, struct childinfo *));
static int switch_emulation __P((int, struct str_message *));
static int systrace_open __P((void));
-static int systrace_read __P((int, pid_t, void *, void *, size_t));
+static int systrace_read __P((int, pid_t, char *, void *, int));
#ifdef STRIOCINJECT
-static int systrace_write __P((int, pid_t, void *, void *, size_t));
+static int systrace_write __P((int, pid_t, char *, void *, int));
static int update_env __P((int, pid_t, u_int16_t, struct str_msg_ask *));
#endif
static schandler_t find_handler __P((pid_t, int));
-static ssize_t read_string __P((int, pid_t, void *, char *, size_t));
+static int read_string __P((int, pid_t, char *, char *, int));
static struct childinfo *find_child __P((pid_t));
static void catchsig __P((int));
static void detachall __P((int));