>>>>> "Simon" == Simon Josefsson <[email protected]> writes:

Simon> Hi!  I maintain libidn and noticed the following code fails on
Simon> caballero:

Simon>   fd = func ("/dev/null", O_RDONLY); ASSERT (0 <= fd); { char
Simon> c; ASSERT (read (fd, &c, 1) == 0); }

What are the types of func and fd?  Is there a prototype in scope for
func() ?  What is the failure?  Does the first assertion fail?  Or
does the read() fail?

This program works on ia64 -- it completes with no output, and exits 0.

----
#include <fcntl.h>
#include <stdio.h>

int
main(int ac, char **av)
{
        int fd = open("/dev/null", O_RDONLY);
        char c;

        if (fd < 0) {
                fprintf(stderr, "fd = %d\n", fd);
                return 1;
        }
        if (read(fd, &c, 1) != 0) {
                fprintf(stderr, "read returns non-zero\n");
                return 1;
        }
        return 0;
}
--
Dr Peter Chubb                                  peter DOT chubb AT nicta.com.au
http://www.ertos.nicta.com.au               ERTOS within National ICT Australia
All things shall perish from under the sky/Music alone shall live, never to die


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: http://lists.debian.org/w4wrkiebkm.wl%[email protected]

Reply via email to