2009/6/30 Alexander Best <[email protected]>:
> should be stdout.
>
>
> struct Header *hdr = rom;
>
> int new_fd = open("/dev/stdout", O_RDWR);
>
> printf("SIZE: %d\n",sizeof(*hdr));
>
> write(new_fd, hdr, sizeof(*hdr));
>
> close(new_fd);
You should really be checking what open returns, opening /dev/stdout
for reading is a bit weird not sure if that would work, and most
likely it's already open... Just use fileno(...):-
#include <unistd.h>
#include <stdio.h>
int main(void) {
write(fileno(stdout), "Hello world!\n", 13);
return 0;
}
Cheers,
--
Igor
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[email protected]"