help-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

pipe() fails with errno == EIEIO when debugging a translator


From: Steven Keuchel
Subject: pipe() fails with errno == EIEIO when debugging a translator
Date: Mon, 6 Sep 2004 19:07:25 +0000
User-agent: KMail/1.7

Heya list,

i got a problem calling pipe() in a translator and i'm kinda lost with it. It 
only happens when i debug the translator with gdb. pipe() return -1 and errno 
is set to EIEIO. If you run it normally (without attaching to gdb) it works 
though.

I've stripped my code for this purpose. The main.c is inlined here. If you 
want the package grab it from 
http://nydian.is-a-geek.org/~nydian/hurd/pipetest.tar.bz2

I'd appreciate any kind of help/advice..

Thx in advance,
        Steven Keuchel

*** main.c
#include <error.h>
#include <stdio.h>
#include <unistd.h>
#include <hurd/netfs.h>

int main(int argc, char**argv)
{
        mach_port_t bootstrap, underlying_node;
        int pipes[2];
        char buffer[256];

        task_get_bootstrap_port(mach_task_self(), &bootstrap);
        if(!MACH_PORT_VALID(bootstrap))
                error(EXIT_FAILURE,0,"must be started as a translator");

        netfs_init();
        underlying_node = netfs_startup(bootstrap, 0);
        if(!MACH_PORT_VALID(underlying_node))
                error(EXIT_FAILURE,0,"could not get the underlying node");

        if(pipe(pipes) < 0)
        {
                sprintf(buffer, "pipe() returned %i\n", errno);
                perror(buffer);
                exit(errno);
        }

        for(;;)
                netfs_server_loop();

        return 0;
}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]